BEA Systems, Inc.

BEA WebLogic Server 9.0 API Reference


weblogic.apache.xerces.impl
Class XMLScanner

java.lang.Object
  extended byweblogic.apache.xerces.impl.XMLScanner
All Implemented Interfaces:
XMLComponent
Direct Known Subclasses:
XMLDocumentFragmentScannerImpl, XMLDTDScannerImpl

Deprecated. please use JDK supplied XML parsers and transformers

public abstract class XMLScanner
extends Object
implements XMLComponent

This class is responsible for holding scanning methods common to scanning the XML document structure and content as well as the DTD structure and content. Both XMLDocumentScanner and XMLDTDScanner inherit from this base class.

This component requires the following features and properties from the component manager that uses it:


Field Summary
protected static boolean DEBUG_ATTR_NORMALIZATION
          Deprecated. Debug attribute normalization.
protected static String ENTITY_MANAGER
          Deprecated. Property identifier: entity manager.
protected static String ERROR_REPORTER
          Deprecated. Property identifier: error reporter.
protected static String fAmpSymbol
          Deprecated. Symbol: "amp".
protected static String fAposSymbol
          Deprecated. Symbol: "apos".
protected  String fCharRefLiteral
          Deprecated. Literal value of the last character refence scanned.
protected static String fEncodingSymbol
          Deprecated. Symbol: "encoding".
protected  int fEntityDepth
          Deprecated. Entity depth.
protected  XMLEntityManager fEntityManager
          Deprecated. Entity manager.
protected  XMLEntityScanner fEntityScanner
          Deprecated. Entity scanner.
protected  XMLErrorReporter fErrorReporter
          Deprecated. Error reporter.
protected static String fGtSymbol
          Deprecated. Symbol: "gt".
protected static String fLtSymbol
          Deprecated. Symbol: "lt".
protected  boolean fNotifyCharRefs
          Deprecated. Character references notification.
protected static String fQuotSymbol
          Deprecated. Symbol: "quot".
protected  boolean fReportEntity
          Deprecated. Report entity boundary.
protected  XMLResourceIdentifierImpl fResourceIdentifier
          Deprecated.  
protected  boolean fScanningAttribute
          Deprecated. Scanning attribute.
protected static String fStandaloneSymbol
          Deprecated. Symbol: "standalone".
protected  SymbolTable fSymbolTable
          Deprecated. Symbol table.
protected  boolean fValidation
          Deprecated. Validation.
protected static String fVersionSymbol
          Deprecated. Symbol: "version".
protected static String NOTIFY_CHAR_REFS
          Deprecated. Feature identifier: notify character references.
protected static String SYMBOL_TABLE
          Deprecated. Property identifier: symbol table.
protected static String VALIDATION
          Deprecated. Feature identifier: validation.
 
Constructor Summary
XMLScanner()
          Deprecated.  
 
Method Summary
 void endEntity(String name)
          Deprecated. This method notifies the end of an entity.
 boolean getFeature(String featureId)
          Deprecated.  
protected  void normalizeWhitespace(XMLString value)
          Deprecated. Normalize whitespace in an XMLString converting all whitespace characters to space characters.
protected  void reportFatalError(String msgId, Object[] args)
          Deprecated. Convenience function used in all XML scanners.
protected  void reset()
          Deprecated.  
 void reset(XMLComponentManager componentManager)
          Deprecated.  
protected  void scanAttributeValue(XMLString value, XMLString nonNormalizedValue, String atName, XMLAttributes attributes, int attrIndex, boolean checkEntities)
          Deprecated. Scans an attribute value and normalizes whitespace converting all whitespace characters to space characters.
protected  int scanCharReferenceValue(XMLStringBuffer buf, XMLStringBuffer buf2)
          Deprecated. Scans a character reference and append the corresponding chars to the specified buffer.
protected  void scanComment(XMLStringBuffer text)
          Deprecated. Scans a comment.
protected  void scanExternalID(String[] identifiers, boolean optionalSystemId)
          Deprecated. Scans External ID and return the public and system IDs.
protected  void scanPI()
          Deprecated. Scans a processing instruction.
protected  void scanPIData(String target, XMLString data)
          Deprecated. Scans a processing data.
 String scanPseudoAttribute(boolean scanningTextDecl, XMLString value)
          Deprecated. Scans a pseudo attribute.
