org.apache.abdera.parser.stax
Class FOMDocument<T extends Element>

java.lang.Object
  extended by org.apache.axiom.om.impl.llom.OMDocumentImpl
      extended by org.apache.abdera.parser.stax.FOMDocument<T>
All Implemented Interfaces:
Serializable, Cloneable, Base, Document<T>, org.apache.axiom.om.impl.OMContainerEx, org.apache.axiom.om.OMContainer, org.apache.axiom.om.OMDocument

public class FOMDocument<T extends Element>
extends org.apache.axiom.om.impl.llom.OMDocumentImpl
implements Document<T>

See Also:
Serialized Form

Field Summary
protected  IRI base
           
protected  javax.activation.MimeType contentType
           
protected  EntityTag etag
           
protected  String language
           
protected  Date lastModified
           
protected  boolean preserve
           
protected  String slug
           
 
Fields inherited from class org.apache.axiom.om.impl.llom.OMDocumentImpl
charSetEncoding, documentElement, done, factory, firstChild, isStandalone, lastChild, parserWrapper, xmlVersion
 
Fields inherited from interface org.apache.axiom.om.OMDocument
XML_10, XML_11
 
Constructor Summary
  FOMDocument()
           
protected FOMDocument(org.apache.axiom.om.OMElement documentElement, org.apache.axiom.om.OMXMLParserWrapper parserWrapper)
           
protected FOMDocument(org.apache.axiom.om.OMElement documentElement, org.apache.axiom.om.OMXMLParserWrapper parserWrapper, org.apache.axiom.om.OMFactory factory)
           
protected FOMDocument(org.apache.axiom.om.OMFactory factory)
           
protected FOMDocument(org.apache.axiom.om.OMXMLParserWrapper parserWrapper)
           
protected FOMDocument(org.apache.axiom.om.OMXMLParserWrapper parserWrapper, org.apache.axiom.om.OMFactory factory)
           
 
Method Summary
<X extends Base>
X
addComment(String value)
          Add an XML comment to this Base
 Document<T> addProcessingInstruction(String target, String value)
          Add a processing instruction to the document
 Document<T> addStylesheet(String href, String media)
          Add a xml-stylesheet processing instruction to the document
 Object clone()
          Clone this Base
