org.apache.lucene.gdata.gom
Interface GOMDocument<T extends GOMElement>

Type Parameters:
T -
All Known Implementing Classes:
GOMDocumentImpl

public interface GOMDocument<T extends GOMElement>

GOMDocument acts as a container for GOMElements to render the containing GOMElement as a valid xml document. This class renderes the

  <?xml version="1.0" encoding="UTF-8"?>
 
header to the outputstream before the containing element will be rendered.

Author:
Simon Willnauer

Method Summary
 String getCharacterEncoding()
          Gets the xml charset encoding
 T getRootElement()
          Getter for the root element of the xml e.g GOMDocument
 String getVersion()
          Gets the xml version
 void setCharacterEncoding(String aEncoding)
          Sets the xml charset encoding
 void setRootElement(T aRootElement)
          setter for the root element of the xml e.g GOMDocument
 void setVersion(String aVersion)
          Sets the xml version
 void writeAtomOutput(GOMOutputWriter aStreamWriter)
          Generates a complete xml document starting with the header followed by the output of the specified root element in the ATOM 1.0 formate.
 void writeRssOutput(GOMOutputWriter aStreamWriter)
          Generates a complete xml document starting with the header followed by the output of the specified root element in the RSS 2.0 formate.
 

Method Detail

setRootElement

void setRootElement(T aRootElement)
setter for the root element of the xml e.g GOMDocument

Parameters:
aRootElement - - the root element to set

getRootElement

T getRootElement()
Getter for the root element of the xml e.g GOMDocument

Returns:
- the root elmenent

setVersion

void setVersion(String aVersion)
Sets the xml version

Parameters:
aVersion - - the version string

getVersion

String getVersion()
Gets the xml version

Returns:
- the xml version string

getCharacterEncoding

String getCharacterEncoding()
Gets the xml charset encoding

Returns:
- the specified char encoding

setCharacterEncoding

void setCharacterEncoding(String aEncoding)
Sets the xml charset encoding

Parameters:
aEncoding - - the charset encoding to set

writeAtomOutput

void writeAtomOutput(GOMOutputWriter aStreamWriter)
                     throws javax.xml.stream.XMLStreamException
Generates a complete xml document starting with the header followed by the output of the specified root element in the ATOM 1.0 formate.

Parameters:
aStreamWriter - - the GOMOutputWriter implementation to write the output
Throws:
javax.xml.stream.XMLStreamException - - if the GOMOutputWriter throws an exception

writeRssOutput

void writeRssOutput(GOMOutputWriter aStreamWriter)
                    throws javax.xml.stream.XMLStreamException
Generates a complete xml document starting with the header followed by the output of the specified root element in the RSS 2.0 formate.

Parameters:
aStreamWriter - - the GOMOutputWriter implementation to write the output
Throws:
javax.xml.stream.XMLStreamException - - if the GOMOutputWriter throws an exception


Copyright © 2000-2008 Apache Software Foundation. All Rights Reserved.