Class JcrLabeledResource

java.lang.Object
com.day.cq.commons.JcrLabeledResource
All Implemented Interfaces:
LabeledResource

public class JcrLabeledResource extends Object implements LabeledResource
Implements a labeled resource that reads the values from jcr properties.
  • Constructor Details

    • JcrLabeledResource

      public JcrLabeledResource(Node node) throws RepositoryException
      Creates a new JcrLabeledResource and initializes its field from the properties of the given node or it's jcr:content child node.
      Parameters:
      node - the node
      Throws:
      RepositoryException - if an error during repository access occurs.
  • Method Details

    • getPath

      public String getPath()
      Returns the path of this resource
      Specified by:
      getPath in interface LabeledResource
      Returns:
      the path of the underlying node
    • getName

      public String getName()
      Returns the name of this resource. this is usually the last segment of it's path.
      Specified by:
      getName in interface LabeledResource
      Returns:
      the name of the underlying node
    • getTitle

      public String getTitle()
      Returns the tile of this resource.
      Specified by:
      getTitle in interface LabeledResource
      Returns:
      the value of the jcr:title property of the underlying node or of it's jcr:content child node if it exists. null otherwise.
    • getDescription

      public String getDescription()
      Returns the description of this resource.
      Specified by:
      getDescription in interface LabeledResource
      Returns:
      the value of the jcr:description property of the underlying node or of it's jcr:content child node if it exists. null otherwise.