protected  boolean scanPubidLiteral(XMLString literal)
          Deprecated. Scans public ID literal.
protected  boolean scanSurrogates(XMLStringBuffer buf)
          Deprecated. Scans surrogates and append them to the specified buffer.
protected  void scanXMLDeclOrTextDecl(boolean scanningTextDecl, String[] pseudoAttributeValues)
          Deprecated. Scans an XML or text declaration.
 void setFeature(String featureId, boolean value)
          Deprecated.  
 void setProperty(String propertyId, Object value)
          Deprecated. Sets the value of a property during parsing.
 void startEntity(String name, XMLResourceIdentifier identifier, String encoding)
          Deprecated. This method notifies of the start of an entity.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface weblogic.apache.xerces.xni.parser.XMLComponent
getRecognizedFeatures, getRecognizedProperties
 

Field Detail

DEBUG_ATTR_NORMALIZATION

protected static final boolean DEBUG_ATTR_NORMALIZATION
Deprecated. 
Debug attribute normalization.

See Also:
Constant Field Values

ENTITY_MANAGER

protected static final String ENTITY_MANAGER
Deprecated. 
Property identifier: entity manager.

See Also:
Constant Field Values

ERROR_REPORTER

protected static final String ERROR_REPORTER
Deprecated. 
Property identifier: error reporter.

See Also:
Constant Field Values

fAmpSymbol

protected static final String fAmpSymbol
Deprecated. 
Symbol: "amp".


fAposSymbol

protected static final String fAposSymbol
Deprecated. 
Symbol: "apos".


fCharRefLiteral

protected String fCharRefLiteral
Deprecated. 
Literal value of the last character refence scanned.


fEncodingSymbol

protected static final String fEncodingSymbol
Deprecated. 
Symbol: "encoding".


fEntityDepth

protected int fEntityDepth
Deprecated. 
Entity depth.


fEntityManager

protected XMLEntityManager fEntityManager
Deprecated. 
Entity manager.


fEntityScanner

protected XMLEntityScanner fEntityScanner
Deprecated. 
Entity scanner.


fErrorReporter

protected XMLErrorReporter fErrorReporter
Deprecated. 
Error reporter.


fGtSymbol

protected static final String fGtSymbol
Deprecated. 
Symbol: "gt".


fLtSymbol

protected static final String fLtSymbol
Deprecated. 
Symbol: "lt".


fNotifyCharRefs

protected boolean fNotifyCharRefs
Deprecated. 
Character references notification.


fQuotSymbol

protected static final String fQuotSymbol
Deprecated. 
Symbol: "quot".


fReportEntity

protected boolean fReportEntity
Deprecated. 
Report entity boundary.


fResourceIdentifier

protected XMLResourceIdentifierImpl fResourceIdentifier
Deprecated. 

fScanningAttribute

protected boolean fScanningAttribute
Deprecated. 
Scanning attribute.


fStandaloneSymbol

protected static final String fStandaloneSymbol
Deprecated. 
Symbol: "standalone".


fSymbolTable

protected SymbolTable fSymbolTable
Deprecated. 
Symbol table.


fValidation

protected boolean fValidation
Deprecated. 
Validation. This feature identifier is: http://xml.org/sax/features/validation


fVersionSymbol

protected static final String fVersionSymbol
Deprecated. 
Symbol: "version".


NOTIFY_CHAR_REFS

protected static final String NOTIFY_CHAR_REFS
Deprecated. 
Feature identifier: notify character references.

See Also:
Constant Field Values

SYMBOL_TABLE

protected static final String SYMBOL_TABLE
Deprecated. 
Property identifier: symbol table.

See Also:
Constant Field Values

VALIDATION

protected static final String VALIDATION
Deprecated. 
Feature identifier: validation.

See Also:
Constant Field Values
Constructor Detail

XMLScanner

public XMLScanner()
Deprecated. 
Method Detail

endEntity

public void endEntity(String name)
               throws XNIException
Deprecated. 
This method notifies the end of an entity. The document entity has the pseudo-name of "[xml]" the DTD has the pseudo-name of "[dtd]" parameter entity names start with '%'; and general entities are just specified by their name.

Parameters:
name - The name of the entity.
Throws:
XNIException - Thrown by handler to signal an error.

getFeature

public boolean getFeature(String featureId)
                   throws XMLConfigurationException
Deprecated. 
Throws:
XMLConfigurationException

