org.objectweb.kilim.model.mapping
Class JavaRuntimeMapper

java.lang.Object
  extended byorg.objectweb.kilim.model.mapping.JavaRuntimeMapper
All Implemented Interfaces:
Mapper

public class JavaRuntimeMapper
extends java.lang.Object
implements Mapper

This mapper

Author:
horn

Field Summary
(package private)  java.io.FileWriter fW
           
(package private)  java.io.PrintWriter pW
           
 
Constructor Summary
JavaRuntimeMapper()
           
 
Method Summary
 void enterContext(MappingContext aContext)
          Method enterContext.
 void executeConstructor(java.lang.Class aClass, java.lang.Object[] paramObjects, java.lang.String[] typeNames, MappingContext aContext)
          Method executeConstructor.
 void executeMethod(java.lang.Object aSupport, boolean isStatic, java.lang.String aMethodName, java.lang.Object[] paramObjects, java.lang.String[] typeNames, MappingContext aContext)
          Method executeMethod.
 void executeNullElement(MappingContext aContext)
          Method executeNullElement.
 void executeSetter(java.lang.Object aSupport, boolean isStatic, java.lang.String fieldName, java.lang.Object toBeSet, MappingContext aContext)
          Method executeSetter.
 java.lang.Object getClassValue(java.lang.String aClassName, MappingContext aContext)
          Method getClassSourceValue.
 java.lang.Object getConstructorValue(java.lang.Class aClass, java.lang.Object[] paramObjects, java.lang.String[] typeNames, MappingContext aContext)
          Method getConstructorValue.
 java.lang.Object getEventSourceValue(MappingContext aContext)
          Method getEventSourceValue.....
 java.lang.Object getExternalValue(java.lang.Object value, MappingContext aContext)
          Method getExternalValue.
 java.lang.Object getGetterValue(java.lang.Object aSupport, boolean isStatic, java.lang.String fieldName, MappingContext aContext)
          Method getGetterValue.
 java.lang.Object getMethodValue(java.lang.Object aSupport, boolean isStatic, java.lang.String aMethodName, java.lang.Object[] paramObjects, java.lang.String[] typeNames, MappingContext aContext)
          Method getMethodValue.
 java.lang.Object getNullElementValue(MappingContext aContext)
          Method getNullElementValue.
 java.lang.Object getPropertyValue(java.lang.Object aValue, MappingContext aContext)
          Method getPropertyValue.
 void leaveContext(MappingContext aContext)
          Method leaveContext.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pW

java.io.PrintWriter pW

fW

java.io.FileWriter fW
Constructor Detail

JavaRuntimeMapper

public JavaRuntimeMapper()
Method Detail

enterContext

public void enterContext(MappingContext aContext)
                  throws KilimException
Description copied from interface: Mapper
Method enterContext. Mappers have access to a shared context that stores a global view of the system. the Kilim infrastructure updates this context according to a stack policy (it is updated every time it invokes the method getValue() or execute()). Method enterContext is a callBack provided by mappers invoked by the Kilim infrastructure when invoking the method getValue() or execute(). This callback exists because the execution of the effective task associated to these methods does not necessarily folow immediately the invocation: they can only be applied on "instanciated" components.and ew getValue() calls and execute() may be recursively introduced by instanciation managers.

Specified by:
enterContext in interface Mapper
Parameters:
aContext - : the mapping context
Throws:
KilimException - : generated by a specific mapper to indicate a (specific problem).
See Also:
This method is empty.

leaveContext

public void leaveContext(MappingContext aContext)
                  throws KilimException
Description copied from interface: Mapper
Method leaveContext. This method is invoked by the Kilim infrastructure when leaving the method getValue() or execute(). This method is invoked just after the execution of the effective task associated to the provider or transformer.

Specified by:
leaveContext in interface Mapper
Parameters:
aContext - : the mapping context.
Throws:
KilimException - : generated by a specific mapper to indicate a (specific problem).
See Also:
This method is empty.

getGetterValue

public java.lang.Object getGetterValue(java.lang.Object aSupport,
                                       boolean isStatic,
                                       java.lang.String fieldName,
                                       MappingContext aContext)
                                throws KilimException
Description copied from interface: Mapper
Method getGetterValue. This method performs the effective task associated to the method getValue() of a getter.

