Data Request Broker
2-3-release

fr.gael.drb.impl.xml
Class XmlWriter

java.lang.Object
  extended by fr.gael.drb.impl.xml.XmlWriter

public class XmlWriter
extends Object

Writer of XML nodes. This writer save DrbNodes into an XML document.


Nested Class Summary
static class XmlWriter.Context
          The dynamic context.
 
Field Summary
static int SHOW_ALL
          Show all items.
static int SHOW_ATTRIBUTE
          Show attribute items.
static int SHOW_COMMENT
          Show comment items.
static int SHOW_NOTATION
          Show NOTATION items.
static int SHOW_PROCESSING_INSTRUCTION
          Show PI items.
 
Constructor Summary
XmlWriter(DrbNode node)
          Builds a XML Writer from an output node.
XmlWriter(OutputStream file)
          Builds a XML Writer from an output stream.
XmlWriter(Writer file, String encoding)
          Builds a XML Writer from a writer.
 
Method Summary
static void dump(DrbItem item, OutputStream stream, String indent)
          Dump the infoset structure of a node.
static void main(String[] args)
          Make this class runnable for testing.
 void save(DrbNode node)
          Writes the input tree nodes into an output stream.
 void save(DrbNode node, XmlWriter.Context context, boolean prolog)
          Writes the input tree nodes.
static void writeXML(DrbNode node, OutputStream file)
          Writes the input tree nodes into a file.
static void writeXML(DrbNode node, OutputStream file, XmlWriter.Context context, boolean prolog)
          Writes the input tree nodes into a file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SHOW_ALL

public static final int SHOW_ALL
Show all items.

See Also:
Constant Field Values

SHOW_ATTRIBUTE

public static final int SHOW_ATTRIBUTE
Show attribute items.

See Also:
Constant Field Values

SHOW_COMMENT

public static final int SHOW_COMMENT
Show comment items.

See Also:
Constant Field Values

SHOW_PROCESSING_INSTRUCTION

public static final int SHOW_PROCESSING_INSTRUCTION
Show PI items.

See Also:
Constant Field Values

SHOW_NOTATION

public static final int SHOW_NOTATION
Show NOTATION items.

See Also:
Constant Field Values
Constructor Detail

XmlWriter

public XmlWriter(OutputStream file)
Builds a XML Writer from an output stream.

Parameters:
file - the output stream to be used for printing XML document

XmlWriter

public XmlWriter(Writer file,
                 String encoding)
Builds a XML Writer from a writer.

Parameters:
file - the writer to be used for printing XML document
encoding - the encoding used by the writer.

XmlWriter

public XmlWriter(DrbNode node)
Builds a XML Writer from an output node.

Parameters:
node - the output node to be used for printing XML document
Method Detail

writeXML

public static void writeXML(DrbNode node,
                            OutputStream file)
Writes the input tree nodes into a file.

Parameters:
node - the input node to be printed.
file - the output stream to be used for printing XML document

writeXML

public static void writeXML(DrbNode node,
                            OutputStream file,
                            XmlWriter.Context context,
                            boolean prolog)
Writes the input tree nodes into a file.

Parameters:
node - the input node to be printed.
file - the output stream to be used for printing XML document
context - the writer context.
prolog - true to print the prolog and false otherwise

save

public void save(DrbNode node)
Writes the input tree nodes into an output stream.

Parameters:
node - the input node to be printed.

save

public void save(DrbNode node,
                 XmlWriter.Context context,
                 boolean prolog)
Writes the input tree nodes.

Parameters:
node - the input node to be printed.
context - the writer context.
prolog - true to print the prolog and false otherwise

dump

public static void dump(DrbItem item,
                        OutputStream stream,
                        String indent)
Dump the infoset structure of a node.


main

public static void main(String[] args)
Make this class runnable for testing.

Parameters:
args - the arguments.

Data Request Broker - DRB API®
2-3-release

Copyright© 2001-2009 GAEL Consultant. All rights reserved. Use is subject to license terms .