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 ChainedAttributeHandler

    java.lang.Object
      oracle.ifs.fdk.impl.ah.ChainedAttributeHandler

All Implemented Interfaces:
  AttributeHandler

    public class ChainedAttributeHandler

extends java.lang.Object
implements AttributeHandler

This special attribute handler allows chaining of multiple attribute handlers so that the final attribute from a tree of objects can be read or set.

Constructor Summary
`ChainedAttributeHandler(java.lang.String reposAttrName, AttributeHandler handler)` Constructor.

Method Summary
`boolean` | `canHandle(AttributeHandlerContext context)` Returns `true` if this handler can handle the attribute request on the given object instance.
`boolean` | `canUpdate(AttributeHandlerContext context)` Returns `true` if this handler can update the attribute, `false` if the attribute is not updateable.
`java.lang.Object` | `getValue(AttributeHandlerContext context)` Returns the value of an attribute.
`AttributeUpdater` | `setValue(AttributeHandlerContext context, java.lang.Object value)` Updates the attribute with the given value.

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

Constructor Detail

### ChainedAttributeHandler

    public ChainedAttributeHandler(java.lang.String reposAttrName,
                                   AttributeHandler handler)

  Constructor.

  Parameters:
    `reposAttrName` - The attribute to pull from the underlying handler.
    `handler` - The underlying attribute handler.

Method Detail

### canHandle

    public boolean canHandle(AttributeHandlerContext context)
                      throws FdkException,
                             IfsException

  Description copied from interface: `AttributeHandler`
  Returns `true` if this handler can handle the attribute request on the given object instance. The necessary information to determine which attribute is requested and what the underlying repository object is will be packaged in the context.

  Specified by:
    `canHandle` in interface `AttributeHandler`
  Parameters:
    `context` - The context when this handler is called.
  Throws:
    `FdkException` - If a framework error occurs.
    `IfsException` - If a repository exception occurs.

### canUpdate

    public boolean canUpdate(AttributeHandlerContext context)
                      throws FdkException,
                             IfsException

  Description copied from interface: `AttributeHandler`
  Returns `true` if this handler can update the attribute, `false` if the attribute is not updateable. The necessary information to determine which attribute is requested and what the underlying repository object is will be packaged in the context.

  Specified by:
    `canUpdate` in interface `AttributeHandler`
  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 interface: `AttributeHandler`
  Returns the value of an attribute. This method must throw a `RuntimeException` if `canHandle()` returns `false` and this method is still being called.

  Note that implementations which handle read-only attributes should subclass `ReadOnlyAttributeHandler` for convenience as they would need to provide the read side methods only.

  Specified by:
    `getValue` in interface `AttributeHandler`
  Parameters:
    `context` - The context when this handler is called.
  Throws:
    `FdkException` - If a framework error occurs.
    `IfsException` - If a repository exception occurs.

### setValue

    public AttributeUpdater setValue(AttributeHandlerContext context,
                                     java.lang.Object value)
                              throws FdkException,
                                     IfsException

  Description copied from interface: `AttributeHandler`
  Updates the attribute with the given value. This method must throw a `RuntimeException` if `canUpdate()` returns `false` and this method is still being called.

  An implementation of this method has two choices:

  1. If the update would result in a simple repository attribute update it must return an `AttributeUpdater` object filled in with the repositoy object to update, the name of the attribute and the value of the attribute (which may be a derived value from the value passed in). The driving code that invokes it will then do the actual update in an optimized way.
  2. The implementation may decide under special circumstances that it needs to do the update itself (because the logic is too complicated for the driving code to implement and it is a special case). In that case the return value must be `null` in order to notify the caller the update was executed.

  Specified by:
    `setValue` in interface `AttributeHandler`
  Parameters:
    `context` - The context when this handler is called.
    `value` - The value to set the attribute to.
  Throws:
    `FdkException` - If a framework error occurs.
    `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