org.eclipse.xtend.type.impl.java
Class JavaMetaModel

java.lang.Object
  extended by org.eclipse.xtend.type.impl.java.JavaMetaModel
All Implemented Interfaces:
TypeFinder, MetaModel
Direct Known Subclasses:
JavaBeansMetaModel

public class JavaMetaModel
extends java.lang.Object
implements MetaModel, TypeFinder

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

Constructor Summary
JavaMetaModel()
           
JavaMetaModel(java.lang.String name, JavaTypeStrategy strategy)
           
 
Method Summary
 Type builtinAwareGetType(java.lang.Object obj)
           
 Type builtinAwareGetTypeForClass(java.lang.Class<?> clazz)
           
 Type builtinAwareGetTypeForName(java.lang.String typeName)
           
 java.util.Set<Type> getKnownTypes()
          returns all types this metamodel is responsible for
 java.lang.String getName()
          Returns the metamodel name.
 java.util.Set<java.lang.String> getNamespaces()
          Returns all namespaces provided by this metamodel.
 Type getType(java.lang.Object obj)
          if this metamodel is responsible for a types which are responsible for the given object, it returns the corresponding type.
 Type getTypeForClass(java.lang.Class<?> clazz)
          Returns the corresponding type for an EClass object.
 Type getTypeForName(java.lang.String typeName)
          if this metamodel is responsible for a type with the given name, it returns the corresponding type.
 TypeSystem getTypeSystem()
          Returns the underlying typesystem.
 void setTypeStrategy(JavaTypeStrategy strategy)
          Sets the type strategy.
 void setTypeSystem(TypeSystem typeSystem)
          Sets the underlying typesystem.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaMetaModel

public JavaMetaModel()

JavaMetaModel

public JavaMetaModel(java.lang.String name,
                     JavaTypeStrategy strategy)
Method Detail

getTypeSystem

public TypeSystem getTypeSystem()
Description copied from interface: MetaModel
Returns the underlying typesystem.

Specified by:
getTypeSystem in interface MetaModel
Returns:
the typesystem
See Also:
MetaModel.getTypeSystem()

setTypeSystem

public void setTypeSystem(TypeSystem typeSystem)
Description copied from interface: MetaModel
Sets the underlying typesystem.

Specified by:
setTypeSystem in interface MetaModel
Parameters:
typeSystem - the typesystem
See Also:
MetaModel.setTypeSystem(org.eclipse.xtend.expression.TypeSystem)

builtinAwareGetTypeForName

public Type builtinAwareGetTypeForName(java.lang.String typeName)
Specified by:
builtinAwareGetTypeForName in interface TypeFinder
See Also:
TypeFinder.builtinAwareGetTypeForName(java.lang.String)

getTypeForName

public Type getTypeForName(java.lang.String typeName)
Description copied from interface: MetaModel
if this metamodel is responsible for a type with the given name, it returns the corresponding type. Otherwise returns null

Specified by:
getTypeForName in interface MetaModel
Parameters:
typeName - name of type
Returns:
the corresponding type
See Also:
MetaModel.getTypeForName(java.lang.String)

builtinAwareGetType

public Type builtinAwareGetType(java.lang.Object obj)
Specified by:
builtinAwareGetType in interface TypeFinder
See Also:
TypeFinder.builtinAwareGetType(java.lang.Object)

getType

public Type getType(java.lang.Object obj)
Description copied from interface: MetaModel
if this metamodel is responsible for a types which are responsible for the given object, it returns the corresponding type. Otherwise returns null

Specified by:
getType in interface MetaModel
Parameters:
obj - object for which a corresponding object is requested
Returns:
the corresponding type
See Also:
MetaModel.getType(java.lang.Object)

builtinAwareGetTypeForClass

public Type builtinAwareGetTypeForClass(java.lang.Class<?> clazz)
Specified by:
builtinAwareGetTypeForClass in interface TypeFinder
See Also:
TypeFinder.builtinAwareGetTypeForClass(java.lang.Class)

getTypeForClass

public Type getTypeForClass(java.lang.Class<?> clazz)
Returns the corresponding type for an EClass object.

Parameters:
clazz - the EClass object
Returns:
the corresponding type

getKnownTypes

public java.util.Set<Type> getKnownTypes()
Description copied from interface: MetaModel
returns all types this metamodel is responsible for

Specified by:
getKnownTypes in interface MetaModel
Returns:
set of known types
See Also:
MetaModel.getKnownTypes()

getName

public java.lang.String getName()
Returns the metamodel name.

Returns:
the metamodel name

setTypeStrategy

public void setTypeStrategy(JavaTypeStrategy strategy)
Sets the type strategy.

Parameters:
strategy - the type strategy

getNamespaces

public java.util.Set<java.lang.String> getNamespaces()
Description copied from interface: MetaModel
Returns all namespaces provided by this metamodel.

Specified by:
getNamespaces in interface MetaModel
Returns:
A Set containing the names of all namespaces provided by this metamodel.