org.gxml.u
Interface GuReader

All Superinterfaces:
java.io.Closeable

public interface GuReader
extends java.io.Closeable

A reader provides sequential, forward-only, access to an XML tree.
The XML tree is read as a stream of events. After each event, the properties of the underlying stream may be inspected.


Method Summary
 java.lang.Iterable<javax.xml.namespace.QName> getAttributeNames(boolean orderCanonical)
          Returns the set of attribute names for the current node.
 java.lang.String getAttributeValue(java.lang.String namespaceURI, java.lang.String localName)
          Returns the dm:typed-value of the attribute with the specified dm:name.
 int getLineNumber()
          Returns the line number, or -1 if none is available.
 java.lang.String getLocalName()
           
 java.lang.String getNamespaceLocal(java.lang.String prefix)
           
 java.lang.Iterable<java.lang.String> getNamespaceNames(boolean orderCanonical)
          Returns the set of namespace names (prefixes) for the current node.
 java.lang.String getNamespaceURI()
           
 java.lang.String getPrefix()
           
 java.lang.String getStringValue()
           
 boolean hasAttributes()
           
 boolean hasNamespaces()
           
 boolean hasNext()
          Determines whether there are more events to be read.
 GuEventKind next()
          Positions the reader to the next event.
 
Methods inherited from interface java.io.Closeable
close
 

Method Detail

getAttributeNames

java.lang.Iterable<javax.xml.namespace.QName> getAttributeNames(boolean orderCanonical)
Returns the set of attribute names for the current node.

Parameters:
orderCanonical - Determines whether the names will be returned in canonical order (lexicographically by namespace URI, local name).

getAttributeValue

java.lang.String getAttributeValue(java.lang.String namespaceURI,
                                   java.lang.String localName)
Returns the dm:typed-value of the attribute with the specified dm:name. Returns null if the attribute does not exist.

Parameters:
namespaceURI - The dm:namespace-uri of the attribute. Cannot be null.
localName - The dm:local-name of the attribute. Cannot be null.

getLineNumber

int getLineNumber()
Returns the line number, or -1 if none is available.


getLocalName

java.lang.String getLocalName()
Returns:
the dm:local-name property of the XDM.

getNamespaceLocal

java.lang.String getNamespaceLocal(java.lang.String prefix)

getNamespaceNames

java.lang.Iterable<java.lang.String> getNamespaceNames(boolean orderCanonical)
Returns the set of namespace names (prefixes) for the current node.

Parameters:
orderCanonical - Determines whether the names will be returned in canonical order (lexicographically by local name).

getNamespaceURI

java.lang.String getNamespaceURI()
Returns:
the dm:namespace-uri property of the XDM.

getPrefix

java.lang.String getPrefix()
Returns:
the preix hint for the dm:name property of the XDM.

getStringValue

java.lang.String getStringValue()
Returns:
the value of the parse event as a string.

hasAttributes

boolean hasAttributes()
Returns:
true if the node has attributes, otherwise false.

hasNamespaces

boolean hasNamespaces()
Returns:
true if the node has prefix-to-namespace mappings, otherwise false.

hasNext

boolean hasNext()
Determines whether there are more events to be read.


next

GuEventKind next()
                 throws GuAbortException
Positions the reader to the next event.
This method may only be safely called if there are more events to be read. If there are no more events to be read, the behavior is implementation dependent.

Returns:
An GuEventKind value indicating the type of event.
Throws:
GuAbortException


Copyright © 2009 TIBCO Software Inc. All Rights Reserved.