public class Categories extends ExtensionPoint
| Modifier and Type | Class and Description |
|---|---|
class |
Categories.Handler
The Handler class implements the
XmlParser.ElementHandler for
parsing an app:categories element. |
ExtensionPoint.CumulativeBlobHandler, ExtensionPoint.ExtensionHandlerAbstractExtension.AttributesHandlerxmlBloblocalName, namespace| Constructor and Description |
|---|
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.
|
| Modifier and Type | Method and Description |
|---|---|
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(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.
|
addExtension, addExtension, addRepeatingExtension, addRepeatingExtension, checkRequiredExtensions, createExtensionInstance, declareExtensions, generate, generateCumulativeXmlBlob, generateExtensions, generateStartElement, getExtension, getExtensionDescription, getExtensionHandler, getExtensions, getManifest, getRepeatingExtension, getRepeatingExtensions, getXmlBlob, hasExtension, hasRepeatingExtension, initializeArbitraryXml, parseCumulativeXmlBlob, removeExtension, removeExtension, removeRepeatingExtension, setExtension, setXmlBlob, visit, visitChild, visitChildrendisableStrictValidation, enableStrictValidation, eq, generateAttributes, getExtensionLocalName, getExtensionNamespace, isImmutable, isStrictValidation, putAttributes, sameClassAs, setImmutable, throwExceptionForMissingAttribute, throwExceptionIfImmutablepublic Categories()
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 - 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 attributesprotected 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 helperParseException - any parsing exceptionpublic void validate()
throws java.lang.IllegalStateException
AbstractExtensionvalidate in class AbstractExtensionjava.lang.IllegalStateException - if any problems are found with the
attributespublic void parseAtom(ExtensionProfile extProfile, XmlParser parser) throws java.io.IOException, ParseException
extProfile - Extension profile.parser - XML input parse.java.io.IOExceptionParseExceptionpublic void generate(XmlWriter w, ExtensionProfile extProfile) throws java.io.IOException
generate in interface Extensiongenerate in class AbstractExtensionw - output writerextProfile - extension profilejava.io.IOException