public class ChainedAttributeHandler extends Object implements AttributeHandler
Constructor and Description |
---|
ChainedAttributeHandler(String reposAttrName,
AttributeHandler handler)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
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. |
Object |
getValue(AttributeHandlerContext context)
Returns the value of an attribute.
|
AttributeUpdater |
setValue(AttributeHandlerContext context,
Object value)
Updates the attribute with the given value.
|
public ChainedAttributeHandler(String reposAttrName, AttributeHandler handler)
reposAttrName
- The attribute to pull from the underlying handler.handler
- The underlying attribute handler.public boolean canHandle(AttributeHandlerContext context) throws FdkException, IfsException
AttributeHandler
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.canHandle
in interface AttributeHandler
context
- The context when this handler is called.FdkException
- If a framework error occurs.IfsException
- If a repository exception occurs.public boolean canUpdate(AttributeHandlerContext context) throws FdkException, IfsException
AttributeHandler
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.canUpdate
in interface AttributeHandler
context
- The context when this handler is called.FdkException
- If a framework error occurs.IfsException
- If a repository exception occurs.public Object getValue(AttributeHandlerContext context) throws FdkException, IfsException
AttributeHandler
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.
getValue
in interface AttributeHandler
context
- The context when this handler is called.FdkException
- If a framework error occurs.IfsException
- If a repository exception occurs.public AttributeUpdater setValue(AttributeHandlerContext context, Object value) throws FdkException, IfsException
AttributeHandler
RuntimeException
if canUpdate()
returns
false
and this method is still being called.
An implementation of this method has two choices:
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.
null
in order to notify
the caller the update was executed.
setValue
in interface AttributeHandler
context
- The context when this handler is called.value
- The value to set the attribute to.FdkException
- If a framework error occurs.IfsException
- If a repository exception occurs.Copyright © 2023. All rights reserved.