normalizeWhitespace

protected void normalizeWhitespace(XMLString value)
Deprecated. 
Normalize whitespace in an XMLString converting all whitespace characters to space characters.


reportFatalError

protected void reportFatalError(String msgId,
                                Object[] args)
                         throws XNIException
Deprecated. 
Convenience function used in all XML scanners.

Throws:
XNIException

reset

protected void reset()
Deprecated. 

reset

public void reset(XMLComponentManager componentManager)
           throws XMLConfigurationException
Deprecated. 
Description copied from interface: XMLComponent
Resets the component. The component can query the component manager about any features and properties that affect the operation of the component.

Specified by:
reset in interface XMLComponent
Parameters:
componentManager - The component manager.
Throws:
SAXException - Throws exception if required features and properties cannot be found.
XMLConfigurationException

scanAttributeValue

protected void scanAttributeValue(XMLString value,
                                  XMLString nonNormalizedValue,
                                  String atName,
                                  XMLAttributes attributes,
                                  int attrIndex,
                                  boolean checkEntities)
                           throws IOException,
                                  XNIException
Deprecated. 
Scans an attribute value and normalizes whitespace converting all whitespace characters to space characters. [10] AttValue ::= '"' ([^<&"] | Reference)* '"' | "'" ([^<&'] | Reference)* "'"

Parameters:
value - The XMLString to fill in with the value.
nonNormalizedValue - The XMLString to fill in with the non-normalized value.
atName - The name of the attribute being parsed (for error msgs).
attributes - The attributes list for the scanned attribute.
attrIndex - The index of the attribute to use from the list.
checkEntities - true if undeclared entities should be reported as VC violation, false if undeclared entities should be reported as WFC violation. Note: This method uses fStringBuffer2, anything in it at the time of calling is lost.
Throws:
IOException
XNIException

scanCharReferenceValue

protected int scanCharReferenceValue(XMLStringBuffer buf,
                                     XMLStringBuffer buf2)
                              throws IOException,
                                     XNIException
Deprecated. 
Scans a character reference and append the corresponding chars to the specified buffer.

 [66] CharRef ::= '&#' [0-9]+ ';' | '&#x' [0-9a-fA-F]+ ';'
 
Note: This method uses fStringBuffer, anything in it at the time of calling is lost.

Parameters:
buf - the character buffer to append chars to
buf2 - the character buffer to append non-normalized chars to
Returns:
the character value or (-1) on conversion failure
Throws:
IOException
XNIException

scanComment

protected void scanComment(XMLStringBuffer text)
                    throws IOException,
                           XNIException
Deprecated. 
Scans a comment.

 [15] Comment ::= '<!--' ((Char - '-') | ('-' (Char - '-')))* '-->'
 

Note: Called after scanning past '<!--' Note: This method uses fString, anything in it at the time of calling is lost.

Parameters:
text - The buffer to fill in with the text.
Throws:
IOException
XNIException

scanExternalID

protected void scanExternalID(String[] identifiers,
                              boolean optionalSystemId)
                       throws IOException,
                              XNIException
Deprecated. 
Scans External ID and return the public and system IDs.

Parameters:
identifiers - An array of size 2 to return the system id, and public id (in that order).
optionalSystemId - Specifies whether the system id is optional. Note: This method uses fString and fStringBuffer, anything in them at the time of calling is lost.
Throws:
IOException
XNIException

scanPI

protected void scanPI()
               throws IOException,
                      XNIException
Deprecated. 
Scans a processing instruction.

 [16] PI ::= '<?' PITarget (S (Char* - (Char* '?>' Char*)))? '?>'
 [17] PITarget ::= Name - (('X' | 'x') ('M' | 'm') ('L' | 'l'))
 
Note: This method uses fString, anything in it at the time of calling is lost.

Throws:
IOException
XNIException

scanPIData

protected void scanPIData(String target,
                          XMLString data)
                   throws IOException,
                          XNIException
Deprecated. 
Scans a processing data. This is needed to handle the situation where a document starts with a processing instruction whose target name starts with "xml". (e.g. xmlfoo) Note: This method uses fStringBuffer, anything in it at the time of calling is lost.

Parameters:
target - The PI target
data - The string to fill in with the data
Throws:
IOException
XNIException

scanPseudoAttribute

public String scanPseudoAttribute(boolean scanningTextDecl,
                                  XMLString value)
                           throws IOException,
                                  XNIException
Deprecated. 
Scans a pseudo attribute.

Parameters:
scanningTextDecl - True if scanning this pseudo-attribute for a TextDecl; false if scanning XMLDecl. This flag is needed to report the correct type of error.
value - The string to fill in with the attribute value.
Returns:
The name of the attribute Note: This method uses fStringBuffer2, anything in it at the time of calling is lost.
Throws:
IOException
XNIException

scanPubidLiteral

protected boolean scanPubidLiteral(XMLString literal)
                            throws IOException,
                                   XNIException
Deprecated. 
Scans public ID literal. [12] PubidLiteral ::= '"' PubidChar* '"' | "'" (PubidChar - "'")* "'" [13] PubidChar::= #x20 | #xD | #xA | [a-zA-Z0-9] | [-'()+,./:=?;!*#@$_%] The returned string is normalized according to the following rule, from http://www.w3.org/TR/REC-xml#dt-pubid: Before a match is attempted, all strings of white space in the public identifier must be normalized to single space characters (#x20), and leading and trailing white space must be removed.

Parameters:
literal - The string to fill in with the public ID literal.
Throws:
IOException
XNIException

scanSurrogates

protected boolean scanSurrogates(XMLStringBuffer buf)
                          throws IOException,
                                 XNIException
Deprecated. 
Scans surrogates and append them to the specified buffer.

Note: This assumes the current char has already been identified as a high surrogate.

Parameters:
buf - The StringBuffer to append the read surrogates to.
Throws:
IOException
XNIException

scanXMLDeclOrTextDecl

protected void scanXMLDeclOrTextDecl(boolean scanningTextDecl,
                                     String[] pseudoAttributeValues)
                              throws IOException,
                                     XNIException
Deprecated. 
Scans an XML or text declaration.

 [23] XMLDecl ::= ''
 [24] VersionInfo ::= S 'version' Eq (' VersionNum ' | " VersionNum ")
 [80] EncodingDecl ::= S 'encoding' Eq ('"' EncName '"' |  "'" EncName "'" )
 [81] EncName ::= [A-Za-z] ([A-Za-z0-9._] | '-')*
 [32] SDDecl ::= S 'standalone' Eq (("'" ('yes' | 'no') "'")
                 | ('"' ('yes' | 'no') '"'))

 [77] TextDecl ::= ''
 

Parameters:
scanningTextDecl - True if a text declaration is to be scanned instead of an XML declaration.
pseudoAttributeValues - An array of size 3 to return the version, encoding and standalone pseudo attribute values (in that order). Note: This method uses fString, anything in it at the time of calling is lost.
Throws:
IOException
XNIException

setFeature

public void setFeature(String featureId,
                       boolean value)
                throws XMLConfigurationException
Deprecated. 
Description copied from interface: XMLComponent
Sets the state of a feature. This method is called by the component manager any time after reset when a feature changes state.

Note: Components should silently ignore features that do not affect the operation of the component.

Specified by:
setFeature in interface XMLComponent
Parameters:
featureId - The feature identifier.
value - The state of the feature.
Throws:
XMLConfigurationException - Thrown for configuration error. In general, components should only throw this exception if it is really a critical error.

setProperty

public void setProperty(String propertyId,
                        Object value)
                 throws XMLConfigurationException
Deprecated. 
Sets the value of a property during parsing.

Specified by:
setProperty in interface XMLComponent
Parameters:
propertyId -
value -
Throws:
XMLConfigurationException - Thrown for configuration error. In general, components should only throw this exception if it is really a critical error.

startEntity

public void startEntity(String name,
                        XMLResourceIdentifier identifier,
                        String encoding)
                 throws XNIException
Deprecated. 
This method notifies of the start of an entity. The document entity has the pseudo-name of "[xml]" the DTD has the pseudo-name of "[dtd]" parameter entity names start with '%'; and general entities are just specified by their name.

Parameters:
name - The name of the entity.
identifier - The resource identifier.
encoding - The auto-detected IANA encoding name of the entity stream. This value will be null in those situations where the entity encoding is not auto-detected (e.g. internal entities or a document entity that is parsed from a java.io.Reader).
Throws:
XNIException - Thrown by handler to signal an error.

Documentation is available at
http://download.oracle.com/docs/cd/E13222_01/wls/docs90
Copyright 2005 BEA Systems Inc.