Class FieldComponent

    • Constructor Detail

      • FieldComponent

        public FieldComponent()
    • Method Detail

      • setup

        public final void setup​(String name,
                                AccessibleObject fieldOrMethod,
                                FormField field,
                                org.apache.sling.api.scripting.SlingScriptHelper sling)
      • init

        public abstract void init()
      • setHelper

        public final void setHelper​(org.apache.sling.api.scripting.SlingScriptHelper helper)
      • getHelper

        public final org.apache.sling.api.scripting.SlingScriptHelper getHelper()
      • setPath

        public final void setPath​(String path)
      • getPath

        public final String getPath()
      • getField

        @Deprecated
        public final Field getField()
        Deprecated.
        Use getAccessibleObject and AccessibleObjectUtils to handle both Method (getter) or Fields
        Get form field if possible
        Returns:
        Form field if a safe cast is possible otherwise null
      • getFieldDefinition

        public final FormField getFieldDefinition()
      • getHtml

        public final String getHtml()
      • buildComponentResource

        public org.apache.sling.api.resource.Resource buildComponentResource()
        If your component needs child nodes then override this method, call the superclass implementation, and then use addChildren to add additional nodes to it.
        Returns:
      • getComponentMetadata

        public final org.apache.sling.api.resource.ResourceMetadata getComponentMetadata()
        Returns:
        the componentMetadata
      • addClientLibrary

        public final void addClientLibrary​(String category)
      • addClientLibraries

        public final void addClientLibraries​(FieldComponent component)
      • getResourceType

        public final String getResourceType()
        Returns:
        the resourceType
      • setResourceType

        public final void setResourceType​(String resourceType)
        Parameters:
        resourceType - the resourceType to set
      • getResourceSuperType

        public final String getResourceSuperType()
        Returns:
        the resourceSuperType
      • setResourceSuperType

        public final void setResourceSuperType​(String resourceSuperType)
        Parameters:
        resourceSuperType - the resourceSuperType to set
      • purgeEmptyMetadata

        public final void purgeEmptyMetadata()
      • getName

        public final String getName()
        Returns:
        the name
      • hasOption

        public final boolean hasOption​(String optionName)
      • getCategory

        public final String getCategory()
        Returns:
        the category
      • setCategory

        public final void setCategory​(String category)
        Parameters:
        category - the category to set