Class AbstractMappingAnnotationProcessorContext
java.lang.Object
org.hibernate.search.mapper.pojo.mapping.definition.annotation.processing.impl.AbstractMappingAnnotationProcessorContext
- All Implemented Interfaces:
MappingAnnotationProcessorContext
- Direct Known Subclasses:
ConstructorMappingAnnotationProcessorContextImpl,MethodParameterMappingAnnotationProcessorContextImpl,PropertyMappingAnnotationProcessorContextImpl,TypeMappingAnnotationProcessorContextImpl
public abstract class AbstractMappingAnnotationProcessorContext
extends Object
implements MappingAnnotationProcessorContext
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedAbstractMappingAnnotationProcessorContext(AnnotationHelper annotationHelper) -
Method Summary
Modifier and TypeMethodDescription<T> Optional<BeanReference<? extends T>>toBeanReference(Class<T> expectedType, Class<?> undefinedTypeMarker, Class<? extends T> type, String name, BeanRetrieval retrieval) Convert attributes of a bean-reference annotation, such asValueBridgeRef, to an actualBeanReference.toContainerExtractorPath(ContainerExtraction extraction) Convert aContainerExtractionannotation to aContainerExtractorPath.<T> TtoNullIfDefault(T value, T defaultValue) toPojoModelPathValueNode(ObjectPath objectPath) Convert anObjectPathannotation to aPojoModelPathValueNode.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.hibernate.search.mapper.pojo.mapping.definition.annotation.processing.MappingAnnotationProcessorContext
annotatedElement, eventContext, toBeanReference, toMap
-
Field Details
-
annotationHelper
-
-
Constructor Details
-
AbstractMappingAnnotationProcessorContext
-
-
Method Details
-
toPojoModelPathValueNode
Description copied from interface:MappingAnnotationProcessorContextConvert anObjectPathannotation to aPojoModelPathValueNode.- Specified by:
toPojoModelPathValueNodein interfaceMappingAnnotationProcessorContext- Parameters:
objectPath- The annotation to convert.- Returns:
- The corresponding path, or an empty optional if the path was empty.
-
toContainerExtractorPath
Description copied from interface:MappingAnnotationProcessorContextConvert aContainerExtractionannotation to aContainerExtractorPath.- Specified by:
toContainerExtractorPathin interfaceMappingAnnotationProcessorContext- Parameters:
extraction- The annotation to convert.- Returns:
- The corresponding path.
-
toBeanReference
public <T> Optional<BeanReference<? extends T>> toBeanReference(Class<T> expectedType, Class<?> undefinedTypeMarker, Class<? extends T> type, String name, BeanRetrieval retrieval) Description copied from interface:MappingAnnotationProcessorContextConvert attributes of a bean-reference annotation, such asValueBridgeRef, to an actualBeanReference.Example of use:
Optional<BeanReference<? extends ValueBridge>> valueBridgeRef = toBeanReference( ValueBridge.class, ValueBridgeRef.UndefinedBridgeImplementationType.class, myValueBridgeRefInstance.type(), myValueBridgeRefInstance.name(), myValueBridgeRefInstance.retrieval() );- Specified by:
toBeanReferencein interfaceMappingAnnotationProcessorContext- Type Parameters:
T- The bean type.- Parameters:
expectedType- The supertype of all types that can be referenced.undefinedTypeMarker- A marker type to detect that thetypeparameter has its default value (undefined).type- The bean type.name- The bean name.retrieval- How to retrieve the bean. SeeBeanRetrieval.- Returns:
- The corresponding bean reference, or an empty optional if neither the type nor the name is provided.
-
toNullIfDefault
public <T> T toNullIfDefault(T value, T defaultValue) - Specified by:
toNullIfDefaultin interfaceMappingAnnotationProcessorContext- Parameters:
value- A value extracted from an annotation attribute.defaultValue- A default value for that annotation attribute.- Returns:
nullifvalueisequaltodefaultValue,valueotherwise.
-