org.apache.abdera.parser.stax
Class FOMCollection

java.lang.Object
  extended by org.apache.axiom.om.impl.llom.OMNodeImpl
      extended by org.apache.axiom.om.impl.llom.OMElementImpl
          extended by org.apache.abdera.parser.stax.FOMElement
              extended by org.apache.abdera.parser.stax.FOMExtensibleElement
                  extended by org.apache.abdera.parser.stax.FOMCollection
All Implemented Interfaces:
Cloneable, Iterable<Element>, Base, Collection, Element, ExtensibleElement, Constants, org.apache.axiom.om.impl.OMContainerEx, org.apache.axiom.om.impl.OMNodeEx, org.apache.axiom.om.OMConstants, org.apache.axiom.om.OMContainer, org.apache.axiom.om.OMElement, org.apache.axiom.om.OMNode
Direct Known Subclasses:
FOMMultipartCollection

public class FOMCollection
extends FOMExtensibleElement
implements Collection


Field Summary
 
Fields inherited from class org.apache.axiom.om.impl.llom.OMElementImpl
attributes, DEFAULT_DEFAULT_NS_OBJECT, firstChild, lastChild, localName, namespaces, noPrefixNamespaceCounter, ns, qName
 
Fields inherited from class org.apache.axiom.om.impl.llom.OMNodeImpl
builder, done, factory, nextSibling, nodeType, parent, previousSibling
 
Fields inherited from interface org.apache.axiom.om.OMNode
CDATA_SECTION_NODE, COMMENT_NODE, DTD_NODE, ELEMENT_NODE, ENTITY_REFERENCE_NODE, PI_NODE, SPACE_NODE, TEXT_NODE
 
Fields inherited from interface org.apache.abdera.util.Constants
ACCEPT, AID, ALTERNATE, APP_MEDIA_TYPE, APP_NS, APP_NS_PRE_RFC, APP_PREFIX, ATITLE, ATOM_MEDIA_TYPE, ATOM_NS, AURI, AUTHOR, BASE, CAT_MEDIA_TYPE, CATEGORIES, CATEGORY, CLASS, COLLECTION, CONFIG_FACTORY, CONFIG_PARSER, CONFIG_PARSERFACTORY, CONFIG_STREAMWRITER, CONFIG_WRITER, CONFIG_WRITERFACTORY, CONFIG_XPATH, CONTENT, CONTRIBUTOR, CONTROL, CONTROL_NS, CONTROL_PREFIX, DEFAULT_FACTORY, DEFAULT_PARSER, DEFAULT_PARSERFACTORY, DEFAULT_STREAMWRITER, DEFAULT_WRITER, DEFAULT_WRITERFACTORY, DEFAULT_XPATH, DIV, DRAFT, EDITED, EMAIL, ENTRY_MEDIA_TYPE, FEED, FEED_MEDIA_TYPE, FIXED, GENERATOR, HREF, HREFLANG, HTML, ICON, ID, LABEL, LANG, LENGTH, LINK, LN_ACCEPT, LN_ALTERNATE, LN_ALTERNATE_MULTIPART_RELATED, LN_AUTHOR, LN_BASE, LN_CATEGORIES, LN_CATEGORY, LN_CLASS, LN_COLLECTION, LN_CONTENT, LN_CONTRIBUTOR, LN_CONTROL, LN_DIV, LN_DRAFT, LN_EDITED, LN_EMAIL, LN_ENTRY, LN_FEED, LN_FIXED, LN_GENERATOR, LN_HREF, LN_HREFLANG, LN_ICON, LN_ID, LN_LABEL, LN_LANG, LN_LENGTH, LN_LINK, LN_LOGO, LN_NAME, LN_PUBLISHED, LN_REL, LN_RIGHTS, LN_SCHEME, LN_SERVICE, LN_SOURCE, LN_SPACE, LN_SRC, LN_SUBTITLE, LN_SUMMARY, LN_TERM, LN_TITLE, LN_TYPE, LN_UPDATED, LN_URI, LN_VERSION, LN_WORKSPACE, LOGO, MULTIPART_RELATED_TYPE, NAME, NAMED_PARSER, NAMED_WRITER, NO, PRE_RFC_ACCEPT, PRE_RFC_CATEGORIES, PRE_RFC_COLLECTION, PRE_RFC_CONTROL, PRE_RFC_DRAFT, PRE_RFC_EDITED, PRE_RFC_SERVICE, PRE_RFC_WORKSPACE, PREFIX, PREFIXED_TITLE, PUBLISHED, REL, RIGHTS, SCHEME, SERVICE, SOURCE, SPACE, SRC, STREAM_WRITER, SUBTITLE, SUMMARY, TERM, TEXT, TITLE, TYPE, UPDATED, URI, VERSION, WORKSPACE, XHTML, XHTML_NS, XML, XML_MEDIA_TYPE, XML_NS, YES
 
Fields inherited from interface org.apache.axiom.om.OMConstants
ARRAY_ITEM_LOCALNAME, ARRAY_ITEM_NS_PREFIX, ARRAY_ITEM_NSURI, ARRAY_ITEM_QNAME, DATA_HANDLER, DEFAULT_CHAR_SET_ENCODING, DEFAULT_DEFAULT_NAMESPACE, DEFAULT_XML_VERSION, IS_BINARY, IS_DATA_HANDLERS_AWARE, PULL_TYPE_BUILDER, PUSH_TYPE_BUILDER, XMLATTRTYPE_CDATA, XMLATTRTYPE_ENTITIES, XMLATTRTYPE_ENTITY, XMLATTRTYPE_ID, XMLATTRTYPE_IDREF, XMLATTRTYPE_IDREFS, XMLATTRTYPE_NMTOKEN, XMLATTRTYPE_NMTOKENS, XMLATTRTYPE_NOTATION, XMLNS_NS_PREFIX, XMLNS_NS_URI, XMLNS_PREFIX, XMLNS_URI
 
Constructor Summary
  FOMCollection()
           
protected FOMCollection(org.apache.axiom.om.OMContainer parent, org.apache.axiom.om.OMFactory factory)
           
protected FOMCollection(org.apache.axiom.om.OMContainer parent, org.apache.axiom.om.OMFactory factory, org.apache.axiom.om.OMXMLParserWrapper builder)
           
protected FOMCollection(QName qname, org.apache.axiom.om.OMContainer parent, org.apache.axiom.om.OMFactory factory)
           
protected FOMCollection(QName qname, org.apache.axiom.om.OMContainer parent, org.apache.axiom.om.OMFactory factory, org.apache.axiom.om.OMXMLParserWrapper builder)
           
protected FOMCollection(String name, org.apache.axiom.om.OMNamespace namespace, org.apache.axiom.om.OMContainer parent, org.apache.axiom.om.OMFactory factory)
           
  FOMCollection(String title, String href, String[] accepts)
           
 
