Package org.ametys.cms.tag
Interface Tag
-
- All Known Implementing Classes:
Category
,CategoryCMSTag
,CMSTag
,DefaultTag
,KeywordCMSTag
public interface Tag
This class represent a Tag
-
-
Field Summary
Fields Modifier and Type Field Description static Pattern
NAME_PATTERN
The pattern a tag name has to respect.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addTag(Tag tag)
Add a new child tag.I18nizableText
getDescription()
Retrieves the description.String
getId()
Get the tag unique id.String
getName()
Get the tag name.<T extends Tag>
TgetParent()
Get the parent tagString
getParentName()
Get the parent name.<T extends Tag>
TgetTag(String tagId)
Try to get a child tag by its idMap<String,? extends Tag>
getTags()
Retrieves the Set of child tagsI18nizableText
getTitle()
Retrieves the title.boolean
hasTag(String tagId)
Determines if a tag existsvoid
setTags(Map<String,? extends Tag> tags)
Set the child tags
-
-
-
Field Detail
-
NAME_PATTERN
static final Pattern NAME_PATTERN
The pattern a tag name has to respect.
-
-
Method Detail
-
getParentName
String getParentName()
Get the parent name.- Returns:
- The parent name.
-
getParent
<T extends Tag> T getParent()
Get the parent tag- Type Parameters:
T
- the tag class- Returns:
- The parent tag or null if the tag has no parent.
-
getTitle
I18nizableText getTitle()
Retrieves the title.- Returns:
- the title.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getDescription
I18nizableText getDescription()
Retrieves the description.- Returns:
- the description.
-
setTags
void setTags(Map<String,? extends Tag> tags)
Set the child tags- Parameters:
tags
- The Map of Tag to set
-
getTags
Map<String,? extends Tag> getTags()
Retrieves the Set of child tags- Returns:
- The child tags in a Map
-
getTag
<T extends Tag> T getTag(String tagId)
Try to get a child tag by its id- Type Parameters:
T
- the tag class- Parameters:
tagId
- The id of the child tag- Returns:
- The child tag or null if not existing
-
-