|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.esri.arcgis.system.XMLReader
public class XMLReader
An XML sequential document reader.
Use the XMLReader coclass when you wish to provide access to members that control the sequential reading of XML. XMLStream needs to be hooked-up in order to read the stream.
'*** Create an XML stream and read into it from an XML file
Dim pXMLStream As IXMLStream
Set pXMLStream = New XmlStream
pXMLStream.LoadFromFile "d:\temp\foo.xml"
'*** Create a reader object and point it to the stream
Dim pXMLReader As IXMLReader
Set pXMLReader = New XMLReader
pXMLReader.ReadFrom pXMLStream
'*** Create an XML serializer and use it to deserialize the recordset object from
'*** the stream using the XMLReader
Dim pxmlserial As IXMLSerializer
Dim pRecordSet As IRecordSet
Set pxmlserial = New XMLSerializer
Set pRecordSet = pxmlserial.ReadObject(pXMLReader, Nothing, Nothing)
See the IXMLReader interface for more on getting information about reading of objects.
IXMLStream
,
IXMLWriter
,
IXMLReader
,
IXMLSerialize
,
Serialized FormConstructor Summary | |
---|---|
XMLReader()
Constructs a XMLReader using ArcGIS Engine. |
|
XMLReader(Object obj)
Deprecated. As of ArcGIS 9.2, replaced by normal Java casts. XMLReader theXMLReader = (XMLReader) obj; |
Method Summary | |
---|---|
void |
closeElement()
Moves position to parent element. |
boolean |
equals(Object o)
Compare this object with another |
IXMLAttributes |
getAttributes()
Attributes of current element. |
static String |
getClsid()
getClsid. |
String |
getLocalName()
Local name of current element. |
IXMLNamespaces |
getNamespaceDeclarations()
Namespace declarations of current element. |
String |
getNamespacePrefix()
Namespace prefix of current element. |
String |
getNamespaceURI()
Namespace URI of current element. |
String |
getText()
Text value of current element. |
int |
hashCode()
the hashcode for this object |
void |
interfaceSupportsErrorInfo(GUID riid)
interfaceSupportsErrorInfo |
boolean |
isHasElementChildren()
Indicates whether the current element has child elements. |
boolean |
isLastChild()
Indicates whether the current element is the last child element of its parent. |
String |
lookupPrefix(String prefix)
Obtains the prefix for a declared URI. |
void |
nextElement()
Moves position to next element. |
void |
openElement()
Moves position to first child element. |
byte[] |
readBinary()
Reads the current element value as a binary array. |
boolean |
readBoolean()
Reads the current element value as a boolean. |
byte |
readByte()
Reads the current element value as a byte. |
Date |
readDate()
Reads the current element value as a date. |
double |
readDouble()
Reads the current element value as a double. |
float |
readFloat()
Reads the current element value as a float. |
void |
readFrom(IStream inputStream)
Specifies the input XML stream. |
int |
readInteger()
Reads the current element value as a long. |
short |
readShort()
Reads the current element value as a short. |
Object |
readVariant()
Reads the current element value as a variant. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.esri.arcgis.interop.RemoteObjRef |
---|
getJintegraDispatch, release |
Constructor Detail |
---|
public XMLReader() throws IOException, UnknownHostException
IOException
- if there are interop problems
UnknownHostException
- if there are interop problemspublic XMLReader(Object obj) throws IOException
XMLReader theXMLReader = (XMLReader) obj;
obj
to XMLReader
.
obj
- an object returned from ArcGIS Engine or Server
IOException
- if there are interop problemsMethod Detail |
---|
public static String getClsid()
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public void readFrom(IStream inputStream) throws IOException, AutomationException
The ReadFrom method specifies the input XML stream.
For example:
Dim pXmlReader As IXMLReader
Set pXmlReader = New XMLReader
Dim pXmlStream as IXMLStream
Set pXmlStream = new XMLStream
pXmlStream.OpenFromFile App.Path &
"\file.xml"
pXmlReader.ReadFrom pXmlStream
If xml file is empty the XMLStream will evoke Automation error. Xml file needs to be of a proper structure.
readFrom
in interface IXMLReader
inputStream
- A reference to a com.esri.arcgis.system.IStream (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public String getLocalName() throws IOException, AutomationException
getLocalName
in interface IXMLReader
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public String getNamespaceURI() throws IOException, AutomationException
getNamespaceURI
in interface IXMLReader
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public String getNamespacePrefix() throws IOException, AutomationException
getNamespacePrefix
in interface IXMLReader
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public IXMLNamespaces getNamespaceDeclarations() throws IOException, AutomationException
getNamespaceDeclarations
in interface IXMLReader
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public IXMLAttributes getAttributes() throws IOException, AutomationException
getAttributes
in interface IXMLReader
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public String getText() throws IOException, AutomationException
getText
in interface IXMLReader
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public boolean isHasElementChildren() throws IOException, AutomationException
isHasElementChildren
in interface IXMLReader
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public boolean isLastChild() throws IOException, AutomationException
isLastChild
in interface IXMLReader
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void nextElement() throws IOException, AutomationException
nextElement
in interface IXMLReader
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void openElement() throws IOException, AutomationException
openElement
in interface IXMLReader
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void closeElement() throws IOException, AutomationException
closeElement
in interface IXMLReader
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public String lookupPrefix(String prefix) throws IOException, AutomationException
lookupPrefix
in interface IXMLReader
prefix
- The prefix (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public boolean readBoolean() throws IOException, AutomationException
The ReadBoolean method specifies the current element value as a boolean.
Element value 1 or true will return boolean value of true, anything else will return false.
readBoolean
in interface IXMLReader
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public byte readByte() throws IOException, AutomationException
The ReadByte method specifies the current element value as a byte.
Byte variables are stored as single, unsigned 8 bit numbers (1 byte), its range is from 0 to 255. Anything below and above these numbers will cause the Invalid Procedure Call Error.
readByte
in interface IXMLReader
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public short readShort() throws IOException, AutomationException
The ReadShort method specifies the current element value as a short.
readShort
in interface IXMLReader
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public int readInteger() throws IOException, AutomationException
The ReadInteger method specifies the current element value as a Integer.
readInteger
in interface IXMLReader
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public float readFloat() throws IOException, AutomationException
The ReadFloat method specifies the current element value as a float.
readFloat
in interface IXMLReader
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public double readDouble() throws IOException, AutomationException
The ReadDouble method specifies the current element value as a double.
readDouble
in interface IXMLReader
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public Date readDate() throws IOException, AutomationException
<?xml version="1.0"?>
<Data description="example of ReadDate">
<type>
<date>2005-01-28T12:23:34</date>
</type>
</Data>
VB6 code to get date value:
Dim pXMLStream As IXMLStream
Set pXMLStream = New XMLStream
pXMLStream.LoadFromFile App.Path + "\data.xml"
pXMLReader.OpenElement
pXMLReader.OpenElement
Dim dateValue As Date
dateValue = pXMLReader.ReadDate
readDate
in interface IXMLReader
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public byte[] readBinary() throws IOException, AutomationException
The ReadBinary method specifies the current element value as a binary array.
readBinary
in interface IXMLReader
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public Object readVariant() throws IOException, AutomationException
The ReadVariant method specifies the current element value as a variant.
readVariant
in interface IXMLReader
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void interfaceSupportsErrorInfo(GUID riid) throws IOException, AutomationException
Indicates whether the interface supports IErrorInfo.
interfaceSupportsErrorInfo
in interface ISupportErrorInfo
riid
- A Structure: com.esri.arcgis.support.ms.stdole.GUID (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |