Class ConstructorParameter

  • All Implemented Interfaces:
    InjectableElement

    public class ConstructorParameter
    extends Object
    Constructor parameters aren't normally accessible using the AnnotatedElement. This class acts as a facade to ease compatibility with field and method injection.
    • Constructor Detail

      • ConstructorParameter

        public ConstructorParameter​(Annotation[] annotations,
                                    Type parameterType,
                                    Type genericType,
                                    boolean isPrimitive,
                                    int parameterIndex,
                                    org.apache.sling.models.spi.injectorspecific.StaticInjectAnnotationProcessorFactory[] processorFactories,
                                    org.apache.sling.models.annotations.DefaultInjectionStrategy defaultInjectionStrategy)
    • Method Detail

      • getGenericType

        public Type getGenericType()
      • getParameterType

        public Type getParameterType()
      • isPrimitive

        public boolean isPrimitive()
        Returns:
        true if original type of injectable is a primitive type
      • getParameterIndex

        public int getParameterIndex()
      • getType

        public final Type getType()
        Specified by:
        getType in interface InjectableElement
        Returns:
        Type of injectable mapped to wrapper class
      • isOptional

        public boolean isOptional​(org.apache.sling.models.spi.injectorspecific.InjectAnnotationProcessor annotationProcessor)
        Specified by:
        isOptional in interface InjectableElement
        Parameters:
        annotationProcessor - Annotation processor
        Returns:
        true if the element is optional otherwise false