Class InjectableField

java.lang.Object
org.apache.sling.models.impl.model.InjectableField
All Implemented Interfaces:
InjectableElement

public class InjectableField extends Object
  • Constructor Details

    • InjectableField

      public InjectableField(Field field, org.apache.sling.models.spi.injectorspecific.StaticInjectAnnotationProcessorFactory[] processorFactories, org.apache.sling.models.annotations.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

      public Class<?> getFieldType()
    • getFieldGenericType

      public Type getFieldGenericType()
    • getAnnotatedElement

      public final AnnotatedElement getAnnotatedElement()
      Specified by:
      getAnnotatedElement in interface InjectableElement
      Returns:
      Underlying annotated element
    • getType

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

      public final String getName()
      Specified by:
      getName in interface InjectableElement
      Returns:
      Name for injection
    • getSource

      public String getSource()
      Specified by:
      getSource in interface InjectableElement
      Returns:
      Via annotation or null
    • getVia

      public String getVia()
      Specified by:
      getVia in interface InjectableElement
      Returns:
      Via annotation or null
    • getViaProviderType

      public Class<? extends org.apache.sling.models.annotations.ViaProviderType> getViaProviderType()
      Specified by:
      getViaProviderType in interface InjectableElement
    • hasDefaultValue

      public boolean hasDefaultValue()
      Specified by:
      hasDefaultValue in interface InjectableElement
      Returns:
      true, if a default value is set
    • getDefaultValue

      public Object getDefaultValue()
      Specified by:
      getDefaultValue in interface InjectableElement
      Returns:
      Default value or null
    • 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