Package org.apache.sling.cms
Interface Component
-
@ProviderType public interface ComponentA 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.StringgetEditPath()Returns the path for the editor for this resource if availableorg.apache.sling.api.resource.ResourcegetEditResource()Returns the resource for the editor for this resource if availableorg.apache.sling.api.resource.ResourcegetResource()The underlying Sling ResourceStringgetTitle()Get the title of the componentbooleanisContainer()True if the component is a container, false otherwise.booleanisEditable()True if the component is editable, false otherwise.booleanisReloadPage()Returns true if the the property reloadPage is set to true.booleanisType(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
-
-