org.opensaml.xml.util
Class AttributeMap

java.lang.Object
  extended by org.opensaml.xml.util.AttributeMap
All Implemented Interfaces:
java.util.Map<javax.xml.namespace.QName,java.lang.String>

@NotThreadSafe
public class AttributeMap
extends java.lang.Object
implements java.util.Map<javax.xml.namespace.QName,java.lang.String>

A map of attribute names and attribute values that invalidates the DOM of the attribute owning XMLObject when the attributes change. Note:


Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Constructor Summary
AttributeMap(XMLObject newOwner)
          Constructor.
 
Method Summary
 void clear()
          
 boolean containsKey(java.lang.Object key)
          
 boolean containsValue(java.lang.Object value)
          
 void deregisterID(javax.xml.namespace.QName attributeName)
          Deregister an attribute as having a type of ID.
 void deregisterQNameAttribute(javax.xml.namespace.QName attributeName)
          Deregister an attribute as having a type of QName.
 java.util.Set<java.util.Map.Entry<javax.xml.namespace.QName,java.lang.String>> entrySet()
          Returns the set of entries.
 java.lang.String get(java.lang.Object key)
          
 boolean isEmpty()
          
 boolean isIDAttribute(javax.xml.namespace.QName attributeName)
          Check whether a given attribute is locally registered as having an ID type within this AttributeMap instance.
 boolean isInferQNameValues()
          Get the flag indicating whether an attempt should be made to infer QName values, if attribute is not registered via a configuration as a QName type.
 boolean isQNameAttribute(javax.xml.namespace.QName attributeName)
          Check whether a given attribute is known to have a QName type.
 java.util.Set<javax.xml.namespace.QName> keySet()
          Returns the set of keys.
 javax.xml.namespace.QName put(javax.xml.namespace.QName attributeName, javax.xml.namespace.QName value)
          Set an attribute value as a QName.
 java.lang.String put(javax.xml.namespace.QName attributeName, java.lang.String value)
          
 void putAll(java.util.Map<? extends javax.xml.namespace.QName,? extends java.lang.String> t)
          
 void registerID(javax.xml.namespace.QName attributeName)
          Register an attribute as having a type of ID.
 void registerQNameAttribute(javax.xml.namespace.QName attributeName)
          Register an attribute as having a type of QName.
 java.lang.String remove(java.lang.Object key)
          
 void setInferQNameValues(boolean flag)
          Set the flag indicating whether an attempt should be made to infer QName values, if attribute is not registered via a configuration as a QName type.
 int size()
          
 java.util.Collection<java.lang.String> values()
          Returns the values in this map.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

AttributeMap

public AttributeMap(XMLObject newOwner)
             throws java.lang.NullPointerException
Constructor.

Parameters:
newOwner - the XMLObject that owns these attributes
Throws:
java.lang.NullPointerException - thrown if the given XMLObject is null
Method Detail

put

public java.lang.String put(javax.xml.namespace.QName attributeName,
                            java.lang.String value)

Specified by:
put in interface java.util.Map<javax.xml.namespace.QName,java.lang.String>

put

public javax.xml.namespace.QName put(javax.xml.namespace.QName attributeName,
                                     javax.xml.namespace.QName value)
Set an attribute value as a QName. This method takes care of properly registering and deregistering the namespace information associated with the new QName being added, and with the old QName being possibly removed.

Parameters:
attributeName - the attribute name
value - the QName attribute value
Returns:
the old attribute value, possibly null

clear

public void clear()

Specified by:
clear in interface java.util.Map<javax.xml.namespace.QName,java.lang.String>

keySet

public java.util.Set<javax.xml.namespace.QName> keySet()
Returns the set of keys.

Specified by:
keySet in interface java.util.Map<javax.xml.namespace.QName,java.lang.String>
Returns:
unmodifiable set of keys

size

public int size()

Specified by:
size in interface java.util.Map<javax.xml.namespace.QName,java.lang.String>

isEmpty

public boolean isEmpty()

Specified by:
isEmpty in interface java.util.Map<javax.xml.namespace.QName,java.lang.String>

containsKey

public boolean containsKey(java.lang.Object key)

Specified by:
containsKey in interface java.util.Map<javax.xml.namespace.QName,java.lang.String>

containsValue

public boolean containsValue(java.lang.Object value)

Specified by:
containsValue in interface java.util.Map<javax.xml.namespace.QName,java.lang.String>

get

public java.lang.String get(java.lang.Object key)

Specified by:
get in interface java.util.Map<javax.xml.namespace.QName,java.lang.String>

remove

public java.lang.String remove(java.lang.Object key)

Specified by:
remove in interface java.util.Map<javax.xml.namespace.QName,java.lang.String>

putAll

public void putAll(java.util.Map<? extends javax.xml.namespace.QName,? extends java.lang.String> t)

Specified by:
putAll in interface java.util.Map<javax.xml.namespace.QName,java.lang.String>

values

public java.util.Collection<java.lang.String> values()
Returns the values in this map.

Specified by:
values in interface java.util.Map<javax.xml.namespace.QName,java.lang.String>
Returns:
an unmodifiable collection of values

entrySet

public java.util.Set<java.util.Map.Entry<javax.xml.namespace.QName,java.lang.String>> entrySet()
Returns the set of entries.

Specified by:
entrySet in interface java.util.Map<javax.xml.namespace.QName,java.lang.String>
Returns:
unmodifiable set of entries

registerID

public void registerID(javax.xml.namespace.QName attributeName)
Register an attribute as having a type of ID.

Parameters:
attributeName - the QName of the ID attribute to be registered

deregisterID

public void deregisterID(javax.xml.namespace.QName attributeName)
Deregister an attribute as having a type of ID.

Parameters:
attributeName - the QName of the ID attribute to be de-registered

isIDAttribute

public boolean isIDAttribute(javax.xml.namespace.QName attributeName)
Check whether a given attribute is locally registered as having an ID type within this AttributeMap instance.

Parameters:
attributeName - the QName of the attribute to be checked for ID type.
Returns:
true if attribute is registered as having an ID type.

registerQNameAttribute

public void registerQNameAttribute(javax.xml.namespace.QName attributeName)
Register an attribute as having a type of QName.

Parameters:
attributeName - the name of the QName-valued attribute to be registered

deregisterQNameAttribute

public void deregisterQNameAttribute(javax.xml.namespace.QName attributeName)
Deregister an attribute as having a type of QName.

Parameters:
attributeName - the name of the QName-valued attribute to be registered

isQNameAttribute

public boolean isQNameAttribute(javax.xml.namespace.QName attributeName)
Check whether a given attribute is known to have a QName type.

Parameters:
attributeName - the QName of the attribute to be checked for QName type.
Returns:
true if attribute is registered as having an QName type.

isInferQNameValues

public boolean isInferQNameValues()
Get the flag indicating whether an attempt should be made to infer QName values, if attribute is not registered via a configuration as a QName type. Default is false.

Returns:
true if QName types should be inferred, false if not

setInferQNameValues

public void setInferQNameValues(boolean flag)
Set the flag indicating whether an attempt should be made to infer QName values, if attribute is not registered via a configuration as a QName type. Default is false.

Parameters:
flag - true if QName types should be inferred, false if not


Copyright © 2006-2011 Internet2. All Rights Reserved.