|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.xerces.impl.XMLScanner
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:
Inner Class Summary | |
protected static class |
XMLScanner.AttrEntityStack
A stack for keeping track of entity offsets and lengths in attribute values. |
Field Summary | |
protected static boolean |
DEBUG_ATTR_ENTITIES
Debug attribute entities. |
protected static boolean |
DEBUG_ATTR_NORMALIZATION
Debug attribute normalization. |
protected java.lang.String |
fAmpSymbol
Symbol: "amp". |
protected java.lang.String |
fAposSymbol
Symbol: "apos". |
protected XMLScanner.AttrEntityStack |
fAttributeEntityStack
Attribute entity stack. |
protected int |
fAttributeOffset
Attribute value offset. |
protected java.lang.String |
fCharRefLiteral
Literal value of the last character refence scanned. |
protected java.lang.String |
fEncodingSymbol
Symbol: "encoding". |
protected int |
fEntityDepth
Entity depth. |
protected XMLEntityManager |
fEntityManager
Entity manager. |
protected XMLEntityScanner |
fEntityScanner
Entity scanner. |
protected XMLErrorReporter |
fErrorReporter
Error reporter. |
protected java.lang.String |
fGtSymbol
Symbol: "gt". |
protected java.lang.String |
fLtSymbol
Symbol: "lt". |
protected boolean |
fNotifyCharRefs
Character references resolution. |
protected java.lang.String |
fQuotSymbol
Symbol: "quot". |
protected boolean |
fScanningAttribute
Scanning attribute. |
protected java.lang.String |
fStandaloneSymbol
Symbol: "standalone". |
protected org.apache.xerces.xni.XMLString |
fString
String. |
protected XMLStringBuffer |
fStringBuffer
String buffer. |
protected XMLStringBuffer |
fStringBuffer2
String buffer. |
protected java.lang.String[] |
fStrings
Array of 3 strings. |
protected SymbolTable |
fSymbolTable
Symbol table. |
protected boolean |
fValidation
Validation. |
protected java.lang.String |
fVersionSymbol
Symbol: "version". |
protected static java.lang.String |
NOTIFY_CHAR_REFS
|
protected static java.lang.String |
VALIDATION
|
Constructor Summary | |
XMLScanner()
|
Method Summary | |
void |
endEntity(java.lang.String name)
This method notifies the end of an entity. |
protected void |
normalizeWhitespace(org.apache.xerces.xni.XMLString value)
Normalize whitespace in an XMLString converting all whitespace characters to space characters. |
protected void |
reportFatalError(java.lang.String msgId,
java.lang.Object[] args)
Convenience function used in all XML scanners. |
void |
reset(org.apache.xerces.xni.parser.XMLComponentManager componentManager)
Resets the component. |
protected void |
scanAttributeValue(org.apache.xerces.xni.XMLString value,
java.lang.String atName,
org.apache.xerces.xni.XMLAttributes attributes,
int attrIndex,
boolean checkEntities)
Scans an attribute value and normalizes whitespace converting all whitespace characters to space characters. |
protected int |
scanCharReferenceValue(XMLStringBuffer buf)
Scans a character reference and append the corresponding chars to the specified buffer. |
protected void |
scanComment(XMLStringBuffer text)
Scans a comment. |
protected void |
scanExternalID(java.lang.String[] identifiers,
boolean optionalSystemId)
Scans External ID and return the public and system IDs. |
protected void |
scanPI()
Scans a processing instruction. |
protected void |
scanPIData(java.lang.String target,
org.apache.xerces.xni.XMLString data)
Scans a processing data. |
java.lang.String |
scanPseudoAttribute(boolean scanningTextDecl,
org.apache.xerces.xni.XMLString value)
Scans a pseudo attribute. |
protected boolean |
scanPubidLiteral(org.apache.xerces.xni.XMLString literal)
Scans public ID literal. |
protected boolean |
scanSurrogates(XMLStringBuffer buf)
Scans surrogates and append them to the specified buffer. |
protected void |
scanXMLDeclOrTextDecl(boolean scanningTextDecl,
java.lang.String[] pseudoAttributeValues)
Scans an XML or text declaration. |
void |
setFeature(java.lang.String featureId,
boolean value)
Sets the state of a feature. |
void |
setProperty(java.lang.String propertyId,
java.lang.Object value)
Sets the value of a property during parsing. |
void |
startEntity(java.lang.String name,
java.lang.String publicId,
java.lang.String systemId,
java.lang.String baseSystemId,
java.lang.String encoding)
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 |
Field Detail |
protected boolean fValidation
protected SymbolTable fSymbolTable
protected XMLEntityManager fEntityManager
protected XMLEntityScanner fEntityScanner
protected int fEntityDepth
protected org.apache.xerces.xni.XMLString fString
protected XMLStringBuffer fStringBuffer
protected XMLStringBuffer fStringBuffer2
protected java.lang.String[] fStrings
protected XMLErrorReporter fErrorReporter
protected boolean fNotifyCharRefs
protected java.lang.String fCharRefLiteral
protected XMLScanner.AttrEntityStack fAttributeEntityStack
protected int fAttributeOffset
protected boolean fScanningAttribute
protected static final boolean DEBUG_ATTR_ENTITIES
protected static final boolean DEBUG_ATTR_NORMALIZATION
protected java.lang.String fVersionSymbol
protected java.lang.String fEncodingSymbol
protected java.lang.String fStandaloneSymbol
protected java.lang.String fAmpSymbol
protected java.lang.String fLtSymbol
protected java.lang.String fGtSymbol
protected java.lang.String fQuotSymbol
protected java.lang.String fAposSymbol
protected static final java.lang.String VALIDATION
protected static final java.lang.String NOTIFY_CHAR_REFS
Constructor Detail |
public XMLScanner()
Method Detail |
public void reset(org.apache.xerces.xni.parser.XMLComponentManager componentManager) throws org.apache.xerces.xni.parser.XMLConfigurationException
componentManager
- The component manager.public void setProperty(java.lang.String propertyId, java.lang.Object value) throws org.apache.xerces.xni.parser.XMLConfigurationException
propertyId
- value
- public void setFeature(java.lang.String featureId, boolean value) throws org.apache.xerces.xni.parser.XMLConfigurationException
Note: Components should silently ignore features that do not affect the operation of the component.
featureId
- The feature identifier.state
- The state of the feature.protected void scanXMLDeclOrTextDecl(boolean scanningTextDecl, java.lang.String[] pseudoAttributeValues) throws java.io.IOException, org.apache.xerces.xni.XNIException
[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 ::= ''
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.public java.lang.String scanPseudoAttribute(boolean scanningTextDecl, org.apache.xerces.xni.XMLString value) throws java.io.IOException, org.apache.xerces.xni.XNIException
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.protected void scanPI() throws java.io.IOException, org.apache.xerces.xni.XNIException
[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.
protected void scanPIData(java.lang.String target, org.apache.xerces.xni.XMLString data) throws java.io.IOException, org.apache.xerces.xni.XNIException
target
- The PI targetdata
- The string to fill in with the dataprotected void scanComment(XMLStringBuffer text) throws java.io.IOException, org.apache.xerces.xni.XNIException
[15] Comment ::= '<!--' ((Char - '-') | ('-' (Char - '-')))* '-->'
Note: Called after scanning past '<!--' Note: This method uses fString, anything in it at the time of calling is lost.
text
- The buffer to fill in with the text.protected void scanAttributeValue(org.apache.xerces.xni.XMLString value, java.lang.String atName, org.apache.xerces.xni.XMLAttributes attributes, int attrIndex, boolean checkEntities) throws java.io.IOException, org.apache.xerces.xni.XNIException
value
- The XMLString to fill in with the 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.protected void scanExternalID(java.lang.String[] identifiers, boolean optionalSystemId) throws java.io.IOException, org.apache.xerces.xni.XNIException
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.protected boolean scanPubidLiteral(org.apache.xerces.xni.XMLString literal) throws java.io.IOException, org.apache.xerces.xni.XNIException
literal
- The string to fill in with the public ID literal.protected void normalizeWhitespace(org.apache.xerces.xni.XMLString value)
public void startEntity(java.lang.String name, java.lang.String publicId, java.lang.String systemId, java.lang.String baseSystemId, java.lang.String encoding) throws org.apache.xerces.xni.XNIException
name
- The name of the entity.publicId
- The public identifier of the entity if the entity
is external, null otherwise.systemId
- The system identifier of the entity if the entity
is external, null otherwise.baseSystemId
- The base system identifier of the entity if
the entity is external, null otherwise.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).public void endEntity(java.lang.String name) throws org.apache.xerces.xni.XNIException
name
- The name of the entity.protected int scanCharReferenceValue(XMLStringBuffer buf) throws java.io.IOException, org.apache.xerces.xni.XNIException
[66] CharRef ::= '' [0-9]+ ';' | '' [0-9a-fA-F]+ ';'Note: This method uses fStringBuffer, anything in it at the time of calling is lost.
buf
- the character buffer to append chars toprotected boolean scanSurrogates(XMLStringBuffer buf) throws java.io.IOException, org.apache.xerces.xni.XNIException
Note: This assumes the current char has already been identified as a high surrogate.
buf
- The StringBuffer to append the read surrogates to.protected void reportFatalError(java.lang.String msgId, java.lang.Object[] args) throws org.apache.xerces.xni.XNIException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |