|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.simantics.databoard.parser.repository.DataTypeRepository
public class DataTypeRepository
Type repository maintains a mapping from strings to data types. It can also convert abstract syntax trees to data types.
Constructor Summary | |
---|---|
DataTypeRepository()
|
Method Summary | |
---|---|
void |
add(java.util.List<AstTypeDefinition> definitions)
Adds all type definitions to the repository. |
DataType |
add(java.lang.String name,
AstType ast)
Adds a type to the repository. |
void |
add(java.lang.String name,
DataType type)
Adds a type to the repository. |
void |
addDefinition(DataTypeDefinition def)
Add a type definition to the repository. |
void |
addDefinitions(DataTypeDefinition... defs)
Add a type definitions to the repository. |
void |
addDefinitions(java.io.InputStream definitions)
|
void |
addDefinitions(java.lang.String definitions)
Parses and adds type definitions to the repository. |
boolean |
contains(DataType type)
|
boolean |
contains(java.lang.String name)
|
java.lang.String |
get(DataType type)
|
DataType |
get(java.lang.String name)
Gets a data type in the repository. |
java.util.Set<java.lang.String> |
getTypeNames()
|
java.lang.String |
toString()
|
DataType |
translate(AstType ast)
Translates an unnamed data type. |
DataType |
translate(java.lang.String typeString)
Parses an unnamed data type. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DataTypeRepository()
Method Detail |
---|
public void add(java.lang.String name, DataType type)
name
- Name of the typetype
- Type to be addedpublic DataType get(java.lang.String name)
name
-
public java.lang.String get(DataType type)
public boolean contains(java.lang.String name)
public boolean contains(DataType type)
public java.util.Set<java.lang.String> getTypeNames()
public void addDefinitions(DataTypeDefinition... defs)
defs
- type definitionspublic void addDefinition(DataTypeDefinition def)
def
- type definitionpublic DataType add(java.lang.String name, AstType ast) throws DataTypeSyntaxError
name
- Name of the typeast
- Abstract syntax tree of the type to be added
DataTypeSyntaxError
public void add(java.util.List<AstTypeDefinition> definitions) throws DataTypeSyntaxError
definitions
- Abstract syntax trees of the definitions
DataTypeSyntaxError
public void addDefinitions(java.lang.String definitions) throws DataTypeSyntaxError
definitions
- Definitions in textual format.
DataTypeSyntaxError
public void addDefinitions(java.io.InputStream definitions) throws java.io.IOException, DataTypeSyntaxError
java.io.IOException
DataTypeSyntaxError
public DataType translate(AstType ast) throws DataTypeSyntaxError
ast
- Abstract syntax tree of the type to be translated
DataTypeSyntaxError
public DataType translate(java.lang.String typeString) throws DataTypeSyntaxError
typeString
- The textual representation of the type to be translated
DataTypeSyntaxError
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |