Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.ifs.fdk.impl.ah
Class MethodAttributeHandler

    java.lang.Object
      oracle.ifs.fdk.impl.ah.ReadOnlyAttributeHandler
          oracle.ifs.fdk.impl.ah.MethodAttributeHandler

All Implemented Interfaces:
  AttributeHandler

Direct Known Subclasses:
  LocalizerAttributeHandler

    public class MethodAttributeHandler

extends ReadOnlyAttributeHandler

AttributeHandler for synthetic attributes whose values are retrieved by invoking a method on the context object.

Field Summary
`protected java.lang.Class[]` | `m_AllowedClasses`
`protected java.lang.Class` | `m_Class`
`protected java.lang.reflect.Method` | `m_Method`
`protected java.lang.Object[]` | `m_Parameters`

Constructor Summary
`MethodAttributeHandler(java.lang.Class objectClass, java.lang.String methodName)` Creates a new MethodAttributeHandler for a method that does not require any parameters.
`MethodAttributeHandler(java.lang.Class objectClass, java.lang.String methodName, java.lang.Class[] parameterTypes, java.lang.Object[] parameters, java.lang.Class[] allowedClasses)` Creates a new MethodAttributeHandler.
`MethodAttributeHandler(java.lang.Class objectClass, java.lang.String methodName, java.lang.Object[] parameters)` Creates a new MethodAttributeHandler.
`MethodAttributeHandler(java.lang.Class objectClass, java.lang.String methodName, java.lang.Object[] parameters, java.lang.Class[] allowedClasses)` Creates a new MethodAttributeHandler.

Method Summary
`boolean` | `canHandle(AttributeHandlerContext context)` Returns true if the underlying repos object is an instance of the given objectClass constructor parameter, or one of the classes in the given allowedClases array constructor parameter.
`java.lang.Object` | `getValue(AttributeHandlerContext context)` Returns the value returned by the method registered for use by this instance.

Methods inherited from class oracle.ifs.fdk.impl.ah.ReadOnlyAttributeHandler
`canUpdate, setValue`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### m_Class

    protected java.lang.Class m_Class

### m_Method

    protected java.lang.reflect.Method m_Method

### m_Parameters

    protected java.lang.Object[] m_Parameters

### m_AllowedClasses

    protected java.lang.Class[] m_AllowedClasses

Constructor Detail

### MethodAttributeHandler

    public MethodAttributeHandler(java.lang.Class objectClass,
                                  java.lang.String methodName)
                           throws java.lang.NoSuchMethodException

  Creates a new MethodAttributeHandler for a method that does not require any parameters.

  Parameters:
    `objectClass` - the class where the method is defined.
    `methodName` - the name of the method to invoke.
  Throws:
    `java.lang.NoSuchMethodException` - if the given method does not exist.

### MethodAttributeHandler

    public MethodAttributeHandler(java.lang.Class objectClass,
                                  java.lang.String methodName,
                                  java.lang.Object[] parameters)
                           throws java.lang.NoSuchMethodException

  Creates a new MethodAttributeHandler.

  Parameters:
    `objectClass` - the class where the method is defined.
    `methodName` - the name of the method to invoke.
    `parameters` - parameters to pass to the method, or null.
  Throws:
    `java.lang.NoSuchMethodException` - if the given method does not exist.

### MethodAttributeHandler

    public MethodAttributeHandler(java.lang.Class objectClass,
                                  java.lang.String methodName,
                                  java.lang.Object[] parameters,
                                  java.lang.Class[] allowedClasses)
                           throws java.lang.NoSuchMethodException

  Creates a new MethodAttributeHandler. Infers the parameterTypes of the method to invoke from the given parameters. This won't work for primitive types.

  Parameters:
    `objectClass` - the class where the method is defined.
    `methodName` - the name of the method to invoke.
    `parameters` - parameters to pass to the method, or null.
    `allowedClasses` - classes allowed to use this AttributeHandler; this parameter allows clients to further restrict this AttributeHandler beyond the objectClass paramter. This parameter may be null, in which case only the objectClass is used to restrict the use of this AttributeHandler.
  Throws:
    `java.lang.NoSuchMethodException` - if the given method does not exist.
    `java.lang.IllegalArgumentException` - if the allowedClasses parameter is non-null, has a length greater than 0, and at least one of its Class elements is not assignable from the objectClass parameter.

### MethodAttributeHandler

    public MethodAttributeHandler(java.lang.Class objectClass,
                                  java.lang.String methodName,
                                  java.lang.Class[] parameterTypes,
                                  java.lang.Object[] parameters,
                                  java.lang.Class[] allowedClasses)
                           throws java.lang.NoSuchMethodException

  Creates a new MethodAttributeHandler.

  Parameters:
    `objectClass` - the class where the method is defined.
    `methodName` - the name of the method to invoke.
    `parameterTypes` - the parameter types of the method to invoke.
    `parameters` - parameters to pass to the method, or null.
    `allowedClasses` - classes allowed to use this AttributeHandler; this parameter allows clients to further restrict this AttributeHandler beyond the objectClass paramter. This parameter may be null, in which case only the objectClass is used to restrict the use of this AttributeHandler.
  Throws:
    `java.lang.NoSuchMethodException` - if the given method does not exist.
    `java.lang.IllegalArgumentException` - if the allowedClasses parameter is non-null, has a length greater than 0, and at least one of its Class elements is not assignable from the objectClass parameter.

Method Detail

### canHandle

    public boolean canHandle(AttributeHandlerContext context)

  Description copied from class: `MethodAttributeHandler`
  Returns true if the underlying repos object is an instance of the given objectClass constructor parameter, or one of the classes in the given allowedClases array constructor parameter.

  Parameters:
    `context` - The context when this handler is called.

### getValue

    public java.lang.Object getValue(AttributeHandlerContext context)
                              throws FdkException

  Description copied from class: `MethodAttributeHandler`
  Returns the value returned by the method registered for use by this instance.

  Parameters:
    `context` - The context when this handler is called.
  Returns:
    the return value of invoking the registered method.
  Throws:
    `FdkException` - if the operation fails.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD