org.mbari.siam.distributed.jddac
Class ArgXmlConverter

java.lang.Object
  extended by org.mbari.siam.distributed.jddac.ArgXmlConverter

public class ArgXmlConverter
extends java.lang.Object

Encodes and decodes ArgArray and Vector objects into/from XML. This class encapsulates the DefaultXmlCoder into a couple static methods. It provides simple methods to convert a byte array of JDDAC Arg XML into objects and to convert objects into a byte array of JDDAC Arg XML.

See Also:
DefaultXmlCoder, ArgXmlCoder, ArgTypeConverter

Method Summary
static java.lang.Object decodeFromXml(byte[] xml, int strt, int len)
          Decodes JDDAC Arg XML into an ArgArray or Vector.
static byte[] encodeToXml(java.lang.Object o)
          Encodes an ArgArray or Vector into JDDAC Arg XML.
static net.java.jddac.common.type.ArgArray loadArgArray(java.io.InputStream fstream)
          Given an InputStream, deserialize the contents into an ArgArray.
static net.java.jddac.common.type.ArgArray loadArgArray(java.lang.String xml)
          Given an String, deserialize the contents into an ArgArray.
static java.util.Vector loadVector(java.io.InputStream fstream)
          Given an InputStream, deserialize the contents into an Vector.
static java.util.Vector loadVector(java.lang.String xml)
          Given an String, deserialize the contents into an Vector.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

encodeToXml

public static byte[] encodeToXml(java.lang.Object o)
Encodes an ArgArray or Vector into JDDAC Arg XML.

Parameters:
o - - a ArgArray or Vector of JDDAC Arg objects.
Returns:
a byte[] containing the JDDAC Arg XML represention of o.

decodeFromXml

public static java.lang.Object decodeFromXml(byte[] xml,
                                             int strt,
                                             int len)
Decodes JDDAC Arg XML into an ArgArray or Vector.

Parameters:
xml - - a byte[] containing the JDDAC Arg XML.
strt - - the start of the XML in xml.
len - - the length of the XML in xml.
Returns:
a ArgArray or Vector of Arg objects decoded from the XML.

loadVector

public static java.util.Vector loadVector(java.io.InputStream fstream)
Given an InputStream, deserialize the contents into an Vector.

Parameters:
fstream - - the input stream.
Returns:
A newly created Vector.

loadArgArray

public static net.java.jddac.common.type.ArgArray loadArgArray(java.io.InputStream fstream)
Given an InputStream, deserialize the contents into an ArgArray.

Parameters:
fstream - - the input stream.
Returns:
A newly created ArgArray.

loadVector

public static java.util.Vector loadVector(java.lang.String xml)
Given an String, deserialize the contents into an Vector.

Parameters:
xml - - the string containing the xml.
Returns:
A newly created Vector.

loadArgArray

public static net.java.jddac.common.type.ArgArray loadArgArray(java.lang.String xml)
Given an String, deserialize the contents into an ArgArray.

Parameters:
xml - - the string containing the xml.
Returns:
A newly created ArgArray.


Copyright © 2003 MBARI.

The Monterey Bay Aquarium Research Institute (MBARI) provides this documentation and code "as is", with no warranty, express or implied, of its quality or consistency. It is provided without support and without obligation on the part of MBARI to assist in its use, correction, modification, or enhancement.