org.simantics.databoard.binding.classfactory
Class SignatureVisitor

java.lang.Object
  extended by org.simantics.databoard.binding.classfactory.SignatureVisitor
All Implemented Interfaces:
Datatype.Visitor1

public class SignatureVisitor
extends java.lang.Object
implements Datatype.Visitor1

Signature Visitor builds a signature string from a datatype. The argument is StringBuilder. Signature is construtructed with the following notation. s StringType z BooleanType d DoubleType f FloatType i IntegerType b ByteType j LongType R Referable RecordType o* OptionalType, * denotes componentType a* ArrayType, * denotes componentType r**e RecordType, ** denotes fields u UnionType, * denotes components m** MapType, ** denotes keyType and valueType t Datatype For example, The signature of UUID.class is "rjje"

Author:
toni.kalajainen

Field Summary
 int hashcode
           
 java.lang.StringBuilder sb
           
 java.util.IdentityHashMap<Datatype,java.lang.Boolean> visited
           
 
Constructor Summary
SignatureVisitor()
           
 
Method Summary
static java.lang.String toSignature(Datatype type)
           
 void visit(ArrayType b, java.lang.Object obj)
           
 void visit(BooleanType b, java.lang.Object obj)
           
 void visit(ByteType b, java.lang.Object obj)
           
 void visit(DoubleType b, java.lang.Object obj)
           
 void visit(FloatType b, java.lang.Object obj)
           
 void visit(IntegerType b, java.lang.Object obj)
           
 void visit(LongType b, java.lang.Object obj)
           
 void visit(MapType b, java.lang.Object obj)
           
 void visit(OptionalType b, java.lang.Object obj)
           
 void visit(RecordType b, java.lang.Object obj)
           
 void visit(StringType b, java.lang.Object obj)
           
 void visit(UnionType b, java.lang.Object obj)
           
 void visit(VariantType b, java.lang.Object obj)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

sb

public java.lang.StringBuilder sb

hashcode

public int hashcode

visited

public java.util.IdentityHashMap<Datatype,java.lang.Boolean> visited
Constructor Detail

SignatureVisitor

public SignatureVisitor()
Method Detail

toSignature

public static java.lang.String toSignature(Datatype type)

visit

public void visit(ArrayType b,
                  java.lang.Object obj)
Specified by:
visit in interface Datatype.Visitor1

visit

public void visit(BooleanType b,
                  java.lang.Object obj)
Specified by:
visit in interface Datatype.Visitor1

visit

public void visit(DoubleType b,
                  java.lang.Object obj)
Specified by:
visit in interface Datatype.Visitor1

visit

public void visit(FloatType b,
                  java.lang.Object obj)
Specified by:
visit in interface Datatype.Visitor1

visit

public void visit(IntegerType b,
                  java.lang.Object obj)
Specified by:
visit in interface Datatype.Visitor1

visit

public void visit(ByteType b,
                  java.lang.Object obj)
Specified by:
visit in interface Datatype.Visitor1

visit

public void visit(LongType b,
                  java.lang.Object obj)
Specified by:
visit in interface Datatype.Visitor1

visit

public void visit(OptionalType b,
                  java.lang.Object obj)
Specified by:
visit in interface Datatype.Visitor1

visit

public void visit(RecordType b,
                  java.lang.Object obj)
Specified by:
visit in interface Datatype.Visitor1

visit

public void visit(StringType b,
                  java.lang.Object obj)
Specified by:
visit in interface Datatype.Visitor1

visit

public void visit(UnionType b,
                  java.lang.Object obj)
Specified by:
visit in interface Datatype.Visitor1

visit

public void visit(VariantType b,
                  java.lang.Object obj)
Specified by:
visit in interface Datatype.Visitor1

visit

public void visit(MapType b,
                  java.lang.Object obj)
Specified by:
visit in interface Datatype.Visitor1