jltools.util
Class TypeEncoder

java.lang.Object
  |
  +--jltools.util.TypeEncoder

public class TypeEncoder
extends java.lang.Object

The TypeEncoder gives the ability to encode a jltools Type as a Java string.

It uses a form of serialization to encode the Type into a byte stream and then converts the byte stream to a standard Java string.

The difference between the encoder and a normal serialization process is that in order to encode this type, we need to sever any links to other types in the current environment. So any ClassType other than the the type being encoded is replaced in the stream with an AmbiguousType that contains the fully qualified name.


Field Summary
protected  boolean test
           
protected  TypeSystem ts
           
protected  boolean zip
           
 
Constructor Summary
TypeEncoder(TypeSystem ts)
           
 
Method Summary
 Type decode(java.lang.String s)
           
 java.lang.String encode(Type t)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ts

protected TypeSystem ts

zip

protected final boolean zip

test

protected final boolean test
Constructor Detail

TypeEncoder

public TypeEncoder(TypeSystem ts)
Method Detail

encode

public java.lang.String encode(Type t)
                        throws java.io.IOException

decode

public Type decode(java.lang.String s)
            throws java.io.IOException,
                   java.lang.ClassNotFoundException