Modifier and Type | Field and Description |
---|---|
static ElementKey<java.lang.Void,Category> |
KEY
The key for this element.
|
static AttributeKey<java.lang.String> |
LABEL
The category label attribute.
|
static AttributeKey<java.lang.String> |
SCHEME
The category scheme attribute.
|
static AttributeKey<java.lang.String> |
TERM
The category term attribute.
|
static AttributeKey<java.lang.String> |
XML_LANG
Qualified name for the XML lang attribute
|
Modifier | Constructor and Description |
---|---|
|
Category()
Constructs a new category instance using the default metadata.
|
protected |
Category(ElementKey<?,? extends Category> key)
Constructs a new category instance using the specified element key.
|
protected |
Category(ElementKey<?,? extends Category> key,
Element source)
Constructs a new instance by doing a shallow copy of data from an existing
Element instance. |
|
Category(java.lang.String category)
Constructs a new category from a Category string.
|
|
Category(java.lang.String scheme,
java.lang.String term)
Constructs a new category with the specified scheme and term values.
|
|
Category(java.lang.String scheme,
java.lang.String term,
java.lang.String label)
Constructs a new category with the specified scheme, term, and label
values.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
java.lang.String |
getLabel()
Returns the category label or
null if there is no label value. |
java.lang.String |
getLabelLang()
Returns the language associated with the category label (or
null
if undefined). |
java.lang.String |
getScheme()
Returns the category scheme or
null if the category does not have
a scheme. |
java.lang.String |
getTerm()
Returns the category term.
|
int |
hashCode() |
Category |
lock()
Locks this element.
|
protected Element |
narrow(ElementMetadata<?,?> meta,
ValidationContext vc)
Narrow down element's type to the most specific one possible.
|
static void |
registerMetadata(MetadataRegistry registry)
Registers the metadata for this element.
|
void |
setLabel(java.lang.String label)
Sets the category label.
|
void |
setLabelLang(java.lang.String lang)
Sets the language associated with the category label (or
nulll if
undefined). |
void |
setScheme(java.lang.String scheme)
Sets the category scheme.
|
void |
setTerm(java.lang.String term)
Sets the category term value.
|
java.lang.String |
toString() |
adapt, adapt, addElement, addElement, addElement, clear, createElement, createElement, eq, getAttributeCount, getAttributeIterator, getAttributeIterator, getAttributeValue, getAttributeValue, getDefaultKey, getElement, getElement, getElementCount, getElementId, getElementIterator, getElementIterator, getElementKey, getElements, getElements, getElementSet, getElementSet, getElementValue, getElementValue, getTextValue, getTextValue, hasAttribute, hasAttribute, hasElement, hasElement, hasTextValue, isLocked, removeAttribute, removeAttribute, removeAttributeValue, removeAttributeValue, removeElement, removeElement, removeElement, removeElement, replaceElement, resolve, resolve, sameClassAs, setAttributeValue, setAttributeValue, setElement, setElement, setElement, setTextValue, validate, visit
public static final ElementKey<java.lang.Void,Category> KEY
public static final AttributeKey<java.lang.String> SCHEME
public static final AttributeKey<java.lang.String> TERM
public static final AttributeKey<java.lang.String> LABEL
public static final AttributeKey<java.lang.String> XML_LANG
public Category()
protected Category(ElementKey<?,? extends Category> key)
key
- the element key for the category.protected Category(ElementKey<?,? extends Category> key, Element source)
Element
instance. Will use the given ElementKey
as
the key for the element.key
- the element key to use for the categorysource
- source elementpublic Category(java.lang.String category)
category
- the category stringpublic Category(java.lang.String scheme, java.lang.String term)
public Category(java.lang.String scheme, java.lang.String term, java.lang.String label)
public static void registerMetadata(MetadataRegistry registry)
public Category lock()
Element
public java.lang.String getScheme()
null
if the category does not have
a scheme.public void setScheme(java.lang.String scheme)
null
indicates that there is
no category scheme.scheme
- category scheme URI.public java.lang.String getTerm()
public void setTerm(java.lang.String term)
term
- public java.lang.String getLabel()
null
if there is no label value.public void setLabel(java.lang.String label)
null
indicates that there is
no label.label
- category label value.public java.lang.String getLabelLang()
null
if undefined).public void setLabelLang(java.lang.String lang)
nulll
if
undefined).lang
- label language.protected Element narrow(ElementMetadata<?,?> meta, ValidationContext vc)
Element
Any validation errors discovered during narrowing are accumulated in the validation context.
Default action is to not do anything with current element. Subclasses may override this function to narrow the type in some custom fashion.