com.google.gdata.model.atom
Class Category

java.lang.Object
  extended by com.google.gdata.model.Element
      extended by com.google.gdata.model.atom.Category
All Implemented Interfaces:
ICategory

public class Category
extends Element
implements ICategory

The Category class represents the data model for the Atom category element.


Field Summary
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
 
Constructor Summary
Category()
          Constructs a new category instance using the default metadata.
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.
 
Method Summary
 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.
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()
           
 
Methods inherited from class com.google.gdata.model.Element
addElement, addElement, addElement, clear, createElement, createElement, 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, setAttributeValue, setAttributeValue, setElement, setElement, setElement, setTextValue, visit
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

KEY

public static final ElementKey<java.lang.Void,Category> KEY
The key for this element.


SCHEME

public static final AttributeKey<java.lang.String> SCHEME
The category scheme attribute.


TERM

public static final AttributeKey<java.lang.String> TERM
The category term attribute.


LABEL

public static final AttributeKey<java.lang.String> LABEL
The category label attribute.


XML_LANG

public static final AttributeKey<java.lang.String> XML_LANG
Qualified name for the XML lang attribute

Constructor Detail

Category

public Category()
Constructs a new category instance using the default metadata.


Category

public Category(java.lang.String category)
Constructs a new category from a Category string. The format of the String is the same as the one used to represent a category in a GData query: an optional scheme surrounded by braces, followed by a term.

Parameters:
category - the category string

Category

public Category(java.lang.String scheme,
                java.lang.String term)
Constructs a new category with the specified scheme and term values.


Category

public 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.

Method Detail

registerMetadata

public static void registerMetadata(MetadataRegistry registry)
Registers the metadata for this element.


lock

public Category lock()
Description copied from class: Element
Locks this element. A locked element cannot have any changes made to its content or its attributes or child elements. This will also lock all attributes and child elements as well. Once this method has been called, this element can be safely published to other threads.

Overrides:
lock in class Element

getScheme

public java.lang.String getScheme()
Returns the category scheme or null if the category does not have a scheme.

Specified by:
getScheme in interface ICategory
Returns:
category scheme or null.

setScheme

public void setScheme(java.lang.String scheme)
Sets the category scheme. A value of null indicates that there is no category scheme.

Parameters:
scheme - category scheme URI.

getTerm

public java.lang.String getTerm()
Returns the category term.

Specified by:
getTerm in interface ICategory
Returns:
category term value.

setTerm

public void setTerm(java.lang.String term)
Sets the category term value.

Parameters:
term -

getLabel

public java.lang.String getLabel()
Returns the category label or null if there is no label value.

Specified by:
getLabel in interface ICategory
Returns:
category label (or @code null}.

setLabel

public void setLabel(java.lang.String label)
Sets the category label. A value of null indicates that there is no label.

Parameters:
label - category label value.

getLabelLang

public java.lang.String getLabelLang()
Returns the language associated with the category label (or null if undefined).


setLabelLang

public void setLabelLang(java.lang.String lang)
Sets the language associated with the category label (or nulll if undefined).

Parameters:
lang - label language.

toString

public java.lang.String toString()
Overrides:
toString in class Element

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class Element

hashCode

public int hashCode()
Overrides:
hashCode in class Element