org.apache.myfaces.extensions.cdi.core.api.config
Class AbstractAttributeAware

java.lang.Object
  extended by org.apache.myfaces.extensions.cdi.core.api.config.AbstractAttributeAware
All Implemented Interfaces:
Serializable, AttributeAware
Direct Known Subclasses:
CodiCoreConfig, ConversationConfig, WindowContextConfig

public abstract class AbstractAttributeAware
extends Object
implements AttributeAware

Base implementation which implements AttributeAware to support custom attributes.

See Also:
Serialized Form

Constructor Summary
AbstractAttributeAware()
           
 
Method Summary
 boolean containsAttribute(String name)
          Returns true if there is a value for the given name
<T> T
getAttribute(String name, Class<T> targetType)
          Exposes the value for the given name
protected  void initConfig()
           
 boolean setAttribute(String name, Object value)
          Sets an attribute
 boolean setAttribute(String name, Object value, boolean forceOverride)
          Sets or updates an attribute
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractAttributeAware

public AbstractAttributeAware()
Method Detail

setAttribute

public boolean setAttribute(String name,
                            Object value)
Sets an attribute

Specified by:
setAttribute in interface AttributeAware
Parameters:
name - name of the attribute
value - value of the attribute (null values aren't allowed)
Returns:
true if it was possible to set the value

setAttribute

public boolean setAttribute(String name,
                            Object value,
                            boolean forceOverride)
Sets or updates an attribute

Specified by:
setAttribute in interface AttributeAware
Parameters:
name - name of the attribute
value - value of the attribute
forceOverride - flag which indicates if it is permitted to override an existing value
Returns:
true if it was possible to set the value

containsAttribute

public boolean containsAttribute(String name)
Returns true if there is a value for the given name

Specified by:
containsAttribute in interface AttributeAware
Parameters:
name - name of the argument in question
Returns:
true if there is a value for the given name, false otherwise

getAttribute

public <T> T getAttribute(String name,
                          Class<T> targetType)
Exposes the value for the given name

Specified by:
getAttribute in interface AttributeAware
Type Parameters:
T - current type
Parameters:
name - name of the attribute
targetType - type of the attribute
Returns:
value of the attribute, or null if there is no attribute with the given name

initConfig

protected void initConfig()


Copyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.