Oracle Application Server TopLink API Reference
10g Release 2 (10.1.2)

B15903-01


oracle.toplink.xml.xerces
Class DatabaseRowToXMLTranslator

java.lang.Object
  extended byoracle.toplink.xml.xerces.DatabaseRowToXMLTranslator


public class DatabaseRowToXMLTranslator
extends java.lang.Object

This class has a singular purpose: convert a DatabaseRow to an XML document. Given a DatabaseRow, this class will write a corresponding XML document on a Writer.

Since:
TOPLink/Java 3.0
See Also:
DatabaseRow, SDKFieldValue

Field Summary
static java.lang.String ATTRIBUTE_VALUE_FALSE
static java.lang.String ATTRIBUTE_VALUE_TRUE
static java.lang.String CR
Cache the platform-specific line separator.
static java.lang.String EMPTY_AGGREGATE_ATTRIBUTE_NAME
static java.lang.String INDENT
Cache an indentation string (by default, a tab).
static boolean IS_GENERATING_TOPLINK_30_NULL_ELEMENTS
Generate TopLink 3.0-style nulls (e.g.
static boolean IS_PRETTY_PRINTING
Allow pretty-printing of XML document.
static java.lang.String NULL_ATTRIBUTE_NAME
XML attributes and values.
static java.lang.String XML_DECLARATION
Allow the XML declaration to be changed.

Constructor Summary
DatabaseRowToXMLTranslator()
Default constructor.

Method Summary
java.lang.String getCR()
Return the string used for carriage returns/line feeds.
java.lang.String getIndent()
Return the string used for indentations.
java.lang.String getXMLDeclaration()
Return the string used for the XML declaration.
boolean isGeneratingTopLink30NullElements()
Return whether the translator generates TopLink 3.0-style null elements (e.g.
boolean isPrettyPrinting()
Return whether the XML document should be legible.
void setCR(java.lang.String cr)
Set the string used for carriage returns/line feeds.
void setIndent(java.lang.String indent)
Set the string used for indentations.
void setIsGeneratingTopLink30NullElements(boolean isGeneratingTopLink30NullElements)
Set whether the translator generates TopLink 3.0-style null elements (e.g.
void setIsPrettyPrinting(boolean isPrettyPrinting)
Set whether the XML document should be legible.
void setXMLDeclaration(java.lang.String xmlDeclaration)
Set the string used for the XML declaration.
java.lang.String toString()
void write(java.io.Writer outputStream, DatabaseRow row)
Convert the specified database row to an XML document and write it to the specified stream.

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

Field Detail

CR

public static java.lang.String CR
Cache the platform-specific line separator.

INDENT

public static java.lang.String INDENT
Cache an indentation string (by default, a tab).

IS_PRETTY_PRINTING

public static boolean IS_PRETTY_PRINTING
Allow pretty-printing of XML document.

XML_DECLARATION

public static java.lang.String XML_DECLARATION
Allow the XML declaration to be changed.

IS_GENERATING_TOPLINK_30_NULL_ELEMENTS

public static boolean IS_GENERATING_TOPLINK_30_NULL_ELEMENTS
Generate TopLink 3.0-style nulls (e.g. <foo null="true"/>); for backward-compatibility.

NULL_ATTRIBUTE_NAME

public static java.lang.String NULL_ATTRIBUTE_NAME
XML attributes and values.

EMPTY_AGGREGATE_ATTRIBUTE_NAME

public static java.lang.String EMPTY_AGGREGATE_ATTRIBUTE_NAME

ATTRIBUTE_VALUE_TRUE

public static java.lang.String ATTRIBUTE_VALUE_TRUE

ATTRIBUTE_VALUE_FALSE

public static java.lang.String ATTRIBUTE_VALUE_FALSE

Constructor Detail

DatabaseRowToXMLTranslator

public DatabaseRowToXMLTranslator()
Default constructor.

Method Detail

getCR

public java.lang.String getCR()
Return the string used for carriage returns/line feeds.

getIndent

public java.lang.String getIndent()
Return the string used for indentations.

getXMLDeclaration

public java.lang.String getXMLDeclaration()
Return the string used for the XML declaration.

isGeneratingTopLink30NullElements

public boolean isGeneratingTopLink30NullElements()
Return whether the translator generates TopLink 3.0-style null elements (e.g. <foo null="true"/>).

isPrettyPrinting

public boolean isPrettyPrinting()
Return whether the XML document should be legible.

setCR

public void setCR(java.lang.String cr)
Set the string used for carriage returns/line feeds.

setIndent

public void setIndent(java.lang.String indent)
Set the string used for indentations.

setIsGeneratingTopLink30NullElements

public void setIsGeneratingTopLink30NullElements(boolean isGeneratingTopLink30NullElements)
Set whether the translator generates TopLink 3.0-style null elements (e.g. <foo null="true"/>).

setIsPrettyPrinting

public void setIsPrettyPrinting(boolean isPrettyPrinting)
Set whether the XML document should be legible.

setXMLDeclaration

public void setXMLDeclaration(java.lang.String xmlDeclaration)
Set the string used for the XML declaration.

toString

public java.lang.String toString()

write

public void write(java.io.Writer outputStream,
                  DatabaseRow row)
           throws XMLDataStoreException
Convert the specified database row to an XML document and write it to the specified stream.
Throws:
XMLDataStoreException

Copyright © 1998, 2005 Oracle Corporation. All Rights Reserved.