org.openadaptor.doconverter.v3
Class BasicDOEncoder

java.lang.Object
  extended by org.openadaptor.doconverter.v3.BasicDOEncoder
All Implemented Interfaces:
ValueEncoder

public class BasicDOEncoder
extends java.lang.Object
implements ValueEncoder

An implementation of ValueEncoder which encodes arrays of DataObjects as "basicdo 1.0" format XML on its output stream.

This is not intended for production use as it will be sightly slower than current systems. You should use the 'fast' or 'java' formats.

Version:
1.0
Author:
Tim Bissell

Field Summary
(package private)  OutputStreamComponent _ostream
           
(package private)  java.io.BufferedWriter _writer
           
protected static XTag DOCUMENT_END_TAG
          XTag containing the document (root) end tag
protected static XTag DOCUMENT_START_TAG
          XTag containing the document (root) end tag
(package private) static org.apache.log4j.Logger log
           
protected static java.lang.String NEWLINE
           
 
Constructor Summary
BasicDOEncoder(OutputStreamComponent ostream)
          Designated constructor
 
Method Summary
 void setOutputStream(OutputStreamComponent ostream)
          Sets the OutputStream on which values will be encoded.
 void setSecurityManager(OASecurityManager securityManager)
          Sets the security manager used by the receiver.
 void writeEncodedObject(java.lang.Object object)
          Encodes object and writes it on output stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

static org.apache.log4j.Logger log

NEWLINE

protected static final java.lang.String NEWLINE

DOCUMENT_START_TAG

protected static XTag DOCUMENT_START_TAG
XTag containing the document (root) end tag


DOCUMENT_END_TAG

protected static XTag DOCUMENT_END_TAG
XTag containing the document (root) end tag


_ostream

OutputStreamComponent _ostream

_writer

java.io.BufferedWriter _writer
Constructor Detail

BasicDOEncoder

public BasicDOEncoder(OutputStreamComponent ostream)
Designated constructor

Method Detail

setOutputStream

public void setOutputStream(OutputStreamComponent ostream)
Sets the OutputStream on which values will be encoded.

Specified by:
setOutputStream in interface ValueEncoder

setSecurityManager

public void setSecurityManager(OASecurityManager securityManager)
                        throws java.lang.SecurityException
Sets the security manager used by the receiver. Does nothing at present.

Specified by:
setSecurityManager in interface ValueEncoder
Parameters:
securityManager - The new security manager (or null).
Throws:
java.lang.SecurityException - If there is a problem connecting with the SecurityManager provided.

writeEncodedObject

public void writeEncodedObject(java.lang.Object object)
                        throws java.lang.Exception,
                               java.io.IOException
Encodes object and writes it on output stream.

Specified by:
writeEncodedObject in interface ValueEncoder
Parameters:
object - Object to be encoded.
Throws:
java.io.IOException - If there is a problem writing on the OutputStream.
java.lang.Exception - If there is a problem encoding the object; e.g. if it is the wrong Class.