org.simantics.databoard.parser.unparsing
Class DataTypePrinter

java.lang.Object
  extended by org.simantics.databoard.parser.unparsing.DataTypePrinter

public class DataTypePrinter
extends java.lang.Object

Converts abstract syntax tree of data type to string.

Author:
Hannu Niemistö

Constructor Summary
DataTypePrinter(java.lang.StringBuilder stringBuilder)
           
 
Method Summary
 DataTypeRepository getDataTypeRepository()
           
 java.lang.StringBuilder getStringBuilder()
           
 void print(DataType type)
          Print type
 void printDefinitions(DataType type)
          Print type definitions and definitions of referred types
 void setDataTypeRepository(DataTypeRepository repo)
           
 void setLinedeed(boolean linefeed)
           
 void setStringBuilder(java.lang.StringBuilder stringBuilder)
           
 java.lang.String toString()
           
static java.lang.String toString(DataType dataType, boolean linefeed)
          Converts a data type to string.
 void visit(AstArrayType type)
           
 void visit(AstAttribute attribute)
           
 void visit(AstComponent component)
           
 void visit(AstRecordType type)
           
 void visit(AstTupleType type)
           
 void visit(AstType type)
           
 void visit(AstTypeDefinition definition)
           
 void visit(AstTypeReference type)
           
 void visit(AstUnionType type)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DataTypePrinter

public DataTypePrinter(java.lang.StringBuilder stringBuilder)
Method Detail

getDataTypeRepository

public DataTypeRepository getDataTypeRepository()

setDataTypeRepository

public void setDataTypeRepository(DataTypeRepository repo)

getStringBuilder

public java.lang.StringBuilder getStringBuilder()

setStringBuilder

public void setStringBuilder(java.lang.StringBuilder stringBuilder)

setLinedeed

public void setLinedeed(boolean linefeed)

visit

public void visit(AstTypeDefinition definition)

visit

public void visit(AstType type)

visit

public void visit(AstArrayType type)

visit

public void visit(AstAttribute attribute)

visit

public void visit(AstComponent component)

visit

public void visit(AstRecordType type)

visit

public void visit(AstTupleType type)

visit

public void visit(AstTypeReference type)

visit

public void visit(AstUnionType type)

print

public void print(DataType type)
Print type

Parameters:
type -

printDefinitions

public void printDefinitions(DataType type)
Print type definitions and definitions of referred types

Parameters:
type -

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toString

public static java.lang.String toString(DataType dataType,
                                        boolean linefeed)
Converts a data type to string.

Parameters:
dataType -
linefeed - if true add line feed
Returns:
data type as string