org.glassfish.grizzly.attributes
Class NamedAttributeHolder

java.lang.Object
  extended by org.glassfish.grizzly.attributes.NamedAttributeHolder
All Implemented Interfaces:
AttributeHolder

public class NamedAttributeHolder
extends java.lang.Object
implements AttributeHolder

AttributeHolder implementation, which doesn't support indexed access to Attributes.

Author:
Alexey Stashok
See Also:
AttributeHolder, IndexedAttributeHolder

Field Summary
protected  DefaultAttributeBuilder attributeBuilder
           
protected  java.util.Map<java.lang.String,java.lang.Object> attributesMap
           
 
Constructor Summary
NamedAttributeHolder(AttributeBuilder attributeBuilder)
           
 
Method Summary
 void clear()
          Clear all the attributes.
 java.lang.Object getAttribute(java.lang.String name)
          Return an object based on a name.
 AttributeBuilder getAttributeBuilder()
          Get AttributeBuilder, associated with this holder
 java.util.Set<java.lang.String> getAttributeNames()
          Return a Set of attribute names.
 IndexedAttributeAccessor getIndexedAttributeAccessor()
          Always returns null, as NamedAttributeHolder doesn't support indexing.
 void recycle()
          Recycle AttributeHolder
 java.lang.Object removeAttribute(java.lang.String name)
          Remove a name/value object.
 void setAttribute(java.lang.String name, java.lang.Object value)
          Set a name/value object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

attributesMap

protected final java.util.Map<java.lang.String,java.lang.Object> attributesMap

attributeBuilder

protected final DefaultAttributeBuilder attributeBuilder
Constructor Detail

NamedAttributeHolder

public NamedAttributeHolder(AttributeBuilder attributeBuilder)
Method Detail

getAttribute

public java.lang.Object getAttribute(java.lang.String name)
Return an object based on a name.

Specified by:
getAttribute in interface AttributeHolder
Parameters:
name - - name of an attribute
Returns:
- attribute value for the name, null if name does not exist in attributes

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.Object value)
Set a name/value object.

Specified by:
setAttribute in interface AttributeHolder
Parameters:
name - - name of an attribute
value - - value of named attribute

removeAttribute

public java.lang.Object removeAttribute(java.lang.String name)
Remove a name/value object.

Specified by:
removeAttribute in interface AttributeHolder
Parameters:
name - - name of an attribute
Returns:
attribute which has been removed

getAttributeNames

public java.util.Set<java.lang.String> getAttributeNames()
Return a Set of attribute names.

Specified by:
getAttributeNames in interface AttributeHolder
Returns:
- Set of attribute names

recycle

public void recycle()
Recycle AttributeHolder

Specified by:
recycle in interface AttributeHolder

clear

public void clear()
Clear all the attributes.

Specified by:
clear in interface AttributeHolder

getAttributeBuilder

public AttributeBuilder getAttributeBuilder()
Get AttributeBuilder, associated with this holder

Specified by:
getAttributeBuilder in interface AttributeHolder
Returns:
AttributeBuilder

getIndexedAttributeAccessor

public IndexedAttributeAccessor getIndexedAttributeAccessor()
Always returns null, as NamedAttributeHolder doesn't support indexing.

Specified by:
getIndexedAttributeAccessor in interface AttributeHolder
Returns:
null


Copyright © 2011 Oracle Corpration. All Rights Reserved.