org.metasyntactic.io
Class XMLInputStream

java.lang.Object
  |
  +--java.io.InputStream
        |
        +--java.io.ObjectInputStream
              |
              +--org.metasyntactic.io.XMLInputStream
All Implemented Interfaces:
java.io.DataInput, java.io.ObjectInput, java.io.ObjectStreamConstants, XMLStreamConstants

public class XMLInputStream
extends java.io.ObjectInputStream
implements XMLStreamConstants

Reconstructs a java Object that has been written out in XML according the grammar specified in Stream.dtd


Nested Class Summary
 
Nested classes inherited from class java.io.ObjectInputStream
java.io.ObjectInputStream.GetField
 
Field Summary
protected static java.lang.reflect.Method allocateMethod
           
protected  java.util.Map cachedClassed
           
protected  org.w3c.dom.Element current
           
protected  org.w3c.dom.Document document
           
protected  java.io.InputStream in
           
protected  int index
           
protected  int listLength
           
protected  org.w3c.dom.NodeList objects
           
protected static java.lang.Class OISClass
           
protected  org.w3c.dom.traversal.NodeIterator preOrder
           
protected static java.lang.Class[] READ_OBJECT_ARGS
           
protected  java.lang.Object[] references
           
protected  org.w3c.dom.Element stream
           
 
Fields inherited from interface org.metasyntactic.io.XMLStreamConstants
ARRAY_ELEMENT, CLASS_DESCRIPTOR_ELEMENT, CLASS_ELEMENT, FIELD_ELEMENT, FIELDS_ELEMENT, ID_ATTRIBUTE, IDREF_ATTRIBUTE, LENGTH_ATTRIBUTE, NAME_ATTRIBUTE, NAME_SPACE_URI, NULL_ELEMENT, OBJECT_ELEMENT, PRIMITIVE_ARRAY_ELEMENT_SEPARATOR, PRIMITIVE_ELEMENT, REFERENCE_ELEMENT, RESET_ELEMENT, SERIAL_VERSION_UID_ATTRIBUTE, STREAM_ELEMENT, STRING_ELEMENT, TYPE_ATTRIBUTE, VALUE_ATTRIBUTE, VERSION_ATTRIBUTE
 
Fields inherited from interface java.io.ObjectStreamConstants
baseWireHandle, PROTOCOL_VERSION_1, PROTOCOL_VERSION_2, SC_BLOCK_DATA, SC_EXTERNALIZABLE, SC_SERIALIZABLE, SC_WRITE_METHOD, STREAM_MAGIC, STREAM_VERSION, SUBCLASS_IMPLEMENTATION_PERMISSION, SUBSTITUTION_PERMISSION, TC_ARRAY, TC_BASE, TC_BLOCKDATA, TC_BLOCKDATALONG, TC_CLASS, TC_CLASSDESC, TC_ENDBLOCKDATA, TC_EXCEPTION, TC_LONGSTRING, TC_MAX, TC_NULL, TC_OBJECT, TC_PROXYCLASSDESC, TC_REFERENCE, TC_RESET, TC_STRING
 
Constructor Summary
XMLInputStream(java.io.InputStream in)
          Creates new XMLInputStream
 
Method Summary
protected  void addReference(java.lang.Object obj, java.lang.String id)
           
 void close()
           
protected  void defaultReadObject(java.lang.Object obj, ClassDescriptor currentClassDesc)
           
protected  boolean hasReadObjectMethod(ClassDescriptor desc)
           
protected  void inputClassFields(java.lang.Object obj, java.lang.Class clazz, java.lang.reflect.Field[] fields)
           
protected  void invokeObjectRead(java.lang.Object obj, ClassDescriptor desc)
           
protected static boolean isAbstract(java.lang.Class clazz)
           
static void main(java.lang.String[] args)
           
protected  boolean readBooleanInternal()
           
 byte readByte()
           
protected  byte readByteInternal()
           
 char readChar()
           
protected  char readCharInternal()
           
protected  ClassDescriptor readClassDescriptor0()
           
 double readDouble()
           
protected  double readDoubleInternal()
           
protected  java.lang.reflect.Field readFieldDescriptor(java.lang.Class forClass)
           
