Interface Component


  • @ProviderType
    public interface Component
    A interface to represent a sling:Component
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      @NotNull String[] getComponentType()
      Returns the type of the component.
      String getEditPath()
      Returns the path for the editor for this resource if available
      org.apache.sling.api.resource.Resource getEditResource()
      Returns the resource for the editor for this resource if available
      org.apache.sling.api.resource.Resource getResource()
      The underlying Sling Resource
      String getTitle()
      Get the title of the component
      boolean isContainer()
      True if the component is a container, false otherwise.
      boolean isEditable()
      True if the component is editable, false otherwise.
      boolean isReloadPage()
      Returns true if the the property reloadPage is set to true.
      boolean isType​(String type)
      Returns true if the only component type on the component is the specified type.
    • Method Detail

      • getComponentType

        @NotNull
        @NotNull String[] getComponentType()
        Returns the type of the component. A component can belong to multiple types
        Returns:
        the component type
      • getEditPath

        String getEditPath()
        Returns the path for the editor for this resource if available
        Returns:
        the editor path or null
      • getEditResource

        org.apache.sling.api.resource.Resource getEditResource()
        Returns the resource for the editor for this resource if available
        Returns:
        the editor resource or null
      • getResource

        org.apache.sling.api.resource.Resource getResource()
        The underlying Sling Resource
        Returns:
        the resource
      • getTitle

        String getTitle()
        Get the title of the component
        Returns:
        the title
      • isContainer

        boolean isContainer()
        True if the component is a container, false otherwise.
        Returns:
        the container flag
      • isEditable

        boolean isEditable()
        True if the component is editable, false otherwise.
        Returns:
        the editable flag
      • isReloadPage

        boolean isReloadPage()
        Returns true if the the property reloadPage is set to true.
        Returns:
        true if page should be reloaded when the component is saved
      • isType

        boolean isType​(String type)
        Returns true if the only component type on the component is the specified type.
        Parameters:
        type - the type of the resource to check
        Returns:
        true if the resource is of the specified type