|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.google.gdata.data.AbstractExtension
com.google.gdata.data.ExtensionPoint
com.google.gdata.data.introspection.Categories
public class Categories
The Categories class implements the data model for the AtomPub categories element, as described in Sec 7.2.1 of the AtomPub specification.
| Nested Class Summary | |
|---|---|
class |
Categories.Handler
The Handler class implements the XmlParser.ElementHandler for
parsing an app:categories element. |
| Nested classes/interfaces inherited from class com.google.gdata.data.ExtensionPoint |
|---|
ExtensionPoint.CumulativeBlobHandler, ExtensionPoint.ExtensionHandler |
| Nested classes/interfaces inherited from class com.google.gdata.data.AbstractExtension |
|---|
AbstractExtension.AttributesHandler |
| Field Summary |
|---|
| Fields inherited from class com.google.gdata.data.ExtensionPoint |
|---|
xmlBlob |
| Fields inherited from class com.google.gdata.data.AbstractExtension |
|---|
localName, namespace |
| Constructor Summary | |
|---|---|
Categories()
Constructs a new empty Categories instance for the purposes of parsing an AtomPub categories element or document. |
|
Categories(boolean fixed,
java.lang.String defaultScheme,
Category... categories)
Constructs a Categories instance with in-line category descriptions. |
|
Categories(java.lang.String href)
Constructs a Categories instance that references an out-of-line list of categories stored in a category document. |
|
| Method Summary | |
|---|---|
void |
addCategory(Category category)
Adds a new category to the category list. |
protected void |
consumeAttributes(AttributeHelper helper)
Consumes attributes from the attribute helper. |
void |
generate(com.google.gdata.util.common.xml.XmlWriter w,
ExtensionProfile extProfile)
Generates XML. |
java.util.List<Category> |
getCategoryList()
Returns the list of in-line categories or null if there is no
associated list. |
java.lang.String |
getDefaultScheme()
Returns the default scheme used for nested categories if not specified directly on the instance. |
XmlParser.ElementHandler |
getHandler(ExtensionProfile p,
java.lang.String namespace,
java.lang.String localName,
org.xml.sax.Attributes attrs)
The default implementation uses the AbstractExtension.AttributesHandler to handle
parsing the extension. |
java.lang.String |
getHref()
Returns the location of an external AtomPub categories document that describes the list of categories. |
boolean |
isFixed()
Returns true if the Categories instance contains in-line category
data that is a fixed set. |
void |
parseAtom(ExtensionProfile extProfile,
XmlParser parser)
Parses a Categories element using data read from the specified parser instance. |
void |
validate()
Checks the attributes to see if there are any problems. |
| Methods inherited from class com.google.gdata.data.AbstractExtension |
|---|
eq, generateAttributes, getExtensionLocalName, getExtensionNamespace, isImmutable, putAttributes, sameClassAs, setImmutable, throwExceptionForMissingAttribute, throwExceptionIfImmutable |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Categories()
parseAtom(ExtensionProfile, XmlParser)
public Categories(boolean fixed,
java.lang.String defaultScheme,
Category... categories)
fixed - true if the list of categories is a fixed set,
false if an open set.defaultScheme - the default scheme uri value that will be used for all
nested category elements that do not have a scheme.categories - list of categories.public Categories(java.lang.String href)
href - | Method Detail |
|---|
public boolean isFixed()
true if the Categories instance contains in-line category
data that is a fixed set.
true there is a fixed set of categories.public java.lang.String getDefaultScheme()
null if there is no default
scheme.
null.public java.lang.String getHref()
null if none.public java.util.List<Category> getCategoryList()
null if there is no
associated list.
null.public void addCategory(Category category)
category - new category to add.
public XmlParser.ElementHandler getHandler(ExtensionProfile p,
java.lang.String namespace,
java.lang.String localName,
org.xml.sax.Attributes attrs)
AbstractExtensionAbstractExtension.AttributesHandler to handle
parsing the extension.
getHandler in interface ExtensiongetHandler in class ExtensionPointp - extension profilenamespace - extension namespacelocalName - tag name, without the namespace prefixattrs - tag attributes
protected void consumeAttributes(AttributeHelper helper)
throws ParseException
AbstractExtensionAttributeHelper.consumeContent(boolean) to consume the element's text
content. Called from AbstractExtension.getHandler(com.google.gdata.data.ExtensionProfile, java.lang.String, java.lang.String, org.xml.sax.Attributes). Default implementation does
nothing, though generally this is discouraged unless there really are no
attributes.
consumeAttributes in class AbstractExtensionhelper - attribute helper
ParseException - any parsing exception
public void validate()
throws java.lang.IllegalStateException
AbstractExtension
validate in class AbstractExtensionjava.lang.IllegalStateException - if any problems are found with the
attributes
public void parseAtom(ExtensionProfile extProfile,
XmlParser parser)
throws java.io.IOException,
ParseException
extProfile - Extension profile.parser - XML input parse.
java.io.IOException
ParseException
public void generate(com.google.gdata.util.common.xml.XmlWriter w,
ExtensionProfile extProfile)
throws java.io.IOException
generate in interface Extensiongenerate in class AbstractExtensionw - output writerextProfile - extension profile
java.io.IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||