Class Function

java.lang.Object
org.simpleframework.xml.core.Function

class Function extends Object
The Function 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 final boolean
    This is used to determine if the method takes the map.
    private final Method
    This is the method that is to be invoked by the function.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Function(Method method)
    Constructor for the Function object.
    Function(Method method, boolean contextual)
    Constructor for the Function object.
  • Method Summary

    Modifier and Type
    Method
    Description
    call(Context context, Object source)
    This method used to invoke the callback method of the provided object.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • method

      private final Method method
      This is the method that is to be invoked by the function.
    • contextual

      private final boolean contextual
      This is used to determine if the method takes the map.
  • Constructor Details

    • Function

      public Function(Method method)
      Constructor for the Function 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(Method method, boolean contextual)
      Constructor for the Function 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
      contextual - determines if the method is a contextual one
  • Method Details

    • call

      public Object call(Context context, Object source) throws 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 session
      source - this is the object to invoke the function on
      Returns:
      this returns the result of the method invocation
      Throws:
      Exception