Package eu.bandm.tools.util.xml
Class AttributeMap
- All Implemented Interfaces:
Map<NamespaceName,String>
Facade which adds standard behaviour to the SAX attributes implementation.
The access methods allow more convenient and consistent transitions on the
state of the attribute collection. Nevertheless they operate directly on the
"peer object" of type
AttributesImpl.
Standardized "map interface" methods are available which reflect the state of this peer.
A correct map semantics is assumed for the underlying implementing object,
but not checked. So repeated keys are not detected, but ignored in an unspecified way.-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a new facade object for an empty collection of SAX attributes.AttributeMap(AttributeMap map) Constructs a new facade object with the data from the given instance.AttributeMap(Attributes impl) Constructs a new facade object for the given SAX attributes. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringcontentsToString(Attributes attrs) Auxiliary method to print the contents of a SAX Attributes object.entrySet()Deliver a view to the Sax implementation as required by AbstractSet.booleanDirectly delegate to the implementingAttributes.Return the underlying SAX API instance.inthashCode()Directly delegate to the implementingAttributes.put(NamespaceName name, String value) Evidentremove(NamespaceName name) EvidentEvidentMethods inherited from class java.util.AbstractMap
clear, clone, containsKey, containsValue, get, isEmpty, keySet, putAll, size, toString, valuesMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
AttributeMap
Constructs a new facade object for the given SAX attributes. Iff the argument is an instance ofAttributesImpl, then write operations are supported. Otherwise read only. -
AttributeMap
public AttributeMap()Constructs a new facade object for an empty collection of SAX attributes. -
AttributeMap
Constructs a new facade object with the data from the given instance. A new implementing instance is created by callingnew AttributesImpl(Attributes)from the SAX library.
-
-
Method Details
-
equals
Directly delegate to the implementingAttributes.- Specified by:
equalsin interfaceMap<NamespaceName,String> - Overrides:
equalsin classAbstractMap<NamespaceName,String>
-
hashCode
public int hashCode()Directly delegate to the implementingAttributes.- Specified by:
hashCodein interfaceMap<NamespaceName,String> - Overrides:
hashCodein classAbstractMap<NamespaceName,String>
-
getImplementation
Return the underlying SAX API instance. -
entrySet
Deliver a view to the Sax implementation as required by AbstractSet.- Specified by:
entrySetin interfaceMap<NamespaceName,String> - Specified by:
entrySetin classAbstractMap<NamespaceName,String>
-
put
Evident- Specified by:
putin interfaceMap<NamespaceName,String> - Overrides:
putin classAbstractMap<NamespaceName,String>
-
remove
Evident- Specified by:
removein interfaceMap<NamespaceName,String> - Overrides:
removein classAbstractMap<NamespaceName,String>
-
remove
Evident -
contentsToString
Auxiliary method to print the contents of a SAX Attributes object. This is a mere technical device with not "set" semantics: The SAX specification does not forbid that these are de-normalized and do not represent a valid XML data model.
-