2005/5/9

     
 

class XMLReader

artefaktur
Modules   Namespace List   Class Hierarchy   Alphabetical List   Compound List   Namespace Members   Compound Members   Related Pages  

acdk::xml::sax::XMLReader Class Reference

#include <XMLReader.h>

Inheritance diagram for acdk::xml::sax::XMLReader:

acdk::lang::Object org::xml::sax::XMLReader acdk::lang::ObjectBase acdk::lang::dmi::StdDispatch List of all members.

Public Member Functions

 XMLReader (bool useNamespace=true, int xmlFlags=XMLRF_DEFAULTFLAGS)
 ~XMLReader ()
virtual bool getFeature (IN(RString) name) throw ( org::xml::sax::RSAXNotRecognizedException , org::xml::sax::RSAXNotSupportedException )
 Look up the value of a feature flag.

virtual void setFeature (IN(RString) name, bool value) throw ( org::xml::sax::RSAXNotRecognizedException , org::xml::sax::RSAXNotSupportedException )
 Set the value of a feature flag.

virtual acdk::lang::Object getProperty (IN(RString) name) throw ( org::xml::sax::RSAXNotRecognizedException , org::xml::sax::RSAXNotSupportedException )
 Look up the value of a property.

virtual void setProperty (IN(RString) name, IN(acdk::lang::Object) value) throw ( org::xml::sax::RSAXNotRecognizedException , org::xml::sax::RSAXNotSupportedException )
 Set the value of a property.

virtual void setEntityResolver (IN(org::xml::sax::REntityResolver) resolver)
virtual org::xml::sax::REntityResolver getEntityResolver ()
 Return the current entity resolver.

virtual void setDTDHandler (IN(org::xml::sax::RDTDHandler) handler)
virtual org::xml::sax::RDTDHandler getDTDHandler ()
 Return the current DTD handler.

virtual void setContentHandler (IN(org::xml::sax::RContentHandler) handler)
virtual org::xml::sax::RContentHandler getContentHandler ()
 Return the current content handler.

virtual void setErrorHandler (IN(org::xml::sax::RErrorHandler) handler)
virtual org::xml::sax::RErrorHandler getErrorHandler ()
 Return the current error handler.

virtual void parse (IN(org::xml::sax::RInputSource) input) throw ( acdk::io::RIOException , org::xml::sax::RSAXException )
virtual void parse (IN(RString) systemId) throw ( acdk::io::RIOException , org::xml::sax::RSAXException )
 Parse an XML document from a system identifier (URI).

org::w3c::dom::RDocument parseInternal (IN(org::xml::sax::RInputSource) input) throw ( acdk::io::RIOException , org::xml::sax::RSAXException )
org::w3c::dom::RDocument parseInternal (IN(RString) systemId) throw ( acdk::io::RIOException , org::xml::sax::RSAXException )
org::w3c::dom::RDocument parseInternalHtml (IN(org::xml::sax::RInputSource) input) throw ( acdk::io::RIOException , org::xml::sax::RSAXException )
RString getURI (IN(RString) prefix)
void setExtendedFlags (int flags)
int getExtendedFlags ()
bool useNamespace ()
bool isValidating ()
void _startDTD (IN(RString) name, IN(RString) externalID, IN(RString) systemID)
acdk::io::RReader _resolveEntity (IN(RString) publicId, IN(RString) systemId)
void _startDocument (bool isStandalone)
void _endDocument ()
void _internalEntityDecl (IN(RString) name, IN(RString) value)
void _externalEntityDecl (IN(RString) name, IN(RString) publicId, IN(RString) systemId)
void _notationDecl (IN(RString) name, IN(RString) publicId, IN(RString) systemId)
void _attributeDecl (IN(RString) elementName, IN(RString) attributeName, IN(RString) type, IN(RString) mode, IN(RString) value)
void _elementDecl (IN(RString) name, IN(RString) model)
void _unparsedEntityDecl (IN(RString) name, IN(RString) publicId, IN(RString) systemId, IN(RString) notationName)
void _startElement (IN(RString) name, IN(org::xml::sax::RAttributes) attrs)
void _startElement (IN(RString) name, IN(RStringArray) attrs)
void _setDocumentLocator (IN(org::xml::sax::RLocator) loc)
void _endElement (IN(RString) name)
void _startPrefixMapping (IN(RString) prefix, IN(RString) uri)
void _characters (IN(RString) text)
void _ignorableWhitespace (IN(RString) text)
void _processingInstruction (IN(RString) target, IN(RString) data)
void _comment (IN(RString) text)
void _cdataBlock (IN(RString) text)
void _warning (IN(RString) message, int lineNumber, int columnNumber, IN(RString) publicId, IN(RString) systemId)
void _error (IN(RString) message, int lineNumber, int columnNumber, IN(RString) publicId, IN(RString) systemId)
void _fatalError (IN(RString) message, int lineNumber, int columnNumber, IN(RString) publicId, IN(RString) systemId)
bool hasAlreadyFatalError ()
bool setFatalError ()

