public class XmlObject extends Object implements XMLizable
Constructor and Description |
---|
XmlObject() |
XmlObject(QName name) |
XmlObject(QName name,
Object value) |
Modifier and Type | Method and Description |
---|---|
XmlObject |
addField(String name,
Object value) |
XMLizable |
asTyped()
Because we create complex types as subclasses of XMLizable instead of
XmlObject (and we don't want to change interfaces), this method will
return this as the complex type subclass of XMLizable, if this represents
a complex type.
|
protected void |
cloneFrom(XmlObject source) |
Iterator<XmlObject> |
evaluate(String xpath)
evaluate the given xpath like expression.
|
XmlObject |
getChild(String name) |
Iterator<XmlObject> |
getChildren() |
Iterator<XmlObject> |
getChildren(String name) |
Object |
getField(String name) |
QName |
getName() |
Iterator<XMLizable> |
getTypedChildren()
Similar to
asTyped() , this will return this object's children
as the proper complex type subclass of XMLizable, if they are complex
types. |
Object |
getValue() |
QName |
getXmlType() |
boolean |
hasChildren() |
void |
load(XmlInputStream in,
TypeMapper typeMapper)
load the fileds/children from the specified xml stream
|
protected void |
loadAfterStartTag(XmlInputStream in,
TypeMapper typeMapper) |
protected void |
loadStartTag(XmlInputStream in,
TypeMapper typeMapper) |
boolean |
removeField(String name) |
void |
setDefaultNamespace(String namespace) |
XmlObject |
setField(String name,
Object value) |
void |
setName(QName name) |
void |
setValue(Object value) |
String |
toString() |
void |
write(QName element,
XmlOutputStream out,
TypeMapper typeMapper)
write this instace as xml.
|
public XmlObject()
public XmlObject(QName name)
public QName getName()
public void setName(QName name)
public void setDefaultNamespace(String namespace)
public QName getXmlType()
public Object getValue()
public void setValue(Object value)
public boolean hasChildren()
public XMLizable asTyped()
public Iterator<XmlObject> evaluate(String xpath)
xpath
- public boolean removeField(String name)
public Iterator<XMLizable> getTypedChildren()
asTyped()
, this will return this object's children
as the proper complex type subclass of XMLizable, if they are complex
types. If a child is not a complex type, it will be returned as-is,
as an XmlObject.public void write(QName element, XmlOutputStream out, TypeMapper typeMapper) throws IOException
XMLizable
write
in interface XMLizable
element
- xml element nameout
- xml output streamtypeMapper
- type mapper to be usedIOException
- failed to write xmlpublic void load(XmlInputStream in, TypeMapper typeMapper) throws IOException, ConnectionException
XMLizable
load
in interface XMLizable
in
- xml input stream from which the data is readtypeMapper
- type mapper to be usedIOException
- failed to read xmlConnectionException
- failed to read/parser/bind xmlprotected void loadStartTag(XmlInputStream in, TypeMapper typeMapper)
protected void loadAfterStartTag(XmlInputStream in, TypeMapper typeMapper) throws IOException, ConnectionException
IOException
ConnectionException
protected void cloneFrom(XmlObject source)
Copyright © 2016. All Rights Reserved.