Method Summary
 boolean accepts(javax.activation.MimeType mediaType)
          Returns true if the collection accepts the given media-type
 boolean accepts(String mediaType)
          Returns true if the collection accepts the given media-type
 boolean acceptsEntry()
          Returns true if the collection accepts Atom entry documents (equivalent to calling accepts("application/atom+xml;type=entry");)
 boolean acceptsNothing()
          Returns true if the collection accepts nothing (i.e.
 Collection addAccepts(String... mediaRanges)
          Adds new accept elements to the collection
 Collection addAccepts(String mediaRange)
          Adds a new accept element to the collection
 Collection addAcceptsEntry()
          Same as setAcceptsEntry except the existing accepts are not discarded
 Categories addCategories()
          Add an app:categories element
 Collection addCategories(Categories categories)
          Add the app:categories element to the collection
 Categories addCategories(List<Category> categories, boolean fixed, String scheme)
          Add a listing of categories to the collection
 Categories addCategories(String href)
          Add an app:categories element that links to an external Category Document
 String[] getAccept()
          Returns the listing of media-ranges allowed for this collection
 List<Categories> getCategories()
          Returns the app:categories element
 IRI getHref()
          Return the value of the app:collection elements href attribute
 IRI getResolvedHref()
          Return the href attribute resolved against the in-scope Base URI
 String getTitle()
          The text value of the collections atom:title element
 Text getTitleElement()
          Return the title element
 Collection setAccept(String... mediaRanges)
          Set the listing of media-ranges allowed for this collection.
 Collection setAccept(String mediaRange)
           
 Collection setAcceptsEntry()
          Sets the appropriate accept element to indicate that entries are accepted (equivalent to calling setAccept("application/atom+xml;type=entry");)
 Collection setAcceptsNothing()
          Sets the collection so that nothing is accepted (equivalent to calling setAccept(""); )
 Collection setHref(String href)
          Set the value of the href attribute
 Text setTitle(String title)
          Set the value of the collections atom:title element using type="text"
 Text setTitleAsHtml(String title)
          Set the value of the collections atom:title element using type="html".
 Text setTitleAsXHtml(String title)
          Set the value of the collections atom:title element using type="xhtml".
 
Methods inherited from class org.apache.abdera.parser.stax.FOMExtensibleElement
addExtension, addExtension, addExtension, addExtension, addExtension, addExtensions, addSimpleExtension, addSimpleExtension, getExtension, getExtension, getExtensions, getExtensions, getExtensions, getSimpleExtension, getSimpleExtension
 
Methods inherited from class org.apache.abdera.parser.stax.FOMElement
_copyElement, _create, _getChildrenAsSet, _getElementValue, _getStringValue, _getUriValue, _parse, _removeAllChildren, _removeChildren, _resolve, _setChild, _setElementValue, addComment, clone, complete, declareIfNecessary, declareNS, getAttributes, getAttributeValue, getAttributeValue, getBaseUri, getDefaultWriterOptions, getDocument, getElements, getExtensionAttributes, getFactory, getFirstChild, getFirstChild, getLanguage, getLanguageTag, getLocale, getMustPreserveWhitespace, getNamespaces, getNextSibling, getNextSibling, getParentElement, getPreviousSibling, getPreviousSibling, getResolvedBaseUri, getText, getText, getTextElement, getWrapped, isDeclared, iterator, removeAttribute, removeAttribute, selectLink, setAttributeValue, setAttributeValue, setBaseUri, setBaseUri, setHtmlText, setLanguage, setMustPreserveWhitespace, setParentDocument, setParentElement, setText, setText, setTextElement, setTextText, setXhtmlText, setXhtmlText, toFormattedString, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo
 
Methods inherited from class org.apache.axiom.om.impl.llom.OMElementImpl
addAttribute, addAttribute, addChild, build, buildNext, buildWithAttachments, cloneOMElement, declareDefaultNamespace, declareNamespace, declareNamespace, detach, discard, findNamespace, findNamespaceURI, getAllAttributes, getAllDeclaredNamespaces, getAttribute, getBuilder, getChildElements, getChildren, getChildrenWithLocalName, getChildrenWithName, getChildrenWithNamespaceURI, getDefaultNamespace, getFirstChildWithName, getFirstElement, getFirstOMChild, getLineNumber, getLocalName, getNamespace, getNextOMSibling, getQName, getTextAsQName, getTrimmedText, getType, getXMLStreamReader, getXMLStreamReaderWithoutCaching, internalSerialize, internalSerialize, internalSerializeAndConsume, isComplete, notifyChildComplete, removeAttribute, resolveQName, setBuilder, setFirstChild, setLastChild, setLineNumber, setLocalName, setNamespace, setNamespaceWithNoFindInCurrentScope, setText, toString, toStringWithConsume
 
Methods inherited from class org.apache.axiom.om.impl.llom.OMNodeImpl
close, getOMFactory, getParent, getPreviousOMSibling, importNode, insertSiblingAfter, insertSiblingBefore, serialize, serialize, serialize, serialize, serialize, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume, setComplete, setNextOMSibling, setParent, setPreviousOMSibling, setType
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.abdera.model.ExtensibleElement
addExtension, addExtension, addExtension, addExtension, addExtension, addSimpleExtension, addSimpleExtension, getExtension, getExtension, getExtensions, getExtensions, getExtensions, getSimpleExtension, getSimpleExtension
 
Methods inherited from interface org.apache.abdera.model.Element
declareNS, discard, getAttributes, getAttributeValue, getAttributeValue, getBaseUri, getDocument, getElements, getExtensionAttributes, getFirstChild, getFirstChild, getLanguage, getLanguageTag, getLocale, getMustPreserveWhitespace, getNamespaces, getNextSibling, getNextSibling, getParentElement, getPreviousSibling, getPreviousSibling, getQName, getResolvedBaseUri, getText, removeAttribute, removeAttribute, setAttributeValue, setAttributeValue, setBaseUri, setBaseUri, setLanguage, setMustPreserveWhitespace, setParentElement, setText, setText
 
Methods inherited from interface org.apache.abdera.model.Base
addComment, clone, complete, getDefaultWriterOptions, getFactory, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo, writeTo
 
Methods inherited from interface java.lang.Iterable
iterator
 
Methods inherited from interface org.apache.axiom.om.OMElement
addAttribute, addAttribute, cloneOMElement, declareDefaultNamespace, declareNamespace, declareNamespace, findNamespace, findNamespaceURI, getAllAttributes, getAllDeclaredNamespaces, getAttribute, getBuilder, getChildElements, getDefaultNamespace, getFirstElement, getLineNumber, getLocalName, getNamespace, getQName, getTextAsQName, getXMLStreamReader, getXMLStreamReaderWithoutCaching, removeAttribute, resolveQName, setBuilder, setFirstChild, setLineNumber, setLocalName, setNamespace, setNamespaceWithNoFindInCurrentScope, setText, toString, toStringWithConsume
 
Methods inherited from interface org.apache.axiom.om.OMNode
build, buildWithAttachments, close, detach, discard, getNextOMSibling, getOMFactory, getParent, getPreviousOMSibling, getType, insertSiblingAfter, insertSiblingBefore, isComplete, serialize, serialize, serialize, serialize, serialize, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume, serializeAndConsume
 
Methods inherited from interface org.apache.axiom.om.OMContainer
addChild, buildNext, getChildren, getChildrenWithLocalName, getChildrenWithName, getChildrenWithNamespaceURI, getFirstChildWithName, getFirstOMChild, isComplete
 
Methods inherited from interface org.apache.axiom.om.impl.OMContainerEx
setComplete
 

Constructor Detail

FOMCollection

public FOMCollection()

FOMCollection

public FOMCollection(String title,
                     String href,
                     String[] accepts)

FOMCollection

protected FOMCollection(String name,
                        org.apache.axiom.om.OMNamespace namespace,
                        org.apache.axiom.om.OMContainer parent,
                        org.apache.axiom.om.OMFactory factory)
                 throws org.apache.axiom.om.OMException
Throws:
org.apache.axiom.om.OMException

FOMCollection

protected FOMCollection(QName qname,
                        org.apache.axiom.om.OMContainer parent,
                        org.apache.axiom.om.OMFactory factory)

FOMCollection

protected FOMCollection(QName qname,
                        org.apache.axiom.om.OMContainer parent,
                        org.apache.axiom.om.OMFactory factory,
                        org.apache.axiom.om.OMXMLParserWrapper builder)

FOMCollection

protected FOMCollection(org.apache.axiom.om.OMContainer parent,
                        org.apache.axiom.om.OMFactory factory)

FOMCollection

protected FOMCollection(org.apache.axiom.om.OMContainer parent,
                        org.apache.axiom.om.OMFactory factory,
                        org.apache.axiom.om.OMXMLParserWrapper builder)
Method Detail

getTitle

public String getTitle()
Description copied from interface: Collection
The text value of the collections atom:title element

Specified by:
getTitle in interface Collection
Returns:
The atom:title value

setTitle

public Text setTitle(String title)
Description copied from interface: Collection
Set the value of the collections atom:title element using type="text"

Specified by:
setTitle in interface Collection
Parameters:
title - The value of the atom:title
Returns:
The newly created title element

setTitleAsHtml

public Text setTitleAsHtml(String title)
Description copied from interface: Collection
Set the value of the collections atom:title element using type="html". Special characters in the value will be automatically escaped (e.g. & will become &

Specified by:
setTitleAsHtml in interface Collection
Parameters:
title - The value of the atom:title
Returns:
The newly created title element

setTitleAsXHtml

public Text setTitleAsXHtml(String title)
Description copied from interface: Collection
Set the value of the collections atom:title element using type="xhtml". The title text will be wrapped in a xhtml:div and parsed to ensure that it is welformed XML. A ParseException (RuntimeException) could be thrown

Specified by:
setTitleAsXHtml in interface Collection
Parameters:
title - The value of the atom:title
Returns:
The newly created title element

getTitleElement

public Text getTitleElement()
Description copied from interface: Collection
Return the title element

Specified by:
getTitleElement in interface Collection
Returns:
The title element

getHref

public IRI getHref()
Description copied from interface: Collection
Return the value of the app:collection elements href attribute

Specified by:
getHref in interface Collection
Returns:
The href attribute IRI value

getResolvedHref

public IRI getResolvedHref()
Description copied from interface: Collection
Return the href attribute resolved against the in-scope Base URI

Specified by:
getResolvedHref in interface Collection
Returns:
The href attribute IRI value

setHref

public Collection setHref(String href)
Description copied from interface: Collection
Set the value of the href attribute

Specified by:
setHref in interface Collection
Parameters:
href - The value of href attribute

getAccept

public String[] getAccept()
Description copied from interface: Collection
Returns the listing of media-ranges allowed for this collection

Specified by:
getAccept in interface Collection
Returns:
An array listing the media-ranges allowed for this collection

setAccept

public Collection setAccept(String mediaRange)

setAccept

public Collection setAccept(String... mediaRanges)
Description copied from interface: Collection
Set the listing of media-ranges allowed for this collection. The special value "entry" is used to indicate Atom Entry Documents.

Specified by:
setAccept in interface Collection
Parameters:
mediaRanges - a listing of media-ranges

addAccepts

public Collection addAccepts(String mediaRange)
Description copied from interface: Collection
Adds a new accept element to the collection

Specified by:
addAccepts in interface Collection

addAccepts

public Collection addAccepts(String... mediaRanges)
Description copied from interface: Collection
Adds new accept elements to the collection

Specified by:
addAccepts in interface Collection

addAcceptsEntry

public Collection addAcceptsEntry()
Description copied from interface: Collection
Same as setAcceptsEntry except the existing accepts are not discarded

Specified by:
addAcceptsEntry in interface Collection

setAcceptsEntry

public Collection setAcceptsEntry()
Description copied from interface: Collection
Sets the appropriate accept element to indicate that entries are accepted (equivalent to calling setAccept("application/atom+xml;type=entry");)

Specified by:
setAcceptsEntry in interface Collection

setAcceptsNothing

public Collection setAcceptsNothing()
Description copied from interface: Collection
Sets the collection so that nothing is accepted (equivalent to calling setAccept(""); )

Specified by:
setAcceptsNothing in interface Collection

acceptsEntry

public boolean acceptsEntry()
Description copied from interface: Collection
Returns true if the collection accepts Atom entry documents (equivalent to calling accepts("application/atom+xml;type=entry");)

Specified by:
acceptsEntry in interface Collection

acceptsNothing

public boolean acceptsNothing()
Description copied from interface: Collection
Returns true if the collection accepts nothing (i.e. there is an empty accept element)

Specified by:
acceptsNothing in interface Collection

accepts

public boolean accepts(String mediaType)
Description copied from interface: Collection
Returns true if the collection accepts the given media-type

Specified by:
accepts in interface Collection
Parameters:
mediaType - The media-type to check
Returns:
True if the media-type is acceptable

accepts

public boolean accepts(javax.activation.MimeType mediaType)
Description copied from interface: Collection
Returns true if the collection accepts the given media-type

Specified by:
accepts in interface Collection
Parameters:
mediaType - The media-type to check
Returns:
True if the media-type is acceptable

addCategories

public Categories addCategories()
Description copied from interface: Collection
Add an app:categories element

Specified by:
addCategories in interface Collection
Returns:
The newly created app:categories element

addCategories

public Collection addCategories(Categories categories)
Description copied from interface: Collection
Add the app:categories element to the collection

Specified by:
addCategories in interface Collection
Parameters:
categories - The app:categories element

addCategories

public Categories addCategories(String href)
Description copied from interface: Collection
Add an app:categories element that links to an external Category Document

Specified by:
addCategories in interface Collection
Parameters:
href - The IRI of the external Category Document
Returns:
The newly created app:categories element

addCategories

public Categories addCategories(List<Category> categories,
                                boolean fixed,
                                String scheme)
Description copied from interface: Collection
Add a listing of categories to the collection

Specified by:
addCategories in interface Collection
Parameters:
categories - The listing of categories to add
fixed - True if the listing of categories should be fixed
scheme - The default IRI scheme for the categories listing
Returns:
The newly created app:categories element

getCategories

public List<Categories> getCategories()
Description copied from interface: Collection
Returns the app:categories element

Specified by:
getCategories in interface Collection
Returns:
The app:categories element


Copyright © 2006-2012 Apache Software Foundation. All Rights Reserved.