public class AutoMap<T> extends AbstractMap<String,T> implements XBAutoMap<T>, DOMAccess
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
AutoMap(Node baseNode,
InvocationContext invocationContext,
Class<?> valueType) |
Modifier and Type | Method and Description |
---|---|
String |
asString()
This method may be used to get a string representation of the projected document or element.
|
void |
clear()
Removes all elements below the element this map is bound to.
|
boolean |
containsKey(CharSequence path)
Checks existence of value at given xpath.
|
boolean |
containsKey(Object path)
Deprecated.
|
boolean |
containsValue(Object value)
Like map.containsValue, but this map can not store null values.
|
DOMAccess |
create(String path,
Object value)
Create an element or attribute with given path and value.
|
Set<Map.Entry<String,T>> |
entrySet() |
T |
get(CharSequence path)
Use given relative xpath to resolve the value.
|
<E> E |
get(CharSequence path,
Class<E> asType)
Resolve given path and return the result as the given type.
|
T |
get(Object path)
Deprecated.
use get(CharSequence) instead. Key needs to be of CharSequence/String. No sense
in using object in this case.
|
Element |
getDOMBaseElement()
Getter for the "root" element of this projection.
|
Node |
getDOMNode()
Getter for the underlying DOM node holding the data.
|
Document |
getDOMOwnerDocument()
Getter for the XML Document owning the node for this projection.
|
XBAutoList<T> |
getList(CharSequence path)
Use given relative xpath to resolve the value.
|
<E> XBAutoList<E> |
getList(CharSequence path,
Class<E> oType)
Resolve given path and return the result as list of given type.
|
Node |
getNode() |
Class<?> |
getProjectionInterface()
Getter for the projection interface.
|
T |
put(String path,
T value)
Sets the value at the given xpath to a new value.
|
T |
remove(CharSequence xpath)
Remove element at relative location.
|
T |
remove(Object path)
Deprecated.
use remove(CharSequence) instead.
|
clone, equals, hashCode, isEmpty, keySet, putAll, size, toString, values
finalize, getClass, notify, notifyAll, wait, wait, wait
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, isEmpty, keySet, merge, putAll, putIfAbsent, remove, replace, replace, replaceAll, size, values
public AutoMap(Node baseNode, InvocationContext invocationContext, Class<?> valueType)
baseNode
- invocationContext
- valueType
- map value typepublic void clear()
XBAutoMap
@Deprecated public T get(Object path)
public T get(CharSequence path)
public <E> E get(CharSequence path, Class<E> asType)
XBAutoMap
public XBAutoList<T> getList(CharSequence path)
public <E> XBAutoList<E> getList(CharSequence path, Class<E> oType)
XBAutoMap
@Deprecated public boolean containsKey(Object path)
containsKey
in interface Map<String,T>
containsKey
in interface XBAutoMap<T>
containsKey
in class AbstractMap<String,T>
AbstractMap.containsKey(java.lang.Object)
public boolean containsKey(CharSequence path)
containsKey
in interface XBAutoMap<T>
path
- public boolean containsValue(Object value)
containsValue
in interface Map<String,T>
containsValue
in interface XBAutoMap<T>
containsValue
in class AbstractMap<String,T>
value
- AbstractMap.containsValue(java.lang.Object)
public T put(String path, T value)
put
in interface Map<String,T>
put
in interface XBAutoMap<T>
put
in class AbstractMap<String,T>
path
- xpath relative to bound elementvalue
- new value to be setMap.put(java.lang.Object, java.lang.Object)
@Deprecated public T remove(Object path)
remove
in interface Map<String,T>
remove
in class AbstractMap<String,T>
path
- AbstractMap.remove(java.lang.Object)
public T remove(CharSequence xpath)
xpath
- public Node getNode()
public Class<?> getProjectionInterface()
DOMAccess
getProjectionInterface
in interface DOMAccess
DOMAccess.getProjectionInterface()
public Node getDOMNode()
DOMAccess
getDOMNode
in interface DOMAccess
DOMAccess.getDOMNode()
public Document getDOMOwnerDocument()
DOMAccess
getDOMOwnerDocument
in interface DOMAccess
DOMAccess.getDOMOwnerDocument()
public Element getDOMBaseElement()
DOMAccess
getDOMBaseElement
in interface DOMAccess
DOMAccess.getDOMBaseElement()
public String asString()
DOMAccess
asString
in interface DOMAccess
DOMAccess.asString()
public DOMAccess create(String path, Object value)
DOMAccess
create
in interface DOMAccess
path
- value
- DOMAccess.create(java.lang.String, java.lang.Object)
Copyright © 2012-12-21-2022. All Rights Reserved.