Class OptionalTypedInjectableElement
- java.lang.Object
-
- org.apache.sling.models.impl.model.OptionalTypedInjectableElement
-
- All Implemented Interfaces:
InjectableElement
public class OptionalTypedInjectableElement extends Object implements InjectableElement
-
-
Constructor Summary
Constructors Constructor Description OptionalTypedInjectableElement(InjectableElement element, Type type)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AnnotatedElement
getAnnotatedElement()
Object
getDefaultValue()
String
getName()
String
getSource()
Type
getType()
String
getVia()
Class<? extends org.apache.sling.models.annotations.ViaProviderType>
getViaProviderType()
boolean
hasDefaultValue()
boolean
isOptional(org.apache.sling.models.spi.injectorspecific.InjectAnnotationProcessor annotationProcessor)
boolean
isPrimitive()
-
-
-
Constructor Detail
-
OptionalTypedInjectableElement
public OptionalTypedInjectableElement(InjectableElement element, Type type)
-
-
Method Detail
-
getAnnotatedElement
public AnnotatedElement getAnnotatedElement()
- Specified by:
getAnnotatedElement
in interfaceInjectableElement
- Returns:
- Underlying annotated element
-
getType
public Type getType()
- Specified by:
getType
in interfaceInjectableElement
- Returns:
- Type of injectable mapped to wrapper class
-
isPrimitive
public boolean isPrimitive()
- Specified by:
isPrimitive
in interfaceInjectableElement
- Returns:
- true if original type of injectable is a primitive type
-
getName
public String getName()
- Specified by:
getName
in interfaceInjectableElement
- Returns:
- Name for injection
-
getSource
public String getSource()
- Specified by:
getSource
in interfaceInjectableElement
- Returns:
- Via annotation or null
-
getVia
public String getVia()
- Specified by:
getVia
in interfaceInjectableElement
- Returns:
- Via annotation or null
-
getViaProviderType
public Class<? extends org.apache.sling.models.annotations.ViaProviderType> getViaProviderType()
- Specified by:
getViaProviderType
in interfaceInjectableElement
-
hasDefaultValue
public boolean hasDefaultValue()
- Specified by:
hasDefaultValue
in interfaceInjectableElement
- Returns:
- true, if a default value is set
-
getDefaultValue
public Object getDefaultValue()
- Specified by:
getDefaultValue
in interfaceInjectableElement
- Returns:
- Default value or null
-
isOptional
public boolean isOptional(org.apache.sling.models.spi.injectorspecific.InjectAnnotationProcessor annotationProcessor)
- Specified by:
isOptional
in interfaceInjectableElement
- Parameters:
annotationProcessor
- Annotation processor- Returns:
true
if the element is optional otherwisefalse
-
-