Specified by:
getGetterValue in interface Mapper
Parameters:
aSupport - : the support of the getter
isStatic - : true if the getter is static
fieldName - : the name of the field to be accessed
aContext - : the mapping context
Returns:
Object : the value returned by getValue()
Throws:
KilimException - : generated if aSupport is null, if fieldName is null or if no getter corresponding to the signature exists. Also generated by a specific mapper to indicate a (specific problem).
See Also:
This method returns the value of the field "filedName" of the class (if isStatic is true) or object (if isStatic is false) referenced by aSupport. The KilimException is here a wrapper to all exceptions generated by the java reflexive API when trying to perform the task.

executeSetter

public void executeSetter(java.lang.Object aSupport,
                          boolean isStatic,
                          java.lang.String fieldName,
                          java.lang.Object toBeSet,
                          MappingContext aContext)
                   throws KilimException
Description copied from interface: Mapper
Method executeSetter. This method performs the effective task associated to the method execute() of a getter.

Specified by:
executeSetter in interface Mapper
Parameters:
aSupport - : the support of the getter
isStatic - : true if the getter is static
fieldName - : the name of the field to be accessed
toBeSet - : the value to be set.
aContext - : the mapping context
Throws:
KilimException - : generated if aSupport is null, if fieldName is null or if no getter corresponding to the signature exists. Also generated by a specific mapper to indicate a (specific problem).
See Also:
This method sets a value in the field "filedName" of the class (if isStatic is true) or object (if isStatic is false) referenced by aSupport. The KilimException is here a wrapper to all exceptions generated by the java reflexive API when trying to perform the task.

getMethodValue

public java.lang.Object getMethodValue(java.lang.Object aSupport,
                                       boolean isStatic,
                                       java.lang.String aMethodName,
                                       java.lang.Object[] paramObjects,
                                       java.lang.String[] typeNames,
                                       MappingContext aContext)
                                throws KilimException
Description copied from interface: Mapper
Method getMethodValue. This method performs the effective task associated to the method getValue() of a factory method.

Specified by:
getMethodValue in interface Mapper
Parameters:
aSupport - : the support of the method
isStatic - : true if the method is static
aMethodName - : the name of the method
paramObjects - : the ordered values of the method parameters
typeNames - : the ordered types of the method parameters.
aContext - : the mapping context.
Returns:
Object : the value returned by getValue()
Throws:
KilimException - :generated if aSupport is null, if methodName is null or if no method corresponding to the signature exists. Also generated by a specific mapper to indicate a (specific problem).
See Also:
This method returns the value returned by the execution of the method "methodName" of the class (if isStatic is true) or object (if isStatic is false) referenced by aSupport. The KilimException is here a wrapper to all exceptions generated by the java reflexive API when trying to perform the task.

executeMethod

public void executeMethod(java.lang.Object aSupport,
                          boolean isStatic,
                          java.lang.String aMethodName,
                          java.lang.Object[] paramObjects,
                          java.lang.String[] typeNames,
                          MappingContext aContext)
                   throws KilimException
Description copied from interface: Mapper
Method executeMethod. This method performs the effective task associated to the method execute() of a factory method (used as a transformer).

Specified by:
executeMethod in interface Mapper
Parameters:
aSupport - : the support of the method
isStatic - : true if the method is static
aMethodName - : the name of the method
paramObjects - : the ordered values of the method parameters
typeNames - : the ordered types of the method parameters.
aContext - : the mapping context.
Throws:
KilimException - :generated if aSupport is null, if methodName is null or if no method corresponding to the signature exists. Also generated by a specific mapper to indicate a (specific problem).
See Also:
org.objectweb.kilim.model.mapping.KilimMapper#executeMethod(Object, boolean, String, Object[], String[], MappingContext)

getConstructorValue

public java.lang.Object getConstructorValue(java.lang.Class aClass,
                                            java.lang.Object[] paramObjects,
                                            java.lang.String[] typeNames,
                                            MappingContext aContext)
                                     throws KilimException
Description copied from interface: Mapper
Method getConstructorValue. This method performs the effective task associated to the method getValue() of a constructor.

Specified by:
getConstructorValue in interface Mapper
Parameters:
aClass - : the class for the constructor
paramObjects - : the ordered values of the method parameters
typeNames - : the ordered types of the method parameters.
aContext - : the mapping context.
Returns:
Object : the value returned by getValue().
Throws:
KilimException - :generated if aSupport is null, if methodName is null or if no method corresponding to the signature exists. Also generated by a specific mapper to indicate a (specific problem).
See Also:
org.objectweb.kilim.model.mapping.KilimMapper#getConstructorValue(Class, Object[], String[], MappingContext)

