Package com.day.cq.commons
Class JcrLabeledResource
- java.lang.Object
-
- com.day.cq.commons.JcrLabeledResource
-
- All Implemented Interfaces:
LabeledResource
public class JcrLabeledResource extends java.lang.Object implements LabeledResource
Implements a labeled resource that reads the values from jcr properties.
-
-
Constructor Summary
Constructors Constructor Description JcrLabeledResource(Node node)Creates a new JcrLabeledResource and initializes its field from the properties of the given node or it'sjcr:contentchild node.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetDescription()Returns the description of this resource.java.lang.StringgetName()Returns the name of this resource.java.lang.StringgetPath()Returns the path of this resourcejava.lang.StringgetTitle()Returns the tile of this resource.
-
-
-
Constructor Detail
-
JcrLabeledResource
public JcrLabeledResource(Node node) throws RepositoryException
Creates a new JcrLabeledResource and initializes its field from the properties of the given node or it'sjcr:contentchild node.- Parameters:
node- the node- Throws:
RepositoryException- if an error during repository access occurs.
-
-
Method Detail
-
getPath
public java.lang.String getPath()
Returns the path of this resource- Specified by:
getPathin interfaceLabeledResource- Returns:
- the path of the underlying node
-
getName
public java.lang.String getName()
Returns the name of this resource. this is usually the last segment of it's path.- Specified by:
getNamein interfaceLabeledResource- Returns:
- the name of the underlying node
-
getTitle
public java.lang.String getTitle()
Returns the tile of this resource.- Specified by:
getTitlein interfaceLabeledResource- Returns:
- the value of the
jcr:titleproperty of the underlying node or of it'sjcr:contentchild node if it exists.nullotherwise.
-
getDescription
public java.lang.String getDescription()
Returns the description of this resource.- Specified by:
getDescriptionin interfaceLabeledResource- Returns:
- the value of the
jcr:descriptionproperty of the underlying node or of it'sjcr:contentchild node if it exists.nullotherwise.
-
-