Package org.ametys.cms.tag
Class DefaultTag
- java.lang.Object
-
- org.ametys.cms.tag.DefaultTag
-
- All Implemented Interfaces:
Tag
public class DefaultTag extends Object implements Tag
This class represent a Tag
-
-
Field Summary
Fields Modifier and Type Field Description private I18nizableText
_description
private String
_id
private String
_name
private DefaultTag
_parent
private Map<String,DefaultTag>
_tags
private I18nizableText
_title
-
Fields inherited from interface org.ametys.cms.tag.Tag
NAME_PATTERN
-
-
Constructor Summary
Constructors Constructor Description DefaultTag(String id)
ConstructorDefaultTag(String id, String name, DefaultTag parent, I18nizableText title, I18nizableText description)
Constructor
-
Method Summary
All Methods Instance Methods Concrete 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.DefaultTag
getParent()
Get the parent tagString
getParentName()
Get the parent name.DefaultTag
getTag(String tagId)
Try to get a child tag by its idMap<String,DefaultTag>
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
-
_title
private I18nizableText _title
-
_description
private I18nizableText _description
-
_tags
private Map<String,DefaultTag> _tags
-
_parent
private DefaultTag _parent
-
-
Constructor Detail
-
DefaultTag
public DefaultTag(String id)
Constructor- Parameters:
id
- The id of the tag. The id must be unique.
-
DefaultTag
public DefaultTag(String id, String name, DefaultTag parent, I18nizableText title, I18nizableText description)
Constructor- Parameters:
id
- The id of the tag. The id must be unique.name
- The name of the tag. The name must be unique. The name is the same as the id except for JCR tag.parent
- The parent tag (can be null if the tag has no parent)title
- the tag titledescription
- the tag description
-
-
Method Detail
-
getTitle
public I18nizableText getTitle()
Description copied from interface:Tag
Retrieves the title.
-
getDescription
public I18nizableText getDescription()
Description copied from interface:Tag
Retrieves the description.- Specified by:
getDescription
in interfaceTag
- Returns:
- the description.
-
getParentName
public String getParentName()
Description copied from interface:Tag
Get the parent name.- Specified by:
getParentName
in interfaceTag
- Returns:
- The parent name.
-
getParent
public DefaultTag getParent()
Description copied from interface:Tag
Get the parent tag
-
getTags
public Map<String,DefaultTag> getTags()
Description copied from interface:Tag
Retrieves the Set of child tags
-
getTag
public DefaultTag getTag(String tagId)
Description copied from interface:Tag
Try to get a child tag by its id
-
hasTag
public boolean hasTag(String tagId)
Description copied from interface:Tag
Determines if a tag exists
-
-