Package eu.bandm.tools.util
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 extends Object,
V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Constructor Summary
ConstructorDescriptionConstructs 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 String
contentsToString
(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.boolean
Directly delegate to the implementingAttributes
.Return the underlying SAX API instance.int
hashCode()
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, values
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods 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:
equals
in interfaceMap<NamespaceName,
String> - Overrides:
equals
in classAbstractMap<NamespaceName,
String>
-
hashCode
public int hashCode()Directly delegate to the implementingAttributes
.- Specified by:
hashCode
in interfaceMap<NamespaceName,
String> - Overrides:
hashCode
in classAbstractMap<NamespaceName,
String>
-
getImplementation
Return the underlying SAX API instance. -
entrySet
Deliver a view to the Sax implementation as required by AbstractSet.- Specified by:
entrySet
in interfaceMap<NamespaceName,
String> - Specified by:
entrySet
in classAbstractMap<NamespaceName,
String>
-
put
Evident- Specified by:
put
in interfaceMap<NamespaceName,
String> - Overrides:
put
in classAbstractMap<NamespaceName,
String>
-
remove
Evident- Specified by:
remove
in interfaceMap<NamespaceName,
String> - Overrides:
remove
in 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.
-