Class ReflectionMatcher
java.lang.Object
org.infinispan.query.objectfilter.impl.BaseMatcher<Class<?>, org.infinispan.query.objectfilter.impl.util.ReflectionHelper.PropertyAccessor, String>
org.infinispan.query.objectfilter.impl.ReflectionMatcher
- All Implemented Interfaces:
Matcher
- Direct Known Subclasses:
ObjectReflectionMatcher
public class ReflectionMatcher
extends BaseMatcher<Class<?>, org.infinispan.query.objectfilter.impl.util.ReflectionHelper.PropertyAccessor, String>
- Since:
- 7.0
- Author:
- anistor@redhat.com
-
Field Summary
Fields inherited from class BaseMatcher
propertyHelper -
Constructor Summary
ConstructorsConstructorDescriptionReflectionMatcher(ClassLoader classLoader) ReflectionMatcher(org.infinispan.query.objectfilter.impl.syntax.parser.EntityNameResolver<Class<?>> entityNameResolver) ReflectionMatcher(org.infinispan.query.objectfilter.impl.syntax.parser.ObjectPropertyHelper<Class<?>> propertyHelper) -
Method Summary
Modifier and TypeMethodDescriptionprotected MetadataAdapter<Class<?>, org.infinispan.query.objectfilter.impl.util.ReflectionHelper.PropertyAccessor, String> createMetadataAdapter(Class<?> clazz) protected org.infinispan.query.objectfilter.impl.predicateindex.ReflectionMatcherEvalContextstartMultiTypeContext(boolean isDeltaFilter, Object userContext, Object eventType, Object instance) Creates a newMatcherEvalContextcapable of dealing with multiple filters.protected org.infinispan.query.objectfilter.impl.predicateindex.ReflectionMatcherEvalContextstartSingleTypeContext(Object userContext, Object eventType, Object key, Object instance, Object metadata, MetadataAdapter<Class<?>, org.infinispan.query.objectfilter.impl.util.ReflectionHelper.PropertyAccessor, String> metadataAdapter) Creates a newMatcherEvalContextcapable of dealing with a single filter for a single type.Methods inherited from class BaseMatcher
convert, getFilterRegistryForType, getObjectFilter, getObjectFilter, getObjectFilter, getObjectFilter, getPropertyHelper, match, matchDelta, registerFilter, registerFilter, registerFilter, registerFilter, registerFilter, registerFilter, unregisterFilter
-
Constructor Details
-
ReflectionMatcher
public ReflectionMatcher(org.infinispan.query.objectfilter.impl.syntax.parser.ObjectPropertyHelper<Class<?>> propertyHelper) -
ReflectionMatcher
-
ReflectionMatcher
public ReflectionMatcher(org.infinispan.query.objectfilter.impl.syntax.parser.EntityNameResolver<Class<?>> entityNameResolver)
-
-
Method Details
-
startMultiTypeContext
protected org.infinispan.query.objectfilter.impl.predicateindex.ReflectionMatcherEvalContext startMultiTypeContext(boolean isDeltaFilter, Object userContext, Object eventType, Object instance) Description copied from class:BaseMatcherCreates a newMatcherEvalContextcapable of dealing with multiple filters. The context is created only if the given instance is recognized to be of a type that has some filters registered. If there are no filters,nullis returned to signal this condition and make the evaluation faster. This method must be called while holding the internal write lock.- Specified by:
startMultiTypeContextin classBaseMatcher<Class<?>, org.infinispan.query.objectfilter.impl.util.ReflectionHelper.PropertyAccessor, String>- Parameters:
isDeltaFilter- indicates if this is a delta match of notuserContext- an opaque value, possibly null, the is received from the caller and is to be handed to theFilterCallbackin case a match is detectedeventType- on optional event type discriminatorinstance- the instance to filter; nevernull- Returns:
- the MatcherEvalContext or
nullif no filter was registered for the instance
-
startSingleTypeContext
protected org.infinispan.query.objectfilter.impl.predicateindex.ReflectionMatcherEvalContext startSingleTypeContext(Object userContext, Object eventType, Object key, Object instance, Object metadata, MetadataAdapter<Class<?>, org.infinispan.query.objectfilter.impl.util.ReflectionHelper.PropertyAccessor, String> metadataAdapter) Description copied from class:BaseMatcherCreates a newMatcherEvalContextcapable of dealing with a single filter for a single type. The context is created only if the given instance is recognized to be of a type that has some filters registered. If there are no filters,nullis returned to signal this condition and make the evaluation faster. This method must be called while holding the internal write lock.- Specified by:
startSingleTypeContextin classBaseMatcher<Class<?>, org.infinispan.query.objectfilter.impl.util.ReflectionHelper.PropertyAccessor, String>- Parameters:
userContext- an opaque value, possibly null, the is received from the caller and is to be handed to theFilterCallbackin case a match is detectedinstance- the instance to filter; nevernullmetadataAdapter- the metadata adapter of expected instance type- Returns:
- the MatcherEvalContext or
nullif no filter was registered for the instance
-
createMetadataAdapter
protected MetadataAdapter<Class<?>, org.infinispan.query.objectfilter.impl.util.ReflectionHelper.PropertyAccessor, String> createMetadataAdapter(Class<?> clazz) - Specified by:
createMetadataAdapterin classBaseMatcher<Class<?>, org.infinispan.query.objectfilter.impl.util.ReflectionHelper.PropertyAccessor, String>
-