org.eclipse.xtend.expression
Class TypeSystemImpl

java.lang.Object
  extended by org.eclipse.xtend.expression.TypeSystemImpl
All Implemented Interfaces:
TypeSystem

public class TypeSystemImpl
extends java.lang.Object
implements TypeSystem

Author:
Sven Efftinge (http://www.efftinge.de)

Field Summary
protected  BuiltinMetaModel builtin
           
protected  java.util.List<MetaModel> metaModels
           
 
Constructor Summary
TypeSystemImpl()
           
 
Method Summary
 void clearCaches()
          If re-using this type system once in a while for multiple generator runs, clearing the dynamic type information is required, as types of objects may have changed in the meantime (i.g.
 Operation findOperation(java.lang.String name, java.lang.Object target, java.lang.Object[] params)
           
 Property findProperty(java.lang.String name, java.lang.Object target)
           
 Type[] findTypesForPrefix(java.lang.String prefix)
           
 Type[] findTypesForPrefix(java.lang.String prefix, java.lang.String[] importedNamespaces)
           
 Type[] getAllTypes()
           
 Type getBooleanType()
           
 Type getCollectionType(Type innerType)
           
 Type getFeatureType()
           
 Type getIntegerType()
           
 Type getListType(Type innerType)
           
 java.util.List<MetaModel> getMetaModels()
           
 java.util.Set<java.lang.String> getNamespaces()
           
 Type getObjectType()
           
 Type getOperationType()
           
 java.util.List<java.lang.String> getPossibleNames(java.lang.String name, java.lang.String[] importedNs)
           
 Type getPropertyType()
           
 Type getRealType()
           
 Type getSetType(Type innerType)
           
 Type getStaticPropertyType()
           
 Type getStringType()
           
 Type getType(java.lang.Object obj)
           
 Type getTypeForName(java.lang.String typeName)
           
 Type getTypeForName(java.lang.String typeName, java.lang.String[] importedNamespaces)
           
 Type getTypeType()
           
 Type getVoidType()
           
 void registerMetaModel(MetaModel metaModel)
           
 void release()
          Clears internal resources (caches).
 void setBuiltinMetamodel(BuiltinMetaModel builtinMetaModel)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

builtin

protected BuiltinMetaModel builtin

metaModels

protected final java.util.List<MetaModel> metaModels
Constructor Detail

TypeSystemImpl

public TypeSystemImpl()
Method Detail

setBuiltinMetamodel

public void setBuiltinMetamodel(BuiltinMetaModel builtinMetaModel)

registerMetaModel

public final void registerMetaModel(MetaModel metaModel)

getMetaModels

public java.util.List<MetaModel> getMetaModels()

findOperation

public Operation findOperation(java.lang.String name,
                               java.lang.Object target,
                               java.lang.Object[] params)
Specified by:
findOperation in interface TypeSystem

findProperty

public Property findProperty(java.lang.String name,
                             java.lang.Object target)
Specified by:
findProperty in interface TypeSystem

getObjectType

public Type getObjectType()
Specified by:
getObjectType in interface TypeSystem

getVoidType

public Type getVoidType()
Specified by:
getVoidType in interface TypeSystem

getBooleanType

public Type getBooleanType()
Specified by:
getBooleanType in interface TypeSystem

getIntegerType

public Type getIntegerType()
Specified by:
getIntegerType in interface TypeSystem

getRealType

public Type getRealType()
Specified by:
getRealType in interface TypeSystem

getStringType

public Type getStringType()
Specified by:
getStringType in interface TypeSystem

getTypeType

public Type getTypeType()
Specified by:
getTypeType in interface TypeSystem

getCollectionType

public Type getCollectionType(Type innerType)
Specified by:
getCollectionType in interface TypeSystem

getListType

public Type getListType(Type innerType)
Specified by:
getListType in interface TypeSystem

getSetType

public Type getSetType(Type innerType)
Specified by:
getSetType in interface TypeSystem

getType

public Type getType(java.lang.Object obj)
Specified by:
getType in interface TypeSystem

getFeatureType

public Type getFeatureType()
Specified by:
getFeatureType in interface TypeSystem

getPropertyType

public Type getPropertyType()
Specified by:
getPropertyType in interface TypeSystem

getOperationType

public Type getOperationType()
Specified by:
getOperationType in interface TypeSystem

getTypeForName

public Type getTypeForName(java.lang.String typeName)
Specified by:
getTypeForName in interface TypeSystem

getTypeForName

public Type getTypeForName(java.lang.String typeName,
                           java.lang.String[] importedNamespaces)

findTypesForPrefix

public Type[] findTypesForPrefix(java.lang.String prefix)
Specified by:
findTypesForPrefix in interface TypeSystem

findTypesForPrefix

public Type[] findTypesForPrefix(java.lang.String prefix,
                                 java.lang.String[] importedNamespaces)

getAllTypes

public Type[] getAllTypes()
Specified by:
getAllTypes in interface TypeSystem

getNamespaces

public java.util.Set<java.lang.String> getNamespaces()
Specified by:
getNamespaces in interface TypeSystem

getPossibleNames

public java.util.List<java.lang.String> getPossibleNames(java.lang.String name,
                                                         java.lang.String[] importedNs)

getStaticPropertyType

public Type getStaticPropertyType()
Specified by:
getStaticPropertyType in interface TypeSystem

release

public void release()
Description copied from interface: TypeSystem
Clears internal resources (caches).

Specified by:
release in interface TypeSystem

clearCaches

public void clearCaches()
If re-using this type system once in a while for multiple generator runs, clearing the dynamic type information is required, as types of objects may have changed in the meantime (i.g. by applying/removing stereotypes etc).

Since:
2.0