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:content
child node.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getDescription()
Returns the description of this resource.java.lang.String
getName()
Returns the name of this resource.java.lang.String
getPath()
Returns the path of this resourcejava.lang.String
getTitle()
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:content
child 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:
getPath
in 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:
getName
in interfaceLabeledResource
- Returns:
- the name of the underlying node
-
getTitle
public java.lang.String getTitle()
Returns the tile of this resource.- Specified by:
getTitle
in interfaceLabeledResource
- Returns:
- the value of the
jcr:title
property of the underlying node or of it'sjcr:content
child node if it exists.null
otherwise.
-
getDescription
public java.lang.String getDescription()
Returns the description of this resource.- Specified by:
getDescription
in interfaceLabeledResource
- Returns:
- the value of the
jcr:description
property of the underlying node or of it'sjcr:content
child node if it exists.null
otherwise.
-
-