Package org.apache.sling.cms
Interface Component
@ProviderType
public interface Component
A interface to represent a sling:Component
-
Method Summary
Modifier and TypeMethodDescription@NotNull String[]Returns the type of the component.Returns the path for the editor for this resource if availableorg.apache.sling.api.resource.ResourceReturns the resource for the editor for this resource if availableorg.apache.sling.api.resource.ResourceThe underlying Sling ResourcegetTitle()Get the title of the componentbooleanTrue if the component is a container, false otherwise.booleanTrue if the component is editable, false otherwise.booleanReturns true if the the property reloadPage is set to true.booleanReturns true if the only component type on the component is the specified type.
-
Method Details
-
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
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
-