Class MCRJSONCategory
java.lang.Object
org.mycore.frontend.classeditor.json.MCRJSONCategory
- All Implemented Interfaces:
MCRCategory
GSON Category abstraction.
- Author:
- Chi
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionReturns a list of subcategories.getId()
int
getLeft()
int
getLevel()
Returns the hierarchie level of this category.Returns the parent elementint
getRoot()
Returns root category (the classification).getURI()
Returns the URI associated with this category.boolean
Tells if this category has subcategories.boolean
boolean
void
setChildren
(List<MCRCategory> children) void
setHasChildren
(boolean hasChildren) void
setId
(MCRCategoryID id) void
void
setParent
(MCRCategory parent) void
setParentID
(MCRCategoryID parentID) void
setPositionInParent
(int positionInParent) void
-
Constructor Details
-
MCRJSONCategory
public MCRJSONCategory() -
MCRJSONCategory
-
-
Method Details
-
setParent
-
setChildren
-
getLeft
public int getLeft() -
getLevel
public int getLevel()Description copied from interface:MCRCategory
Returns the hierarchie level of this category.- Specified by:
getLevel
in interfaceMCRCategory
- Returns:
- 0 if this is the root category
-
setHasChildren
public void setHasChildren(boolean hasChildren) -
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:
-
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:
-
getPositionInParent
public int getPositionInParent() -
setPositionInParent
public void setPositionInParent(int positionInParent) -
getId
- Specified by:
getId
in interfaceMCRCategory
- Returns:
- the id
-
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
-
setId
- Specified by:
setId
in interfaceMCRCategory
- Parameters:
id
- the id to set
-
setURI
- Specified by:
setURI
in interfaceMCRCategory
- Parameters:
uri
- the URI to set
-
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
-
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
-
setLabels
-
getLabel
- Specified by:
getLabel
in interfaceMCRCategory
- Returns:
- the label in the specified language (if available) or null
-
setParentID
-
getParentID
-
isClassification
public boolean isClassification()- Specified by:
isClassification
in interfaceMCRCategory
- Returns:
- true if this is a root category
-
isCategory
public boolean isCategory()- Specified by:
isCategory
in interfaceMCRCategory
- Returns:
- true if this is not a root category
- See Also:
-
asMCRImpl
-