public class DefaultTag extends Object implements Tag
Modifier and Type | Field and Description |
---|---|
private I18nizableText |
_description |
private String |
_id |
private String |
_name |
private DefaultTag |
_parent |
private Map<String,DefaultTag> |
_tags |
private I18nizableText |
_title |
NAME_PATTERN
Constructor and Description |
---|
DefaultTag(String id)
Constructor
|
DefaultTag(String id,
String name,
DefaultTag parent,
I18nizableText title,
I18nizableText description)
Constructor
|
Modifier and Type | Method and 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 tag
|
String |
getParentName()
Get the parent name.
|
DefaultTag |
getTag(String tagId)
Try to get a child tag by its id
|
Map<String,DefaultTag> |
getTags()
Retrieves the Set of child tags
|
I18nizableText |
getTitle()
Retrieves the title.
|
boolean |
hasTag(String tagId)
Determines if a tag exists
|
void |
setTags(Map<String,? extends Tag> tags)
Set the child tags
|
private I18nizableText _title
private I18nizableText _description
private Map<String,DefaultTag> _tags
private DefaultTag _parent
public DefaultTag(String id)
id
- The id of the tag. The id must be unique.public DefaultTag(String id, String name, DefaultTag parent, I18nizableText title, I18nizableText description)
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 descriptionpublic I18nizableText getTitle()
Tag
public I18nizableText getDescription()
Tag
getDescription
in interface Tag
public String getParentName()
Tag
getParentName
in interface Tag
public DefaultTag getParent()
Tag
public Map<String,DefaultTag> getTags()
Tag
public DefaultTag getTag(String tagId)
Tag
public boolean hasTag(String tagId)
Tag