Public Attributes

bool _seenStartDocument

Protected Attributes

org::xml::sax::REntityResolver _entityResolver
org::xml::sax::RDTDHandler _dtdHandler
org::xml::sax::RContentHandler _contentHandler
org::xml::sax::RErrorHandler _errorHandler
org::xml::sax::RDeclHandler _declarationHandler
org::xml::sax::RLexicalHandler _lexicalHandler
bool _hasAlreadyFatal
org::xml::sax::helpers::RNamespaceSupport _ns
org::xml::sax::RLocator _locator
RString _baseURI
int _extendedFlags

Private Member Functions

void _checkFeatureName (IN(RString) name)
void _splitName (IN(RString) fqName, OUT(RString) localName, OUT(RString) prefix, OUT(RString) uri)
void _evaluteExtendedFlags ()

Constructor & Destructor Documentation

acdk::xml::sax::XMLReader::XMLReader (  bool  useNamespace = true,
int  xmlFlags = XMLRF_DEFAULTFLAGS
)  [inline]
 

acdk::xml::sax::XMLReader::~XMLReader (   )  [inline]
 


Member Function Documentation

void acdk::xml::sax::XMLReader::_attributeDecl (  IN(RString)  elementName,
IN(RString)  attributeName,
IN(RString)  type,
IN(RString)  mode,
IN(RString)  value
) 
 

void acdk::xml::sax::XMLReader::_cdataBlock (  IN(RString)  text  ) 
 

void acdk::xml::sax::XMLReader::_characters (  IN(RString)  text  ) 
 

void acdk::xml::sax::XMLReader::_checkFeatureName (  IN(RString)  name  )  [private]
 

void acdk::xml::sax::XMLReader::_comment (  IN(RString)  text  ) 
 

void acdk::xml::sax::XMLReader::_elementDecl (  IN(RString)  name,
IN(RString)  model
) 
 

void acdk::xml::sax::XMLReader::_endDocument (   ) 
 

void acdk::xml::sax::XMLReader::_endElement (  IN(RString)  name  ) 
 

void acdk::xml::sax::XMLReader::_error (  IN(RString)  message,
int  lineNumber,
int  columnNumber,
IN(RString)  publicId,
IN(RString)  systemId
) 
 

void acdk::xml::sax::XMLReader::_evaluteExtendedFlags (   )  [private]
 

void acdk::xml::sax::XMLReader::_externalEntityDecl (  IN(RString)  name,
IN(RString)  publicId,
IN(RString)  systemId
) 
 

void acdk::xml::sax::XMLReader::_fatalError (  IN(RString)  message,
int  lineNumber,
int  columnNumber,
IN(RString)  publicId,
IN(RString)  systemId
) 
 

void acdk::xml::sax::XMLReader::_ignorableWhitespace (  IN(RString)  text  ) 
 

void acdk::xml::sax::XMLReader::_internalEntityDecl (  IN(RString)  name,
IN(RString)  value
) 
 