executeConstructor

public void executeConstructor(java.lang.Class aClass,
                               java.lang.Object[] paramObjects,
                               java.lang.String[] typeNames,
                               MappingContext aContext)
                        throws KilimException
Description copied from interface: Mapper
Method executeConstructor. This method performs the effective task associated to the method execute() of a constructor.

Specified by:
executeConstructor in interface Mapper
Parameters:
aClass - : the class for the constructor
paramObjects - : the ordered values of the method parameters
typeNames - : the ordered types of the method parameters.
aContext - : the mapping context.
Throws:
KilimException - :generated if aSupport is null, if methodName is null or if no method corresponding to the signature exists. Also generated by a specific mapper to indicate a (specific problem).
See Also:
org.objectweb.kilim.model.mapping.KilimMapper#executeConstructor(Class, Object[], String[], MappingContext)

getExternalValue

public java.lang.Object getExternalValue(java.lang.Object value,
                                         MappingContext aContext)
Description copied from interface: Mapper
Method getExternalValue. This method performs the effective task associated to the method getValue() of a external value. This method exists since the current implementation does not treat external values as properties. It should probably disappear in the next release.

Specified by:
getExternalValue in interface Mapper
Parameters:
value - : the external reference identifier.
aContext - : the mapping context.
Returns:
Object :the value returned by getValue() : generally a reference to the object designated by the external value.
See Also:
org.objectweb.kilim.model.mapping.KilimMapper#getExternalValue(Object, MappingContext)

getPropertyValue

public java.lang.Object getPropertyValue(java.lang.Object aValue,
                                         MappingContext aContext)
Description copied from interface: Mapper
Method getPropertyValue. This method performs the effective task associated to the method getValue() of a property.

Specified by:
getPropertyValue in interface Mapper
Parameters:
aValue - : the property identifier.
aContext - : the mapping context.
Returns:
Object : the value returned by getValue()
See Also:
org.objectweb.kilim.model.mapping.KilimMapper#getPropertyValue(Object, MappingContext)

getClassValue

public java.lang.Object getClassValue(java.lang.String aClassName,
                                      MappingContext aContext)
                               throws KilimException
Description copied from interface: Mapper
Method getClassSourceValue. This method performs the effective task associated to the method getValue() of a ClassSource.

Specified by:
getClassValue in interface Mapper
Parameters:
aClassName - : the name of the class
aContext - : the mapping context
Returns:
Object : the value returned by getValue() : generally the corresponding Class object.
Throws:
KilimException - : generated if aClassName is null or if no Class object can be found. Also generated by a specific mapper to indicate a (specific problem).
See Also:
org.objectweb.kilim.model.mapping.KilimMapper#getClassValue(String, MappingContext)

getEventSourceValue

public java.lang.Object getEventSourceValue(MappingContext aContext)
                                     throws KilimException
Description copied from interface: Mapper
Method getEventSourceValue.....

Specified by:
getEventSourceValue in interface Mapper
Parameters:
aContext - : the mapping context.
Returns:
Object :
Throws:
KilimException - : generated by a specific mapper to indicate a (specific problem).
See Also:
org.objectweb.kilim.model.mapping.KilimMapper#getEventSourceValue(MappingContext)

getNullElementValue

public java.lang.Object getNullElementValue(MappingContext aContext)
Description copied from interface: Mapper
Method getNullElementValue. This method performs the effective task associated to the method getValue() of a null. This method exists since the current implementation does not treat null as a propertiy (null may be associated to a transformer).

Specified by:
getNullElementValue in interface Mapper
Parameters:
aContext - : the mapping context.
Returns:
Object : the value returned by getValue()
See Also:
org.objectweb.kilim.model.mapping.KilimMapper#getNullElementValue(MappingContext)

executeNullElement

public void executeNullElement(MappingContext aContext)
Description copied from interface: Mapper
Method executeNullElement. This method performs the effective task associated to the method execute() of a null.

Specified by:
executeNullElement in interface Mapper
Parameters:
aContext - : the mapping context
See Also:
org.objectweb.kilim.model.mapping.KilimMapper#executeNullElement(MappingContext)