public class MappedValueAttributeHandler extends ReadOnlyAttributeHandler
Constructor and Description |
---|
MappedValueAttributeHandler(AttributeHandler ah,
Map valueMap)
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. |
Object |
getValue(AttributeHandlerContext context)
Returns the value of an attribute.
|
canUpdate, setValue
public MappedValueAttributeHandler(AttributeHandler ah, Map valueMap)
ah
- The attribute handler whose values are to be mapped.valueMap
- The map of values to be mapped. All possible values
that the wrapepd attribute handler can return need to
be in the map otherwise null
will be
returned for the non-existent values.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.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.
context
- The context when this handler is called.FdkException
- If a framework error occurs.IfsException
- If a repository exception occurs.Copyright © 2023. All rights reserved.