Package org.simpleframework.xml.core
Class Function
- java.lang.Object
-
- org.simpleframework.xml.core.Function
-
class Function extends java.lang.Object
TheFunction
object is used to encapsulated the method that is called when serializing an object. This contains details on the type of method represented and ensures that reflection is not required each time the method is to be invoked.
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
contextual
This is used to determine if the method takes the map.private java.lang.reflect.Method
method
This is the method that is to be invoked by the function.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Object
call(Context context, java.lang.Object source)
This method used to invoke the callback method of the provided object.
-
-
-
Constructor Detail
-
Function
public Function(java.lang.reflect.Method method)
Constructor for theFunction
object. This is used to create an object that wraps the provided method it ensures that no reflection is required when the method is to be called.- Parameters:
method
- this is the method that is to be wrapped by this
-
Function
public Function(java.lang.reflect.Method method, boolean contextual)
Constructor for theFunction
object. This is used to create an object that wraps the provided method it ensures that no reflection is required when the method is to be called.- Parameters:
method
- this is the method that is to be wrapped by thiscontextual
- determines if the method is a contextual one
-
-
Method Detail
-
call
public java.lang.Object call(Context context, java.lang.Object source) throws java.lang.Exception
This method used to invoke the callback method of the provided object. This will acquire the session map from the context. If the provided object is not null then this will return null.- Parameters:
context
- this is the context that contains the sessionsource
- this is the object to invoke the function on- Returns:
- this returns the result of the method invocation
- Throws:
java.lang.Exception
-
-