de.tuberlin.cs.cis.ocl.type.reflect
Class ReflOpTypeResolver

java.lang.Object
  |
  +--de.tuberlin.cs.cis.ocl.type.reflect.ReflOpTypeResolver

public class ReflOpTypeResolver
extends java.lang.Object

Reflects type informations on java classes representing the ocl types. Therefore adjusts missing features of the java type system.

Note: The class itself needs major refactoring (but I do not have the time). The possiblities to adapt the type system are rudimentar. The mapping of ocl to java and vice versa is hardcoded. The type-interfaces must therefore be seen as final. Changes can result in unintenial runtime results.

Author:
fchabar

Constructor Summary
ReflOpTypeResolver()
           
 
Method Summary
static java.lang.Class javaReflectionClass(Type t)
          Determines the class describing the specified type.
static java.lang.String oclOpName(java.lang.String javaName)
          Maps a java method name to the name of the corresponding ocl operation.
static Type oclType(java.lang.Class t)
          Determines the type described by the specified class.
static Property reflectOperation(Type type, java.lang.String name, Type[] params)
          Reflects an operation on the specified type.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReflOpTypeResolver

public ReflOpTypeResolver()
Method Detail

oclOpName

public static java.lang.String oclOpName(java.lang.String javaName)
Maps a java method name to the name of the corresponding ocl operation.

Parameters:
javaName - a method name.
Returns:
the correspoding ocl name.

oclType

public static Type oclType(java.lang.Class t)
Determines the type described by the specified class.

Parameters:
t - a class describing an OCL type.
Returns:
the ocl type.

javaReflectionClass

public static java.lang.Class javaReflectionClass(Type t)
Determines the class describing the specified type.

Parameters:
t - an OCL type.
Returns:
the class describing the type.

reflectOperation

public static Property reflectOperation(Type type,
                                        java.lang.String name,
                                        Type[] params)
                                 throws UndefinedFeatureException
Reflects an operation on the specified type.

Parameters:
type - the type
name - the name of the operation
params - the parameters of the operation
Returns:
the property/operation
Throws:
UndefinedFeatureException - if the operation cannot be resolved on the specified type.