Package com.google.api.client.xml
Class GenericXml
- java.lang.Object
-
- java.util.AbstractMap<String,Object>
-
- com.google.api.client.util.GenericData
-
- com.google.api.client.xml.GenericXml
-
@Beta public class GenericXml extends GenericData implements Cloneable
Beta
Generic XML data that stores all unknown key name/value pairs.Each data key name maps into the name of the XPath expression value for the XML element, attribute, or text content (using
"text()"
). Subclasses can declare fields for known XML content using theKey
annotation. Each field can be of any visibility (private, package private, protected, or public) and must not be static.null
unknown data key names are not allowed, butnull
data values are allowed.Implementation is not thread-safe. For a thread-safe choice instead use an implementation of
ConcurrentMap
.- Since:
- 1.0
- Author:
- Yaniv Inbar
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.google.api.client.util.GenericData
GenericData.Flags
-
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>
-
-
Field Summary
Fields Modifier and Type Field Description String
name
Optional XML element local name prefixed by its namespace alias -- for example"atom:entry"
-- ornull
if not set.XmlNamespaceDictionary
namespaceDictionary
Optional namespace dictionary ornull
if not set.
-
Constructor Summary
Constructors Constructor Description GenericXml()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GenericXml
clone()
Makes a "deep" clone of the generic data, in which the clone is completely independent of the original.GenericXml
set(String fieldName, Object value)
Sets the given field value (may benull
) for the given field name.String
toString()
-
Methods inherited from class com.google.api.client.util.GenericData
entrySet, get, getClassInfo, getUnknownKeys, put, putAll, remove, setUnknownKeys
-
Methods inherited from class java.util.AbstractMap
clear, containsKey, containsValue, equals, hashCode, isEmpty, keySet, size, values
-
-
-
-
Field Detail
-
name
public String name
Optional XML element local name prefixed by its namespace alias -- for example"atom:entry"
-- ornull
if not set.
-
namespaceDictionary
public XmlNamespaceDictionary namespaceDictionary
Optional namespace dictionary ornull
if not set.
-
-
Method Detail
-
clone
public GenericXml clone()
Description copied from class:GenericData
Makes a "deep" clone of the generic data, in which the clone is completely independent of the original.- Overrides:
clone
in classGenericData
-
toString
public String toString()
- Overrides:
toString
in classAbstractMap<String,Object>
-
set
public GenericXml set(String fieldName, Object value)
Description copied from class:GenericData
Sets the given field value (may benull
) for the given field name. Any existing value for the field will be overwritten. It may be more slightly more efficient thanGenericData.put(String, Object)
because it avoids accessing the field's original value.Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
- Overrides:
set
in classGenericData
-
-