Class MCRAbstractCategoryImpl
java.lang.Object
org.mycore.datamodel.classifications2.impl.MCRAbstractCategoryImpl
- All Implemented Interfaces:
MCRCategory
- Direct Known Subclasses:
MCRCategoryImpl
- Since:
- 2.0
- Version:
- $Revision$ $Date$
- Author:
- Thomas Scheffler (yagee)
-
Field Summary
Modifier and TypeFieldDescriptionprotected final MCRReadWriteGuard
protected List<MCRCategory>
protected MCRCategory
protected MCRCategory
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns a list of subcategories.getId()
Returns the parent elementgetRoot()
Returns root category (the classification).getURI()
Returns the URI associated with this category.boolean
Tells if this category has subcategories.final boolean
final boolean
protected abstract void
setChildrenUnlocked
(List<MCRCategory> children) void
setId
(MCRCategoryID id) void
setParent
(MCRCategory parent) void
toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.mycore.datamodel.classifications2.MCRCategory
getLevel
-
Field Details
-
childGuard
-
root
-
parent
-
labels
-
children
-
-
Constructor Details
-
MCRAbstractCategoryImpl
public MCRAbstractCategoryImpl()
-
-
Method Details
-
getChildren
Description copied from interface:MCRCategory
Returns a list of subcategories. Implementors must never returnnull
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.- Specified by:
getChildren
in interfaceMCRCategory
- Returns:
- subcategories
- See Also:
-
setChildrenUnlocked
-
getId
- Specified by:
getId
in interfaceMCRCategory
- Returns:
- the id
-
setId
- Specified by:
setId
in interfaceMCRCategory
- Parameters:
id
- the id to set
-
getLabels
- Specified by:
getLabels
in interfaceMCRCategory
- Returns:
- the labels
-
getRoot
Description copied from interface:MCRCategory
Returns root category (the classification).- Specified by:
getRoot
in interfaceMCRCategory
- Returns:
- the root category
-
getURI
Description copied from interface:MCRCategory
Returns the URI associated with this category.- Specified by:
getURI
in interfaceMCRCategory
- Returns:
- the URI
-
setURI
- Specified by:
setURI
in interfaceMCRCategory
- Parameters:
uri
- the URI to set
-
hasChildren
public boolean hasChildren()Description copied from interface:MCRCategory
Tells if this category has subcategories.- Specified by:
hasChildren
in interfaceMCRCategory
- Returns:
- true if this category has subcategories
- See Also:
-
isCategory
public final boolean isCategory()- Specified by:
isCategory
in interfaceMCRCategory
- Returns:
- true if this is not a root category
- See Also:
-
isClassification
public final boolean isClassification()- Specified by:
isClassification
in interfaceMCRCategory
- Returns:
- true if this is a root category
-
getParent
Description copied from interface:MCRCategory
Returns the parent element- Specified by:
getParent
in interfaceMCRCategory
- Returns:
- the categories parent or null if isClassification()==true or category currently not attached
-
setParent
-
getCurrentLabel
- Specified by:
getCurrentLabel
in interfaceMCRCategory
- 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
- Specified by:
getLabel
in interfaceMCRCategory
- Returns:
- the label in the specified language (if available) or null
-
toString
-