org.freehep.wbxml
Class WBXMLWriter

java.lang.Object
  extended by org.freehep.wbxml.WBXMLWriter
All Implemented Interfaces:
WBXMLTagWriter

public class WBXMLWriter
extends Object
implements WBXMLTagWriter

Writes out Binary XML see http://www.wapforum.org instead of ASCII XML.

Version:
$Id$
Author:
Mark Donszelmann

Constructor Summary
WBXMLWriter(OutputStream os, int maxAttributeTagCode)
          Create a Binary AIDA Writer for given stream
 
Method Summary
 void close()
          Close writer
 void closeDoc()
          Close XML doc
 void closeTag()
          Close nearest tag
 void openDoc()
          Open XML doc with standard parameters
 void openDoc(String version, String encoding, boolean standalone)
          Open XML doc
 void openTag(int tag)
          Write an xml open tag
 void print(String text)
           
 void printComment(String comment)
           
 void printTag(int tag)
          Write empty tag
 void referToDTD(String name, String system)
           
 void referToDTD(String name, String pid, String ref)
           
 void setAttribute(int tag, boolean value)
          Set boolean attribute
 void setAttribute(int tag, boolean[] value, int offset, int length)
          Set boolean attribute
 void setAttribute(int tag, byte value)
          Set byte attribute
 void setAttribute(int tag, byte[] value, int offset, int length)
          Set byte attribute
 void setAttribute(int tag, char value)
          Set char attribute
 void setAttribute(int tag, char[] value, int offset, int length)
          Set char attribute
 void setAttribute(int tag, Color value)
          Set Color attribute
 void setAttribute(int tag, Color[] value, int offset, int length)
          Set Color attribute
 void setAttribute(int tag, double value)
          Set double attribute
 void setAttribute(int tag, double[] value, int offset, int length)
          Set double attribute
 void setAttribute(int tag, float value)
          Set float attribute
 void setAttribute(int tag, float[] value, int offset, int length)
          Set float attribute
 void setAttribute(int tag, int value)
          Set int attribute
 void setAttribute(int tag, int[] value, int offset, int length)
          Set int attribute
 void setAttribute(int tag, long value)
          Set long attribute
 void setAttribute(int tag, long[] value, int offset, int length)
          Set long attribute
 void setAttribute(int tag, short value)
          Set short attribute
 void setAttribute(int tag, short[] value, int offset, int length)
          Set short attribute
 void setAttribute(int tag, String value)
          Set String attribute
 void setAttribute(int tag, String[] value, int offset, int length)
          Set String attribute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WBXMLWriter

public WBXMLWriter(OutputStream os,
                   int maxAttributeTagCode)
            throws IOException
Create a Binary AIDA Writer for given stream

Parameters:
os - stream to write to
maxAttributeCode - largest tagcode for attributes
Throws:
IOException
Method Detail

close

public void close()
           throws IOException
Description copied from interface: WBXMLTagWriter
Close writer

Specified by:
close in interface WBXMLTagWriter
Throws:
IOException - if stream cannot be written

openDoc

public void openDoc()
             throws IOException
Description copied from interface: WBXMLTagWriter
Open XML doc with standard parameters

Specified by:
openDoc in interface WBXMLTagWriter
Throws:
IOException - if stream cannot be written

openDoc

public void openDoc(String version,
                    String encoding,
                    boolean standalone)
             throws IOException
Description copied from interface: WBXMLTagWriter
Open XML doc

Specified by:
openDoc in interface WBXMLTagWriter
Parameters:
version - version string
encoding - encoding
standalone - if XML is standalone
Throws:
IOException - if stream cannot be written

closeDoc

public void closeDoc()
              throws IOException
Description copied from interface: WBXMLTagWriter
Close XML doc

Specified by:
closeDoc in interface WBXMLTagWriter
Throws:
IOException - if stream cannot be written

referToDTD

public void referToDTD(String name,
                       String pid,
                       String ref)
Specified by:
referToDTD in interface WBXMLTagWriter

referToDTD

public void referToDTD(String name,
                       String system)
Specified by:
referToDTD in interface WBXMLTagWriter

openTag

public void openTag(int tag)
             throws IOException
Description copied from interface: WBXMLTagWriter
Write an xml open tag

Specified by:
openTag in interface WBXMLTagWriter
Throws:
IOException - if stream cannot be written

closeTag

public void closeTag()
              throws IOException
Description copied from interface: WBXMLTagWriter
Close nearest tag

Specified by:
closeTag in interface WBXMLTagWriter
Throws:
IOException - if stream cannot be written

printTag

public void printTag(int tag)
              throws IOException
Description copied from interface: WBXMLTagWriter
Write empty tag

Specified by:
printTag in interface WBXMLTagWriter
Throws:
IOException - if stream cannot be written

print

public void print(String text)
           throws IOException
Specified by:
print in interface WBXMLTagWriter
Throws:
IOException

printComment

public void printComment(String comment)
                  throws IOException
Specified by:
printComment in interface WBXMLTagWriter
Throws:
IOException

setAttribute

public void setAttribute(int tag,
                         String value)
Description copied from interface: WBXMLTagWriter
Set String attribute

Specified by:
setAttribute in interface WBXMLTagWriter
Parameters:
tag - attributeID
value - attribute value

setAttribute

public void setAttribute(int tag,
                         String[] value,
                         int offset,
                         int length)
Description copied from interface: WBXMLTagWriter
Set String attribute

