Interface MCRCategory

All Known Implementing Classes:
MCRAbstractCategoryImpl, MCRCategoryImpl, MCRJSONCategory

public interface MCRCategory
Since:
2.0
Version:
$Revision$ $Date$
Author:
Thomas Scheffler (yagee)
  • Method Details

    • isClassification

      boolean isClassification()
      Returns:
      true if this is a root category
    • isCategory

      boolean isCategory()
      Returns:
      true if this is not a root category
      See Also:
    • hasChildren

      boolean hasChildren()
      Tells if this category has subcategories.
      Returns:
      true if this category has subcategories
      See Also:
    • getChildren

      List<MCRCategory> getChildren()
      Returns a list of subcategories. Implementors must never return null if no children are present. As this method may need a new call the underlaying persistence layer use hasChildren() if you just want to know if subcategories are present. Changes to the list may not affect the underlaying persistence layer.
      Returns:
      subcategories
      See Also:
    • getId

      MCRCategoryID getId()
      Returns:
      the id
    • setId

      void setId(MCRCategoryID id)
      Parameters:
      id - the id to set
    • getLabels

      SortedSet<MCRLabel> getLabels()
      Returns:
      the labels
    • getCurrentLabel

      Optional<MCRLabel> getCurrentLabel()
      Returns:
      the label in the current language (if available), default language (if available), any language in MCR.Metadata.Languages(if available), any other language that does not start with x- or any other language
    • getLabel

      Optional<MCRLabel> getLabel(String lang)
      Returns:
      the label in the specified language (if available) or null
    • getLevel

      int getLevel()
      Returns the hierarchie level of this category.
      Returns:
      0 if this is the root category
    • getRoot

      MCRCategory getRoot()
      Returns root category (the classification).
      Returns:
      the root category
    • getParent

      MCRCategory getParent()
      Returns the parent element
      Returns:
      the categories parent or null if isClassification()==true or category currently not attached
    • getURI

      URI getURI()
      Returns the URI associated with this category.
      Returns:
      the URI
    • setURI

      void setURI(URI uri)
      Parameters:
      uri - the URI to set