protected  java.lang.reflect.Field[] readFields(java.lang.Class forClass)
           
 float readFloat()
           
protected  float readFloatInternal()
           
 int readInt()
           
protected  int readIntInternal()
           
 long readLong()
           
protected  long readLongInternal()
           
protected  java.lang.Object readNewArray()
           
protected  java.lang.Class readNewClass()
           
protected  ClassDescriptor readNewClassDescriptor()
           
protected  java.lang.Object readNewObject()
           
protected  java.lang.Object readNewPrimitive()
           
protected  java.lang.String readNewString()
           
protected  boolean readNull()
           
protected  java.lang.Object readObjectInternal()
           
protected  java.lang.Object readObjectOverride()
           
 java.lang.Object readPrimitive()
           
protected  java.lang.Object readPrimitiveInternal()
           
protected  int readReference()
           
protected  boolean readReset()
           
 short readShort()
           
protected  short readShortInternal()
           
protected  ClassDescriptor readSuperclassDescriptor()
           
 java.lang.String readUTF()
           
 boolean writeBoolean()
           
 
Methods inherited from class java.io.ObjectInputStream
available, defaultReadObject, enableResolveObject, read, read, readBoolean, readClassDescriptor, readFields, readFully, readFully, readLine, readObject, readStreamHeader, readUnshared, readUnsignedByte, readUnsignedShort, registerValidation, resolveClass, resolveObject, resolveProxyClass, skipBytes
 
Methods inherited from class java.io.InputStream
mark, markSupported, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.io.ObjectInput
read, skip
 

Field Detail

document

protected final org.w3c.dom.Document document

stream

protected final org.w3c.dom.Element stream

objects

protected final org.w3c.dom.NodeList objects

listLength

protected final int listLength

in

protected final java.io.InputStream in

references

protected java.lang.Object[] references

index

protected int index

cachedClassed

protected final java.util.Map cachedClassed

preOrder

protected org.w3c.dom.traversal.NodeIterator preOrder

current

protected org.w3c.dom.Element current

OISClass

protected static java.lang.Class OISClass

allocateMethod

protected static java.lang.reflect.Method allocateMethod

READ_OBJECT_ARGS

protected static final java.lang.Class[] READ_OBJECT_ARGS
Constructor Detail

XMLInputStream

public XMLInputStream(java.io.InputStream in)
               throws java.io.IOException,
                      org.xml.sax.SAXException
Creates new XMLInputStream

Method Detail

readUTF

public java.lang.String readUTF()
                         throws java.io.IOException
Specified by:
readUTF in interface java.io.DataInput
Overrides:
readUTF in class java.io.ObjectInputStream
java.io.IOException

readPrimitive

public java.lang.Object readPrimitive()
                               throws java.io.IOException
java.io.IOException

readPrimitiveInternal

protected java.lang.Object readPrimitiveInternal()
                                          throws java.io.IOException
java.io.IOException

readNewPrimitive

protected java.lang.Object readNewPrimitive()
                                     throws java.io.IOException
java.io.IOException

readDouble

public double readDouble()
                  throws java.io.IOException
Specified by:
readDouble in interface java.io.DataInput
Overrides:
readDouble in class java.io.ObjectInputStream
java.io.IOException

readDoubleInternal

protected double readDoubleInternal()
                             throws java.io.IOException
java.io.IOException

readFloat

public float readFloat()
                throws java.io.IOException
Specified by:
readFloat in interface java.io.DataInput
Overrides:
readFloat in class java.io.ObjectInputStream
java.io.IOException

readFloatInternal

protected float readFloatInternal()
                           throws java.io.IOException
java.io.IOException

readLong

public long readLong()
              throws java.io.IOException
Specified by:
readLong in interface java.io.DataInput
Overrides:
readLong in class java.io.ObjectInputStream
java.io.IOException

readLongInternal

protected long readLongInternal()
                         throws java.io.IOException
java.io.IOException

readInt

public int readInt()
            throws java.io.IOException
Specified by:
readInt in interface java.io.DataInput
Overrides:
readInt in class java.io.ObjectInputStream
java.io.IOException

readIntInternal

protected int readIntInternal()
                       throws java.io.IOException
java.io.IOException

readChar

