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 ChainedMethodAttributeHandler

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

All Implemented Interfaces:
  AttributeHandler

    public class ChainedMethodAttributeHandler

extends ReadOnlyAttributeHandler

AttributeHandler for synthetic attributes whose values are retrieved by invoking a method on the repos object returned by the underlying attribute handler.

Constructor Summary
`ChainedMethodAttributeHandler(java.lang.Class objectClass, java.lang.String methodName, AttributeHandler handler, java.lang.Class passObjectClass, java.lang.Class[] allowedClasses)` Creates a new ChainedMethodAttributeHandler for a method that does not take any parameters, except possibly the underlying repos object.
`ChainedMethodAttributeHandler(java.lang.Class objectClass, java.lang.String methodName, AttributeHandler handler, int objectParamIndex, java.lang.Class[] parameterTypes, java.lang.Object[] parameters, java.lang.Class[] allowedClasses)` Creates a new ChainedMethodAttributeHandler.
`ChainedMethodAttributeHandler(java.lang.Class objectClass, java.lang.String methodName, AttributeHandler handler, int objectParamIndex, java.lang.Class passObjectClass, java.lang.Object[] parameters, java.lang.Class[] allowedClasses)` Creates a new ChainedMethodAttributeHandler.

Method Summary
`boolean` | `canHandle(AttributeHandlerContext context)` Returns true if the repos object returned by the underlying attribute handler is an instance of the given objectClass 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`

Constructor Detail

### ChainedMethodAttributeHandler

    public ChainedMethodAttributeHandler(java.lang.Class objectClass,
                                         java.lang.String methodName,
                                         AttributeHandler handler,
                                         java.lang.Class passObjectClass,
                                         java.lang.Class[] allowedClasses)
                                  throws java.lang.NoSuchMethodException

  Creates a new ChainedMethodAttributeHandler for a method that does not take any parameters, except possibly the underlying repos object.

  Parameters:
    `objectClass` - the class where the method is defined.
    `methodName` - the name of the method to invoke.
    `handler` - the underlying attribute handler, which must return an object whose class is that of objectClass
    `passObjectClass` - if the underlying repos object is to be passed as a single attribute, the class of the underlying object. Example: whether a DirectoryUser is a content manager is determined by calling Domain.getContentManagerGroup.isUser(member) -- it takes the underlying object, namely the DU, as a single argument. Thus the arugment would be DirectoryObject.class. If the underlying object is not passed as an argument, specify 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.

### ChainedMethodAttributeHandler

    public ChainedMethodAttributeHandler(java.lang.Class objectClass,
                                         java.lang.String methodName,
                                         AttributeHandler handler,
                                         int objectParamIndex,
                                         java.lang.Class passObjectClass,
                                         java.lang.Object[] parameters,
                                         java.lang.Class[] allowedClasses)
                                  throws java.lang.NoSuchMethodException

  Creates a new ChainedMethodAttributeHandler. 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.
    `handler` - the underlying attribute handler, which must return an object whose class is that of objectClass
    `objectParamIndex` - whether to pass the underlying repos object as a parameter, and which java-indexed parameter it should be. Example: methodName(arg, arg, item, arg) would take 2 for this argument. Use -1 if the object should not be passed.
    `passObjectClass` - the class of the underlying repos object.
    `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.

### ChainedMethodAttributeHandler

    public ChainedMethodAttributeHandler(java.lang.Class objectClass,
                                         java.lang.String methodName,
                                         AttributeHandler handler,
                                         int objectParamIndex,
                                         java.lang.Class[] parameterTypes,
                                         java.lang.Object[] parameters,
                                         java.lang.Class[] allowedClasses)
                                  throws java.lang.NoSuchMethodException

  Creates a new ChainedMethodAttributeHandler.

  Parameters:
    `objectClass` - the class where the method is defined.
    `methodName` - the name of the method to invoke.
    `handler` - the underlying attribute handler, which must return an object whose class is that of objectClass
    `objectParamIndex` - whether to pass the underlying repos object as a parameter, and which java-indexed parameter it should be. Example: methodName(arg, arg, item, arg) would take 2 for this argument. Use -1 if the object should not be passed.
    `parameterTypes` - the parameter types of the method to invoke. The index matching objectParamIndex should, of course, be the class of the underlying object.
    `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.

Method Detail

### canHandle

    public boolean canHandle(AttributeHandlerContext context)
                      throws FdkException,
                             IfsException

  Description copied from class: `ChainedMethodAttributeHandler`
  Returns true if the repos object returned by the underlying attribute handler is an instance of the given objectClass constructor parameter.

  Parameters:
    `context` - The context when this handler is called.
  Throws:
    `FdkException` - If a framework error occurs.
    `IfsException` - If a repository exception occurs.

### getValue

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

  Description copied from class: `ChainedMethodAttributeHandler`
  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.
    `IfsException` - If a repository exception occurs.

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