void acdk::xml::sax::XMLReader::_notationDecl (  IN(RString)  name,
IN(RString)  publicId,
IN(RString)  systemId
) 
 

void acdk::xml::sax::XMLReader::_processingInstruction (  IN(RString)  target,
IN(RString)  data
) 
 

acdk::io::RReader acdk::xml::sax::XMLReader::_resolveEntity (  IN(RString)  publicId,
IN(RString)  systemId
) 
 

void acdk::xml::sax::XMLReader::_setDocumentLocator (  IN(org::xml::sax::RLocator)  loc  ) 
 

void acdk::xml::sax::XMLReader::_splitName (  IN(RString)  fqName,
OUT(RString)  localName,
OUT(RString)  prefix,
OUT(RString)  uri
)  [private]
 

void acdk::xml::sax::XMLReader::_startDocument (  bool  isStandalone  ) 
 

void acdk::xml::sax::XMLReader::_startDTD (  IN(RString)  name,
IN(RString)  externalID,
IN(RString)  systemID
) 
 

void acdk::xml::sax::XMLReader::_startElement (  IN(RString)  name,
IN(RStringArray)  attrs
) 
 

void acdk::xml::sax::XMLReader::_startElement (  IN(RString)  name,
IN(org::xml::sax::RAttributes)  attrs
) 
 

void acdk::xml::sax::XMLReader::_startPrefixMapping (  IN(RString)  prefix,
IN(RString)  uri
) 
 

void acdk::xml::sax::XMLReader::_unparsedEntityDecl (  IN(RString)  name,
IN(RString)  publicId,
IN(RString)  systemId,
IN(RString)  notationName
) 
 

void acdk::xml::sax::XMLReader::_warning (  IN(RString)  message,
int  lineNumber,
int  columnNumber,
IN(RString)  publicId,
IN(RString)  systemId
) 
 

virtual org::xml::sax::RContentHandler acdk::xml::sax::XMLReader::getContentHandler (   )  [inline, virtual]
 

Return the current content handler.

Returns:
The current content handler, or null if none has been registered.
See also:
setContentHandler

Implements org::xml::sax::XMLReader.

virtual org::xml::sax::RDTDHandler acdk::xml::sax::XMLReader::getDTDHandler (   )  [inline, virtual]
 

Return the current DTD handler.

Returns:
The current DTD handler, or null if none has been registered.
See also:
setDTDHandler

Implements org::xml::sax::XMLReader.

virtual org::xml::sax::REntityResolver acdk::xml::sax::XMLReader::getEntityResolver (   )  [inline, virtual]
 

Return the current entity resolver.

Returns:
The current entity resolver, or null if none has been registered.
See also:
setEntityResolver

Implements org::xml::sax::XMLReader.

virtual org::xml::sax::RErrorHandler acdk::xml::sax::XMLReader::getErrorHandler (   )  [inline, virtual]
 

Return the current error handler.

Returns:
The current error handler, or null if none has been registered.
See also:
setErrorHandler

Implements org::xml::sax::XMLReader.

int acdk::xml::sax::XMLReader::getExtendedFlags (   )  [inline]
 

Returns:
flags combination of acdk::xml::sax::XMLReaderFlags

virtual bool acdk::xml::sax::XMLReader::getFeature (  IN(RString)  name  )  throw ( org::xml::sax::RSAXNotRecognizedException , org::xml::sax::RSAXNotSupportedException ) [virtual]
 

Look up the value of a feature flag.

The feature name is any fully-qualified URI. It is possible for an XMLReader to recognize a feature name but temporarily be unable to return its value. Some feature values may be available only in specific contexts, such as before, during, or after a parse. Also, some feature values may not be programmatically accessible. (In the case of an adapter for SAX1 Parser, there is no implementation-independent way to expose whether the underlying parser is performing validation, expanding external entities, and so forth.)

All XMLReaders are required to recognize the http://xml.org/sax/features/namespaces and the http://xml.org/sax/features/namespace-prefixes feature names.

Typical usage is something like this:

XMLReader r = new MySAXDriver();

// try to activate validation try { r.setFeature(http://xml.org/sax/features/validation, true); } catch (SAXException e) { System.err.println(Cannot activate validation.); }

// register event handlers r.setContentHandler(new MyContentHandler()); r.setErrorHandler(new MyErrorHandler());

// parse the first document try { r.parse(http://www.foo.com/mydoc.xml); } catch (IOException e) { System.err.println(I/O exception reading XML document); } catch (SAXException e) { System.err.println(XML exception reading document.); }

Implementors are free (and encouraged) to invent their own features, using names built on their own URIs.

Parameters:
name The feature name, which is a fully-qualified URI.
Returns:
The current value of the feature (true or false).
Exceptions:
org.xml.sax.SAXNotRecognizedException If the feature value can't be assigned or retrieved.
org.xml.sax.SAXNotSupportedException When the XMLReader recognizes the feature name but cannot determine its value at this time.
See also:
setFeature

Implements org::xml::sax::XMLReader.

virtual acdk::lang::Object acdk::xml::sax::XMLReader::getProperty (  IN(RString)  name  )  throw ( org::xml::sax::RSAXNotRecognizedException , org::xml::sax::RSAXNotSupportedException ) [virtual]
 

Look up the value of a property.

The property name is any fully-qualified URI. It is possible for an XMLReader to recognize a property name but temporarily be unable to return its value. Some property values may be available only in specific contexts, such as before, during, or after a parse.

XMLReaders are not required to recognize any specific property names, though an initial core set is documented for SAX2.

Implementors are free (and encouraged) to invent their own properties, using names built on their own URIs.

Parameters:
name The property name, which is a fully-qualified URI.
Returns:
The current value of the property.
Exceptions:
org.xml.sax.SAXNotRecognizedException If the property value can't be assigned or retrieved.
org.xml.sax.SAXNotSupportedException When the XMLReader recognizes the property name but cannot determine its value at this time.
See also:
setProperty

Implements org::xml::sax::XMLReader.

RString acdk::xml::sax::XMLReader::getURI (  IN(RString)  prefix  ) 
 

bool acdk::xml::sax::XMLReader::hasAlreadyFatalError (   ) 
 

bool acdk::xml::sax::XMLReader::isValidating (   )  [inline]
 

virtual void acdk::xml::sax::XMLReader::parse (  IN(RString)  systemId  )  throw ( acdk::io::RIOException , org::xml::sax::RSAXException ) [virtual]
 

Parse an XML document from a system identifier (URI).

This method is a shortcut for the common case of reading a document from a system identifier. It is the exact equivalent of the following:

parse(new InputSource(systemId));

If the system identifier is a URL, it must be fully resolved by the application before it is passed to the parser.

Parameters:
systemId The system identifier (URI).
Exceptions:
org.xml.sax.SAXException Any SAX exception, possibly wrapping another exception.
java.io.IOException An IO exception from the parser, possibly from a byte stream or character stream supplied by the application.
See also:
parse(org::xml::sax::InputSource)

Implements org::xml::sax::XMLReader.

virtual void acdk::xml::sax::XMLReader::parse (  IN(org::xml::sax::RInputSource)  input  )  throw ( acdk::io::RIOException , org::xml::sax::RSAXException ) [virtual]
 

org::w3c::dom::RDocument acdk::xml::sax::XMLReader::parseInternal (  IN(RString)  systemId  )  throw ( acdk::io::RIOException , org::xml::sax::RSAXException )
 

org::w3c::dom::RDocument acdk::xml::sax::XMLReader::parseInternal (  IN(org::xml::sax::RInputSource)  input  )  throw ( acdk::io::RIOException , org::xml::sax::RSAXException )
 

org::w3c::dom::RDocument acdk::xml::sax::XMLReader::parseInternalHtml (  IN(org::xml::sax::RInputSource)  input  )  throw ( acdk::io::RIOException , org::xml::sax::RSAXException )
 

virtual void acdk::xml::sax::XMLReader::setContentHandler (  IN(org::xml::sax::RContentHandler)  handler  )  [inline, virtual]
 

