com.croftsoft.core.beans
Class XmlBeanCoder

java.lang.Object
  extended by com.croftsoft.core.beans.XmlBeanCoder
All Implemented Interfaces:
Encoder, Parser

public final class XmlBeanCoder
extends Object
implements Encoder, Parser

Encodes and decodes objects using XMLEncoder and XMLDecoder.

Since:
2003-04-07
Version:
$Id: XmlBeanCoder.java,v 1.2 2006/01/24 22:20:29 croft Exp $
See Also:
XMLEncoder, XMLDecoder
Author:
David Wallace Croft

Field Summary
static XmlBeanCoder INSTANCE
           
 
Method Summary
static Object decodeFromXml(byte[] bytes)
           
static Object decodeFromXml(InputStream inputStream)
           
 byte[] encode(Object object)
           
static byte[] encodeAsXml(Object o)
           
static void encodeAsXml(Object o, OutputStream outputStream)
           
static Object loadFromXmlFile(File file)
           
static Object loadFromXmlFile(String filename)
           
 Object parse(InputStream inputStream, int contentLength)
           
static void saveToXmlFile(Object object, File file)
           
static void saveToXmlFile(Object object, String filename)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final XmlBeanCoder INSTANCE
Method Detail

decodeFromXml

public static Object decodeFromXml(byte[] bytes)

decodeFromXml

public static Object decodeFromXml(InputStream inputStream)

encodeAsXml

public static void encodeAsXml(Object o,
                               OutputStream outputStream)

encodeAsXml

public static byte[] encodeAsXml(Object o)

loadFromXmlFile

public static Object loadFromXmlFile(File file)
                              throws IOException
Throws:
IOException

loadFromXmlFile

public static Object loadFromXmlFile(String filename)
                              throws IOException
Throws:
IOException

saveToXmlFile

public static void saveToXmlFile(Object object,
                                 File file)
                          throws IOException
Throws:
IOException

saveToXmlFile

public static void saveToXmlFile(Object object,
                                 String filename)
                          throws IOException
Throws:
IOException

encode

public byte[] encode(Object object)
              throws IOException
Specified by:
encode in interface Encoder
Throws:
IOException

parse

public Object parse(InputStream inputStream,
                    int contentLength)
             throws IOException
Specified by:
parse in interface Parser
contentLength - -1 if unknown.
Throws:
IOException

CroftSoft Javadoc

CroftSoft Core Javadoc (2008-09-28 20:58:02)