Specified by:
setAttribute in interface WBXMLTagWriter
Parameters:
tag - attributeID
value - attribute value
offset - start index in array
length - number of primitives/object to write

setAttribute

public void setAttribute(int tag,
                         byte value)
Description copied from interface: WBXMLTagWriter
Set byte attribute

Specified by:
setAttribute in interface WBXMLTagWriter
Parameters:
tag - attributeID
value - attribute value

setAttribute

public void setAttribute(int tag,
                         byte[] value,
                         int offset,
                         int length)
Description copied from interface: WBXMLTagWriter
Set byte attribute

Specified by:
setAttribute in interface WBXMLTagWriter
Parameters:
tag - attributeID
value - attribute value
offset - start index in array
length - number of primitives/object to write

setAttribute

public void setAttribute(int tag,
                         long value)
Description copied from interface: WBXMLTagWriter
Set long attribute

Specified by:
setAttribute in interface WBXMLTagWriter
Parameters:
tag - attributeID
value - attribute value

setAttribute

public void setAttribute(int tag,
                         long[] value,
                         int offset,
                         int length)
Description copied from interface: WBXMLTagWriter
Set long attribute

Specified by:
setAttribute in interface WBXMLTagWriter
Parameters:
tag - attributeID
value - attribute value
offset - start index in array
length - number of primitives/object to write

setAttribute

public void setAttribute(int tag,
                         int value)
Description copied from interface: WBXMLTagWriter
Set int attribute

Specified by:
setAttribute in interface WBXMLTagWriter
Parameters:
tag - attributeID
value - attribute value

setAttribute

public void setAttribute(int tag,
                         int[] value,
                         int offset,
                         int length)
Description copied from interface: WBXMLTagWriter
Set int attribute

Specified by:
setAttribute in interface WBXMLTagWriter
Parameters:
tag - attributeID
value - attribute value
offset - start index in array
length - number of primitives/object to write

setAttribute

public void setAttribute(int tag,
                         boolean value)
Description copied from interface: WBXMLTagWriter
Set boolean attribute

Specified by:
setAttribute in interface WBXMLTagWriter
Parameters:
tag - attributeID
value - attribute value

setAttribute

public void setAttribute(int tag,
                         boolean[] value,
                         int offset,
                         int length)
Description copied from interface: WBXMLTagWriter
Set boolean attribute

Specified by:
setAttribute in interface WBXMLTagWriter
Parameters:
tag - attributeID
value - attribute value
offset - start index in array
length - number of primitives/object to write

setAttribute

public void setAttribute(int tag,
                         float value)
Description copied from interface: WBXMLTagWriter
Set float attribute

Specified by:
setAttribute in interface WBXMLTagWriter
Parameters:
tag - attributeID
value - attribute value

setAttribute

public void setAttribute(int tag,
                         float[] value,
                         int offset,
                         int length)
Description copied from interface: WBXMLTagWriter
Set float attribute

Specified by:
setAttribute in interface WBXMLTagWriter
Parameters:
tag - attributeID
value - attribute value
offset - start index in array
length - number of primitives/object to write

setAttribute

public void setAttribute(int tag,
                         double value)
Description copied from interface: WBXMLTagWriter
Set double attribute

Specified by:
setAttribute in interface WBXMLTagWriter
Parameters:
tag - attributeID
value - attribute value

setAttribute

public void setAttribute(int tag,
                         double[] value,
                         int offset,
                         int length)
Description copied from interface: WBXMLTagWriter
Set double attribute

Specified by:
setAttribute in interface WBXMLTagWriter
Parameters:
tag - attributeID
value - attribute value
offset - start index in array
length - number of primitives/object to write

setAttribute

public void setAttribute(int tag,
                         Color value)
Description copied from interface: WBXMLTagWriter
Set Color attribute

Specified by:
setAttribute in interface WBXMLTagWriter
Parameters:
tag - attributeID
value - attribute value

setAttribute

public void setAttribute(int tag,
                         Color[] value,
                         int offset,
                         int length)
Description copied from interface: WBXMLTagWriter
Set Color attribute

Specified by:
setAttribute in interface WBXMLTagWriter
Parameters:
tag - attributeID
value - attribute value
offset - start index in array
length - number of primitives/object to write

setAttribute

public void setAttribute(int tag,
                         char value)
Description copied from interface: WBXMLTagWriter
Set char attribute

Specified by:
setAttribute in interface WBXMLTagWriter
Parameters:
tag - attributeID
value - attribute value

setAttribute

public void setAttribute(int tag,
                         char[] value,
                         int offset,
                         int length)
Description copied from interface: WBXMLTagWriter
Set char attribute

Specified by:
setAttribute in interface WBXMLTagWriter
Parameters:
tag - attributeID
value - attribute value
offset - start index in array
length - number of primitives/object to write

setAttribute

public void setAttribute(int tag,
                         short value)
Description copied from interface: WBXMLTagWriter
Set short attribute

Specified by:
setAttribute in interface WBXMLTagWriter
Parameters:
tag - attributeID
value - attribute value

setAttribute

public void setAttribute(int tag,
                         short[] value,
                         int offset,
                         int length)
Description copied from interface: WBXMLTagWriter
Set short attribute

Specified by:
setAttribute in interface WBXMLTagWriter
Parameters:
tag - attributeID
value - attribute value
offset - start index in array
length - number of primitives/object to write


Copyright © 2000-2007 FreeHEP. All Rights Reserved.