org.apache.myfaces.extensions.cdi.core.api.config
Interface AttributeAware

All Superinterfaces:
Serializable
All Known Subinterfaces:
WindowContext
All Known Implementing Classes:
AbstractAttributeAware, CodiCoreConfig, ConversationConfig, WindowContextConfig

public interface AttributeAware
extends Serializable

This interface is just for internal use. It should ensure that refactorings don't lead to different method-names for the same purpose. Furthermore, it allows to easily find all artifacts which allow generic attributes.

Author:
Gerhard Petracek

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
 boolean setAttribute(String name, Object value)
          Sets an attribute
 boolean setAttribute(String name, Object value, boolean forceOverride)
          Sets or updates an attribute
 

Method Detail

setAttribute

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

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

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

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

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

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

getAttribute

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

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


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