Class ComponentImpl

java.lang.Object
org.apache.sling.cms.core.internal.models.ComponentImpl
All Implemented Interfaces:
Component

@Model(adaptables=org.apache.sling.api.resource.Resource.class, adapters=org.apache.sling.cms.Component.class) public class ComponentImpl extends Object implements Component
A model representing a sling:Component
  • Constructor Details

    • ComponentImpl

      public ComponentImpl(org.apache.sling.api.resource.Resource resource)
  • Method Details

    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • getComponentType

      public String[] getComponentType()
      Specified by:
      getComponentType in interface Component
      Returns:
      the componentType
    • getEditPath

      public String getEditPath()
      Returns the path for the editor for this resource if available
      Specified by:
      getEditPath in interface Component
      Returns:
      the editor path or null
    • getEditResource

      public org.apache.sling.api.resource.Resource getEditResource()
      Returns the resource for the editor for this resource if available
      Specified by:
      getEditResource in interface Component
      Returns:
      the editor resource or null
    • getResource

      public org.apache.sling.api.resource.Resource getResource()
      Specified by:
      getResource in interface Component
      Returns:
      the resource
    • getTitle

      public String getTitle()
      Specified by:
      getTitle in interface Component
      Returns:
      the title
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • isContainer

      public boolean isContainer()
      Specified by:
      isContainer in interface Component
    • isEditable

      public boolean isEditable()
      Specified by:
      isEditable in interface Component
    • isReloadPage

      public boolean isReloadPage()
      Specified by:
      isReloadPage in interface Component
    • isType

      public boolean isType(String type)
      Returns true if the only component type on the component is the specified type.
      Specified by:
      isType in interface Component
      Parameters:
      type - the type of the resource to check
      Returns:
      true if the resource is of the specified type
    • toString

      public String toString()
      Overrides:
      toString in class Object