public char readChar()
              throws java.io.IOException
Specified by:
readChar in interface java.io.DataInput
Overrides:
readChar in class java.io.ObjectInputStream
java.io.IOException

readCharInternal

protected char readCharInternal()
                         throws java.io.IOException
java.io.IOException

readShort

public short readShort()
                throws java.io.IOException
Specified by:
readShort in interface java.io.DataInput
Overrides:
readShort in class java.io.ObjectInputStream
java.io.IOException

readShortInternal

protected short readShortInternal()
                           throws java.io.IOException
java.io.IOException

readByte

public byte readByte()
              throws java.io.IOException
Specified by:
readByte in interface java.io.DataInput
Overrides:
readByte in class java.io.ObjectInputStream
java.io.IOException

readByteInternal

protected byte readByteInternal()
                         throws java.io.IOException
java.io.IOException

writeBoolean

public boolean writeBoolean()
                     throws java.io.IOException
java.io.IOException

readBooleanInternal

protected boolean readBooleanInternal()
                               throws java.io.IOException
java.io.IOException

close

public void close()
           throws java.io.IOException
Specified by:
close in interface java.io.ObjectInput
Overrides:
close in class java.io.ObjectInputStream
java.io.IOException

readReset

protected boolean readReset()

readNull

protected boolean readNull()
                    throws java.io.IOException
java.io.IOException

readReference

protected int readReference()
                     throws java.io.IOException
java.io.IOException

readObjectInternal

protected java.lang.Object readObjectInternal()
                                       throws java.io.IOException
java.io.IOException

readObjectOverride

protected java.lang.Object readObjectOverride()
                                       throws java.io.IOException,
                                              java.lang.ClassNotFoundException
Overrides:
readObjectOverride in class java.io.ObjectInputStream
java.io.IOException
java.lang.ClassNotFoundException

readNewClass

protected java.lang.Class readNewClass()
                                throws java.io.IOException,
                                       java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException

addReference

protected void addReference(java.lang.Object obj,
                            java.lang.String id)

readClassDescriptor0

protected ClassDescriptor readClassDescriptor0()
                                        throws java.io.IOException,
                                               java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException

readSuperclassDescriptor

protected ClassDescriptor readSuperclassDescriptor()
                                            throws java.io.IOException,
                                                   java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException

readNewClassDescriptor

protected ClassDescriptor readNewClassDescriptor()
                                          throws java.io.IOException,
                                                 java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException

readFields

protected java.lang.reflect.Field[] readFields(java.lang.Class forClass)
                                        throws java.io.IOException
java.io.IOException

readFieldDescriptor

protected java.lang.reflect.Field readFieldDescriptor(java.lang.Class forClass)
                                               throws java.io.IOException
java.io.IOException

readNewArray

protected java.lang.Object readNewArray()
                                 throws java.io.IOException,
                                        java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException

readNewObject

protected java.lang.Object readNewObject()
                                  throws java.io.IOException,
                                         java.lang.InstantiationException,
                                         java.lang.ClassNotFoundException,
                                         java.lang.IllegalAccessException
java.io.IOException
java.lang.InstantiationException
java.lang.ClassNotFoundException
java.lang.IllegalAccessException

isAbstract

protected static final boolean isAbstract(java.lang.Class clazz)

defaultReadObject

protected void defaultReadObject(java.lang.Object obj,
                                 ClassDescriptor currentClassDesc)
                          throws java.io.IOException
java.io.IOException

inputClassFields

protected void inputClassFields(java.lang.Object obj,
                                java.lang.Class clazz,
                                java.lang.reflect.Field[] fields)
                         throws java.io.IOException,
                                java.lang.ClassNotFoundException
java.io.IOException
java.lang.ClassNotFoundException

hasReadObjectMethod

protected boolean hasReadObjectMethod(ClassDescriptor desc)
                               throws java.io.IOException
java.io.IOException

invokeObjectRead

protected void invokeObjectRead(java.lang.Object obj,
                                ClassDescriptor desc)
                         throws java.io.IOException
java.io.IOException

readNewString

protected java.lang.String readNewString()
                                  throws java.io.IOException
java.io.IOException

main

public static void main(java.lang.String[] args)