Class InjectableMethod
java.lang.Object
org.apache.sling.models.impl.model.InjectableMethod
- All Implemented Interfaces:
InjectableElement
-
Constructor Summary
ConstructorsConstructorDescriptionInjectableMethod(Method method, StaticInjectAnnotationProcessorFactory[] processorFactories, DefaultInjectionStrategy defaultInjectionStrategy) -
Method Summary
Modifier and TypeMethodDescriptionfinal AnnotatedElementfinal StringgetName()final TypegetType()getVia()Class<? extends ViaProviderType>booleanbooleanisOptional(InjectAnnotationProcessor annotationProcessor) boolean
-
Constructor Details
-
InjectableMethod
public InjectableMethod(Method method, StaticInjectAnnotationProcessorFactory[] processorFactories, DefaultInjectionStrategy defaultInjectionStrategy)
-
-
Method Details
-
getMethod
-
getGenericReturnType
- Returns:
- Generic return type of method (may be primitive)
-
isPrimitive
public boolean isPrimitive()- Returns:
- true if original type of injectable is a primitive type
-
getAnnotatedElement
- Specified by:
getAnnotatedElementin interfaceInjectableElement- Returns:
- Underlying annotated element
-
getType
- Specified by:
getTypein interfaceInjectableElement- Returns:
- Type of injectable mapped to wrapper class
-
getName
- Specified by:
getNamein interfaceInjectableElement- Returns:
- Name for injection
-
getSource
- Specified by:
getSourcein interfaceInjectableElement- Returns:
- Via annotation or null
-
getVia
- Specified by:
getViain interfaceInjectableElement- Returns:
- Via annotation or null
-
getViaProviderType
- Specified by:
getViaProviderTypein interfaceInjectableElement
-
hasDefaultValue
public boolean hasDefaultValue()- Specified by:
hasDefaultValuein interfaceInjectableElement- Returns:
- true, if a default value is set
-
getDefaultValue
- Specified by:
getDefaultValuein interfaceInjectableElement- Returns:
- Default value or null
-
isOptional
- Specified by:
isOptionalin interfaceInjectableElement- Parameters:
annotationProcessor- Annotation processor- Returns:
trueif the element is optional otherwisefalse
-