virtual void acdk::xml::sax::XMLReader::setDTDHandler (  IN(org::xml::sax::RDTDHandler)  handler  )  [inline, virtual]
 

virtual void acdk::xml::sax::XMLReader::setEntityResolver (  IN(org::xml::sax::REntityResolver)  resolver  )  [inline, virtual]
 

virtual void acdk::xml::sax::XMLReader::setErrorHandler (  IN(org::xml::sax::RErrorHandler)  handler  )  [inline, virtual]
 

void acdk::xml::sax::XMLReader::setExtendedFlags (  int  flags  )  [inline]
 

Parameters:
flags combination of acdk::xml::sax::XMLReaderFlags

bool acdk::xml::sax::XMLReader::setFatalError (   ) 
 

virtual void acdk::xml::sax::XMLReader::setFeature (  IN(RString)  name,
bool  value
)  throw ( org::xml::sax::RSAXNotRecognizedException , org::xml::sax::RSAXNotSupportedException ) [virtual]
 

Set the value of a feature flag.

The feature name is any fully-qualified URI. It is possible for an XMLReader to expose a feature value but to be unable to change the current value. Some feature values may be immutable or mutable only in specific contexts, such as before, during, or after a parse.

All XMLReaders are required to support setting http://xml.org/sax/features/namespaces to true and http://xml.org/sax/features/namespace-prefixes to false.

Parameters:
name The feature name, which is a fully-qualified URI.
value The requested value of the feature (true or false).
Exceptions:
org.xml.sax.SAXNotRecognizedException If the feature value can't be assigned or retrieved.
org.xml.sax.SAXNotSupportedException When the XMLReader recognizes the feature name but cannot set the requested value.
See also:
getFeature

Implements org::xml::sax::XMLReader.

virtual void acdk::xml::sax::XMLReader::setProperty (  IN(RString)  name,
IN(acdk::lang::Object)  value
)  throw ( org::xml::sax::RSAXNotRecognizedException , org::xml::sax::RSAXNotSupportedException ) [virtual]
 

Set the value of a property.

The property name is any fully-qualified URI. It is possible for an XMLReader to recognize a property name but to be unable to change the current value. Some property values may be immutable or mutable only in specific contexts, such as before, during, or after a parse.

XMLReaders are not required to recognize setting any specific property names, though a core set is defined by SAX2.

This method is also the standard mechanism for setting extended handlers.

Parameters:
name The property name, which is a fully-qualified URI.
value The requested value for the property.
Exceptions:
org.xml.sax.SAXNotRecognizedException If the property value can't be assigned or retrieved.
org.xml.sax.SAXNotSupportedException When the XMLReader recognizes the property name but cannot set the requested value.

Implements org::xml::sax::XMLReader.

bool acdk::xml::sax::XMLReader::useNamespace (   )  [inline]
 


Member Data Documentation

RString acdk::xml::sax::XMLReader::_baseURI [protected]
 

org::xml::sax::RContentHandler acdk::xml::sax::XMLReader::_contentHandler [protected]
 

org::xml::sax::RDeclHandler acdk::xml::sax::XMLReader::_declarationHandler [protected]
 

org::xml::sax::RDTDHandler acdk::xml::sax::XMLReader::_dtdHandler [protected]
 

org::xml::sax::REntityResolver acdk::xml::sax::XMLReader::_entityResolver [protected]
 

org::xml::sax::RErrorHandler acdk::xml::sax::XMLReader::_errorHandler [protected]
 

int acdk::xml::sax::XMLReader::_extendedFlags [protected]
 

bool acdk::xml::sax::XMLReader::_hasAlreadyFatal [protected]
 

org::xml::sax::RLexicalHandler acdk::xml::sax::XMLReader::_lexicalHandler [protected]
 

org::xml::sax::RLocator acdk::xml::sax::XMLReader::_locator [protected]
 

org::xml::sax::helpers::RNamespaceSupport acdk::xml::sax::XMLReader::_ns [protected]
 

bool acdk::xml::sax::XMLReader::_seenStartDocument