public interface AttributeHandler
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.
|
boolean canHandle(AttributeHandlerContext context) throws FdkException, IfsException
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.context
- The context when this handler is called.FdkException
- If a framework error occurs.IfsException
- If a repository exception occurs.boolean canUpdate(AttributeHandlerContext context) throws FdkException, IfsException
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.context
- The context when this handler is called.FdkException
- If a framework error occurs.IfsException
- If a repository exception occurs.Object getValue(AttributeHandlerContext context) throws FdkException, IfsException
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.
context
- The context when this handler is called.FdkException
- If a framework error occurs.IfsException
- If a repository exception occurs.RuntimeException
- If canHandle()
returns
false
and this method is still
being called.AttributeUpdater setValue(AttributeHandlerContext context, Object value) throws FdkException, IfsException
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.
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.RuntimeException
- If canUpdate()
returns
false
and this method is still
being called.Copyright © 2023. All rights reserved.