<X extends Base>
X
complete()
          Ensure that the underlying streams are fully parsed.
 IRI getBaseUri()
          Returns the Base URI of the document.
 String getCharset()
          Gets the charset used for this document
 javax.activation.MimeType getContentType()
          Returns the content type of this document
 WriterOptions getDefaultWriterOptions()
          Get the default WriterOptions for this object
 EntityTag getEntityTag()
          Return the entity tag for this document
 Factory getFactory()
          Get the Factory used to create this Base
 String getLanguage()
          Get the language
 Lang getLanguageTag()
          Returns the value of the xml:lang attribute as a Lang object
 Date getLastModified()
          Returns the last modified date for this document
 boolean getMustPreserveWhitespace()
          Return true if insignificant whitespace must be preserved
 String[] getProcessingInstruction(String target)
          Get the values for the given processing instruction
 T getRoot()
          Returns the root element of the document (equivalent to DOM's getDocumentElement)
 String getSlug()
          Get the slug for this document
 XmlUtil.XMLVersion getXmlVersion()
          Get the XMLVersion used by this document
 Document<T> setBaseUri(String base)
          Sets the Base URI of the document.
 Document<T> setCharset(String charset)
          Sets the charset used for this document
 Document<T> setContentType(String contentType)
          Sets the content type for this document
 Document<T> setEntityTag(EntityTag tag)
          Set the entity tag for this document
 Document<T> setEntityTag(String tag)
          Set the entity tag for this document
 Document<T> setLanguage(String lang)
          set the base language
 Document<T> setLastModified(Date lastModified)
          Sets the last modified date for this document
 Document<T> setMustPreserveWhitespace(boolean preserve)
          Set to true to preserve insignificant whitespace
 Document<T> setRoot(T root)
          Sets the root element of the document
 Document<T> setSlug(String slug)
          Set the slug for this document
 String toFormattedString()
           
 void writeTo(OutputStream out)
          Serializes the model component out to the specified stream
 void writeTo(OutputStream out, WriterOptions options)
          Serializes the model component out to the specified stream
 void writeTo(String writer, OutputStream out)
          Serializes the model component out to the specified stream using the given Abdera writer
 void writeTo(String writer, OutputStream out, WriterOptions options)
          Serializes the model component out to the specified stream using the given abdera writer
 void writeTo(String writer, Writer out)
          Serializes the model component out to the specified java.io.Writer using the given Abdera writer
 void writeTo(String writer, Writer out, WriterOptions options)
          Serializes the model component out to the specified java.io.Writer using the given abdera writer
 void writeTo(Writer writer)
          Serializes the model component out to the specified writer
 void writeTo(Writer writer, OutputStream out)
          Serializes the model component out to the specified stream using the given Abdera writer
 void writeTo(Writer writer, OutputStream out, WriterOptions options)
          Serializes the model component out to the specified stream using the given abdera writer
 void writeTo(Writer writer, Writer out)
          Serializes the model component out to the specified java.io.Writer using the given Abdera writer
 void writeTo(Writer out, WriterOptions options)
          Serializes the model component out to the specified java.io.Writer
 void writeTo(Writer writer, Writer out, WriterOptions options)
          Serializes the model component out to the specified java.io.Writer using the given abdera writer
 
Methods inherited from class org.apache.axiom.om.impl.llom.OMDocumentImpl
addChild, buildNext, getCharsetEncoding, getChildren, getChildrenWithLocalName, getChildrenWithName, getChildrenWithNamespaceURI, getFirstChildWithName, getFirstOMChild, getOMDocumentElement, getOMFactory, getXMLVersion, internalSerialize, internalSerialize, internalSerialize, internalSerializeAndConsume, internalSerializeAndConsume, isComplete, isStandalone, serialize, serialize, serializeAndConsume, serializeAndConsume, setCharsetEncoding, setComplete, setFirstChild, setLastChild, setOMDocumentElement, setStandalone, setXMLVersion
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

base

protected IRI base

contentType

protected javax.activation.MimeType contentType

lastModified

protected Date lastModified

etag

protected EntityTag etag

language

protected String language

slug

protected String slug

preserve

protected boolean preserve
Constructor Detail

FOMDocument

public FOMDocument()

FOMDocument

protected FOMDocument(org.apache.axiom.om.OMElement documentElement,
                      org.apache.axiom.om.OMXMLParserWrapper parserWrapper,
                      org.apache.axiom.om.OMFactory factory)

FOMDocument

protected FOMDocument(org.apache.axiom.om.OMElement documentElement,
                      org.apache.axiom.om.OMXMLParserWrapper parserWrapper)

FOMDocument

protected FOMDocument(org.apache.axiom.om.OMFactory factory)

FOMDocument

protected FOMDocument(org.apache.axiom.om.OMXMLParserWrapper parserWrapper,
                      org.apache.axiom.om.OMFactory factory)

FOMDocument

protected FOMDocument(org.apache.axiom.om.OMXMLParserWrapper parserWrapper)
Method Detail

getRoot

public T getRoot()
Description copied from interface: Document
Returns the root element of the document (equivalent to DOM's getDocumentElement)

Specified by:
getRoot in interface Document<T extends Element>
Returns:
The root element of the document

setRoot

public Document<T> setRoot(T root)
Description copied from interface: Document
Sets the root element of the document

Specified by:
setRoot in interface Document<T extends Element>
Parameters:
root - Set the root element of the document

getBaseUri

public IRI getBaseUri()
Description copied from interface: Document
Returns the Base URI of the document. All relative URI's contained in the document will be resolved according to this base.

Specified by:
getBaseUri in interface Document<T extends Element>
Returns:
The Base IRI

setBaseUri

public Document<T> setBaseUri(String base)
Description copied from interface: Document
Sets the Base URI of the document. All relative URI's contained in the document will be resolved according to this base.

Specified by:
setBaseUri in interface Document<T extends Element>
Parameters:
base - The Base URI

writeTo

public void writeTo(OutputStream out,
                    WriterOptions options)
             throws IOException
Description copied from interface: Base
Serializes the model component out to the specified stream

Specified by:
writeTo in interface Base
Parameters:
out - The target output stream
options - The WriterOptions to use
Throws:
IOException

writeTo

public void writeTo(Writer out,
                    WriterOptions options)
             throws IOException
Description copied from interface: Base
Serializes the model component out to the specified java.io.Writer

Specified by:
writeTo in interface Base
Parameters:
out - The target output writer
options - The WriterOptions to use
Throws:
IOException

writeTo

public void writeTo(Writer writer,
                    OutputStream out)
             throws IOException
Description copied from interface: Base
Serializes the model component out to the specified stream using the given Abdera writer

Specified by:
writeTo in interface Base
Parameters:
writer - The Abdera writer to use
out - The target output stream
Throws:
IOException

writeTo

public void writeTo(Writer writer,
                    Writer out)
             throws IOException
Description copied from interface: Base
Serializes the model component out to the specified java.io.Writer using the given Abdera writer

Specified by:
writeTo in interface Base
Parameters:
writer - The Abdera writer to use
out - The target output writer
Throws:
IOException

writeTo

public void writeTo(Writer writer,
                    OutputStream out,
                    WriterOptions options)
             throws IOException
Description copied from interface: Base
Serializes the model component out to the specified stream using the given abdera writer

Specified by:
writeTo in interface Base
Parameters:
writer - The Abdera writer to use
out - The target output stream
options - The WriterOptions to use
Throws:
IOException

writeTo

public void writeTo(Writer writer,
                    Writer out,
                    WriterOptions options)
             throws IOException
Description copied from interface: Base
Serializes the model component out to the specified java.io.Writer using the given abdera writer

Specified by:
writeTo in interface Base
Parameters:
writer - The Abdera writer to use
out - The target output writer
options - The WriterOptions to use
Throws:
IOException

writeTo

public void writeTo(OutputStream out)
             throws IOException
Description copied from interface: Base
Serializes the model component out to the specified stream

Specified by:
writeTo in interface Base
Parameters:
out - The java.io.OutputStream to use when serializing the Base. The charset encoding specified for the document will be used
Throws:
IOException

writeTo

public void writeTo(Writer writer)
             throws IOException
Description copied from interface: Base
Serializes the model component out to the specified writer

Specified by:
writeTo in interface Base
Parameters:
writer - The java.io.Writer to use when serializing the Base
Throws:
IOException

getContentType

public javax.activation.MimeType getContentType()
Description copied from interface: Document
Returns the content type of this document

Specified by:
getContentType in interface Document<T extends Element>
Returns:
The content type of this document

setContentType

public Document<T> setContentType(String contentType)
Description copied from interface: Document
Sets the content type for this document

Specified by:
setContentType in interface Document<T extends Element>
Parameters:
contentType - The content type of document

getLastModified

public Date getLastModified()
Description copied from interface: Document
Returns the last modified date for this document

Specified by:
getLastModified in interface Document<T extends Element>
Returns:
The last-modified date

setLastModified

public Document<T> setLastModified(Date lastModified)
Description copied from interface: Document
Sets the last modified date for this document

Specified by:
setLastModified in interface Document<T extends Element>
Parameters:
lastModified - the last-modified date

clone

public Object clone()
Description copied from interface: Base
Clone this Base

Specified by:
clone in interface Base
Overrides:
clone in class Object

getCharset

public String getCharset()
Description copied from interface: Document
Gets the charset used for this document

Specified by:
getCharset in interface Document<T extends Element>
Returns:
The character encoding used for this document

setCharset

public Document<T> setCharset(String charset)
Description copied from interface: Document
Sets the charset used for this document

Specified by:
setCharset in interface Document<T extends Element>
Parameters:
charset - The character encoding to use

getFactory

public Factory getFactory()
Description copied from interface: Base
Get the Factory used to create this Base

Specified by:
getFactory in interface Base
Returns:
The Factory used to create this object

getProcessingInstruction

public String[] getProcessingInstruction(String target)
Description copied from interface: Document
Get the values for the given processing instruction

Specified by:
getProcessingInstruction in interface Document<T extends Element>

addProcessingInstruction

public Document<T> addProcessingInstruction(String target,
                                            String value)
Description copied from interface: Document
Add a processing instruction to the document

Specified by:
addProcessingInstruction in interface Document<T extends Element>
Parameters:
target - The processing instruction target
value - The processing instruction value

addStylesheet

public Document<T> addStylesheet(String href,
                                 String media)
Description copied from interface: Document
Add a xml-stylesheet processing instruction to the document

Specified by:
addStylesheet in interface Document<T extends Element>
Parameters:
href - The href of the stylesheet
media - The media target for this stylesheet or null if none

addComment

public <X extends Base> X addComment(String value)
Description copied from interface: Base
Add an XML comment to this Base

Specified by:
addComment in interface Base
Parameters:
value - The text value of the comment

getEntityTag

public EntityTag getEntityTag()
Description copied from interface: Document
Return the entity tag for this document

Specified by:
getEntityTag in interface Document<T extends Element>

setEntityTag

public Document<T> setEntityTag(EntityTag tag)
Description copied from interface: Document
Set the entity tag for this document

Specified by:
setEntityTag in interface Document<T extends Element>

setEntityTag

public Document<T> setEntityTag(String tag)
Description copied from interface: Document
Set the entity tag for this document

Specified by:
setEntityTag in interface Document<T extends Element>

getLanguage

public String getLanguage()
Description copied from interface: Document
Get the language

Specified by:
getLanguage in interface Document<T extends Element>

getLanguageTag

public Lang getLanguageTag()
Description copied from interface: Document
Returns the value of the xml:lang attribute as a Lang object

Specified by:
getLanguageTag in interface Document<T extends Element>

setLanguage

public Document<T> setLanguage(String lang)
Description copied from interface: Document
set the base language

Specified by:
setLanguage in interface Document<T extends Element>

getSlug

public String getSlug()
Description copied from interface: Document
Get the slug for this document

Specified by:
getSlug in interface Document<T extends Element>

setSlug

public Document<T> setSlug(String slug)
Description copied from interface: Document
Set the slug for this document

Specified by:
setSlug in interface Document<T extends Element>

getMustPreserveWhitespace

public boolean getMustPreserveWhitespace()
Description copied from interface: Document
Return true if insignificant whitespace must be preserved

Specified by:
getMustPreserveWhitespace in interface Document<T extends Element>

setMustPreserveWhitespace

public Document<T> setMustPreserveWhitespace(boolean preserve)
Description copied from interface: Document
Set to true to preserve insignificant whitespace

Specified by:
setMustPreserveWhitespace in interface Document<T extends Element>

getXmlVersion

public XmlUtil.XMLVersion getXmlVersion()
Description copied from interface: Document
Get the XMLVersion used by this document

Specified by:
getXmlVersion in interface Document<T extends Element>

getDefaultWriterOptions

public WriterOptions getDefaultWriterOptions()
Description copied from interface: Base
Get the default WriterOptions for this object

Specified by:
getDefaultWriterOptions in interface Base

complete

public <X extends Base> X complete()
Ensure that the underlying streams are fully parsed. We might eventually need to find a more efficient way of doing this, but for now, calling toString() will ensure that this particular object is fully parsed and ready to be modified.

Specified by:
complete in interface Base

writeTo

public void writeTo(String writer,
                    OutputStream out)
             throws IOException
Description copied from interface: Base
Serializes the model component out to the specified stream using the given Abdera writer

Specified by:
writeTo in interface Base
Parameters:
writer - The Abdera writer to use
out - The target output stream
Throws:
IOException

writeTo

public void writeTo(String writer,
                    Writer out)
             throws IOException
Description copied from interface: Base
Serializes the model component out to the specified java.io.Writer using the given Abdera writer

Specified by:
writeTo in interface Base
Parameters:
writer - The Abdera writer to use
out - The target output writer
Throws:
IOException

writeTo

public void writeTo(String writer,
                    OutputStream out,
                    WriterOptions options)
             throws IOException
Description copied from interface: Base
Serializes the model component out to the specified stream using the given abdera writer

Specified by:
writeTo in interface Base
Parameters:
writer - The name of the Abdera writer to use
out - The target output stream
options - The WriterOptions to use
Throws:
IOException

writeTo

public void writeTo(String writer,
                    Writer out,
                    WriterOptions options)
             throws IOException
Description copied from interface: Base
Serializes the model component out to the specified java.io.Writer using the given abdera writer

Specified by:
writeTo in interface Base
Parameters:
writer - The name of the Abdera writer to use
out - The target output writer
options - The WriterOptions to use
Throws:
IOException

toFormattedString

public String toFormattedString()


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