Package org.eclipse.m2m.atl.emftvm.util
Class NativeTypes
- java.lang.Object
-
- org.eclipse.m2m.atl.emftvm.util.NativeTypes
-
public final class NativeTypes extends java.lang.Object
Contains a registry of native type names and their Java class implementations, and provides methods to instantiate native types.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NativeTypes.NativeType
Enumeration of registered native types.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.Class<?>
boxedType(java.lang.Class<?> type)
Returns the boxed EMFTVM type for the given type.static java.lang.Class<?>
findType(java.lang.String typeName)
Finds theClass
fortypeName
.static java.lang.Object
newInstance(java.lang.Class<?> type)
Creates a new instance oftype
.static java.lang.String
typeName(java.lang.Class<?> type)
Returns the name oftype
.
-
-
-
Method Detail
-
findType
public static java.lang.Class<?> findType(java.lang.String typeName) throws java.lang.ClassNotFoundException
Finds theClass
fortypeName
.- Parameters:
typeName
- the native type name- Returns:
- the
Class
fortypeName
- Throws:
java.lang.ClassNotFoundException
- if theClass
could not be found
-
newInstance
public static java.lang.Object newInstance(java.lang.Class<?> type) throws java.lang.InstantiationException, java.lang.IllegalAccessException
Creates a new instance oftype
.- Parameters:
type
- the type to instantiate- Returns:
- a new instance of
type
- Throws:
java.lang.InstantiationException
- if the type cannot be instantiatedjava.lang.IllegalAccessException
- if the type cannot be accessed
-
typeName
public static java.lang.String typeName(java.lang.Class<?> type)
Returns the name oftype
.- Parameters:
type
- the type- Returns:
- the name of
type
-
boxedType
public static java.lang.Class<?> boxedType(java.lang.Class<?> type)
Returns the boxed EMFTVM type for the given type.- Parameters:
type
- the Java type for which to return the boxed type- Returns:
- the boxed EMFTVM type for the given type
-
-