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 Modifier and Type Field Description protected AnnotationHelperannotationHelper
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractMappingAnnotationProcessorContext(AnnotationHelper annotationHelper)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <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.ContainerExtractorPathtoContainerExtractorPath(ContainerExtraction extraction)Convert aContainerExtractionannotation to aContainerExtractorPath.<T> TtoNullIfDefault(T value, T defaultValue)Optional<PojoModelPathValueNode>toPojoModelPathValueNode(ObjectPath objectPath)Convert anObjectPathannotation to aPojoModelPathValueNode.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.hibernate.search.mapper.pojo.mapping.definition.annotation.processing.MappingAnnotationProcessorContext
annotatedElement, eventContext, toBeanReference, toMap
-
-
-
-
Field Detail
-
annotationHelper
protected final AnnotationHelper annotationHelper
-
-
Constructor Detail
-
AbstractMappingAnnotationProcessorContext
protected AbstractMappingAnnotationProcessorContext(AnnotationHelper annotationHelper)
-
-
Method Detail
-
toPojoModelPathValueNode
public Optional<PojoModelPathValueNode> toPojoModelPathValueNode(ObjectPath objectPath)
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
public ContainerExtractorPath toContainerExtractorPath(ContainerExtraction extraction)
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.
-
-