Modifier and Type | Class and Description |
---|---|
static class |
Tag.TagVisibility
Tag visibility
|
Modifier and Type | Field and Description |
---|---|
private I18nizableText |
_description |
private String |
_id |
private String |
_name |
private Tag |
_parent |
private Map<String,Tag> |
_tags |
private TagTargetType |
_targetType |
private I18nizableText |
_title |
private Tag.TagVisibility |
_visibility |
static Pattern |
NAME_PATTERN
The pattern a tag name has to respect.
|
Constructor and Description |
---|
Tag(String id)
Constructor
|
Tag(String id,
String name,
Tag parent,
I18nizableText title,
I18nizableText description,
Tag.TagVisibility visibility,
TagTargetType target)
Constructor
|
Tag(String id,
String name,
Tag parent,
I18nizableText title,
I18nizableText description,
TagTargetType target)
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.
|
Tag |
getParent()
Get the parent tag
|
String |
getParentName()
Get the parent name.
|
Tag |
getTag(String tagId)
Try to get a child tag by its id
|
Map<String,Tag> |
getTags()
Retrieves the Set of child tags
|
TagTargetType |
getTarget()
Retrieves the target type.
|
I18nizableText |
getTitle()
Retrieves the title.
|
Tag.TagVisibility |
getVisibility()
Retrieves the visibility type.
|
boolean |
hasTag(String tagId)
Determines if a tag exists
|
void |
setDescription(I18nizableText description)
Set the description.
|
void |
setTags(Map<String,Tag> tags)
Set the child tags
|
void |
setTarget(TagTargetType target)
Set the target type.
|
void |
setTitle(I18nizableText title)
Set the title.
|
void |
setVisibility(Tag.TagVisibility visibility)
Set the visibility type.
|
public static final Pattern NAME_PATTERN
private I18nizableText _title
private I18nizableText _description
private Tag.TagVisibility _visibility
private TagTargetType _targetType
public Tag(String id, String name, Tag parent, I18nizableText title, I18nizableText description, TagTargetType target)
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 descriptiontarget
- the type of targetpublic Tag(String id, String name, Tag parent, I18nizableText title, I18nizableText description, Tag.TagVisibility visibility, TagTargetType target)
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 descriptionvisibility
- the tag visibility.target
- The type of targetpublic String getParentName()
public Tag getParent()
public I18nizableText getTitle()
AmetysRepositoryException
- if an error occurs.public void setTitle(I18nizableText title)
title
- the title to set.public I18nizableText getDescription()
public void setDescription(I18nizableText description)
description
- the description to set.public Tag.TagVisibility getVisibility()
public void setVisibility(Tag.TagVisibility visibility)
visibility
- the visibility to set.public TagTargetType getTarget()
public void setTarget(TagTargetType target)
target
- the target to set.public void setTags(Map<String,Tag> tags)
tags
- The Map of Tag to setpublic Map<String,Tag> getTags()
public Tag getTag(String tagId)
tagId
- The id of the child tag