Package com.sforce.ws.bind
Class XmlObject
java.lang.Object
com.sforce.ws.bind.XmlObject
- All Implemented Interfaces:
XMLizable
- Direct Known Subclasses:
XmlObjectWrapper
This is a generic XML element -- same a DOM element. In the common case this
class must be able to hold child elements. We do not have a usecase for it yet.
So child elements are not implemented.
- Since:
- 1.0 Dec 12, 2005
- Version:
- 1.0
- Author:
- http://cheenath.com
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionasTyped()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 voidevaluate the given xpath like expression.getChildren(String name) getName()Similar toasTyped(), this will return this object's children as the proper complex type subclass of XMLizable, if they are complex types.getValue()booleanvoidload(XmlInputStream in, TypeMapper typeMapper) load the fileds/children from the specified xml streamprotected voidloadAfterStartTag(XmlInputStream in, TypeMapper typeMapper) protected voidloadStartTag(XmlInputStream in, TypeMapper typeMapper) booleanremoveField(String name) voidsetDefaultNamespace(String namespace) voidvoidtoString()voidwrite(QName element, XmlOutputStream out, TypeMapper typeMapper) write this instace as xml.
-
Constructor Details
-
XmlObject
public XmlObject() -
XmlObject
-
XmlObject
-
-
Method Details
-
getName
-
setName
-
setDefaultNamespace
-
getXmlType
-
getValue
-
setValue
-
hasChildren
public boolean hasChildren() -
addField
-
setField
-
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. If it does not, it will simply return this.- Returns:
-
evaluate
evaluate the given xpath like expression. eg xpath: "OpportunityContactRoles/records/Contact/LastName" this will list all LastName- Parameters:
xpath-- Returns:
-
removeField
-
getField
-
getChild
-
getChildren
-
getChildren
-
getTypedChildren
Similar toasTyped(), 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.- Returns:
-
toString
-
write
Description copied from interface:XMLizablewrite this instace as xml.- Specified by:
writein interfaceXMLizable- Parameters:
element- xml element nameout- xml output streamtypeMapper- type mapper to be used- Throws:
IOException- failed to write xml
-
load
Description copied from interface:XMLizableload the fileds/children from the specified xml stream- Specified by:
loadin interfaceXMLizable- Parameters:
in- xml input stream from which the data is readtypeMapper- type mapper to be used- Throws:
IOException- failed to read xmlConnectionException- failed to read/parser/bind xml
-
loadStartTag
-
loadAfterStartTag
protected void loadAfterStartTag(XmlInputStream in, TypeMapper typeMapper) throws IOException, ConnectionException - Throws:
IOExceptionConnectionException
-
cloneFrom
-