Class InjectableField
java.lang.Object
org.apache.sling.models.impl.model.InjectableField
- All Implemented Interfaces:
InjectableElement
-
Constructor Summary
ConstructorDescriptionInjectableField
(Field field, StaticInjectAnnotationProcessorFactory[] processorFactories, DefaultInjectionStrategy defaultInjectionStrategy) -
Method Summary
Modifier and TypeMethodDescriptionfinal AnnotatedElement
Class<?>
final String
getName()
final Type
getType()
getVia()
Class<? extends ViaProviderType>
boolean
boolean
isOptional
(InjectAnnotationProcessor annotationProcessor) boolean
-
Constructor Details
-
InjectableField
public InjectableField(Field field, StaticInjectAnnotationProcessorFactory[] processorFactories, DefaultInjectionStrategy defaultInjectionStrategy)
-
-
Method Details
-
set
public RuntimeException set(Object createdObject, org.apache.sling.models.impl.Result<Object> result) -
isPrimitive
public boolean isPrimitive()- Returns:
- true if original type of injectable is a primitive type
-
getFieldType
-
getFieldGenericType
-
getAnnotatedElement
- Specified by:
getAnnotatedElement
in interfaceInjectableElement
- Returns:
- Underlying annotated element
-
getType
- Specified by:
getType
in interfaceInjectableElement
- Returns:
- Type of injectable mapped to wrapper class
-
getName
- Specified by:
getName
in interfaceInjectableElement
- Returns:
- Name for injection
-
getSource
- Specified by:
getSource
in interfaceInjectableElement
- Returns:
- Via annotation or null
-
getVia
- Specified by:
getVia
in interfaceInjectableElement
- Returns:
- Via annotation or null
-
getViaProviderType
- Specified by:
getViaProviderType
in interfaceInjectableElement
-
hasDefaultValue
public boolean hasDefaultValue()- Specified by:
hasDefaultValue
in interfaceInjectableElement
- Returns:
- true, if a default value is set
-
getDefaultValue
- Specified by:
getDefaultValue
in interfaceInjectableElement
- Returns:
- Default value or null
-
isOptional
- Specified by:
isOptional
in interfaceInjectableElement
- Parameters:
annotationProcessor
- Annotation processor- Returns:
true
if the element is optional otherwisefalse
-