Java Doc for BasicParserConfiguration.java in  » XML » xerces-2_9_1 » org » apache » xerces » parsers » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » XML » xerces 2_9_1 » org.apache.xerces.parsers 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   org.apache.xerces.util.ParserConfigurationSettings
      org.apache.xerces.parsers.BasicParserConfiguration

All known Subclasses:   org.apache.xerces.parsers.NonValidatingConfiguration,  org.apache.xerces.impl.xs.opti.SchemaParsingConfig,  org.apache.xerces.parsers.DTDConfiguration,
BasicParserConfiguration
abstract public class BasicParserConfiguration extends ParserConfigurationSettings implements XMLParserConfiguration(Code)
A very basic parser configuration. This configuration class can be used as a base class for custom parser configurations. The basic parser configuration creates the symbol table (if not specified at construction time) and manages all of the recognized features and properties.

The basic parser configuration does not mandate any particular pipeline configuration or the use of specific components except for the symbol table. If even this is too much for a basic parser configuration, the programmer can create a new configuration class that implements the XMLParserConfiguration interface.

Subclasses of the basic parser configuration can add their own recognized features and properties by calling the addRecognizedFeature and addRecognizedProperty methods, respectively.

The basic parser configuration assumes that the configuration will be made up of various parser components that implement the XMLComponent interface. If subclasses of this configuration create their own components for use in the parser configuration, then each component should be added to the list of components by calling the addComponent method. The basic parser configuration will make sure to call the reset method of each registered component before parsing an instance document.

This class recognizes the following features and properties:

  • Features
    • http://xml.org/sax/features/validation
    • http://xml.org/sax/features/namespaces
    • http://xml.org/sax/features/external-general-entities
    • http://xml.org/sax/features/external-parameter-entities
  • Properties
    • http://xml.org/sax/properties/xml-string
    • http://apache.org/xml/properties/internal/symbol-table
    • http://apache.org/xml/properties/internal/error-handler
    • http://apache.org/xml/properties/internal/entity-resolver

author:
   Arnaud Le Hors, IBM
author:
   Andy Clark, IBM
version:
   $Id: BasicParserConfiguration.java 447239 2006-09-18 05:08:26Z mrglavas $


Field Summary
final protected static  StringENTITY_RESOLVER
     Property identifier: entity resolver.
final protected static  StringERROR_HANDLER
     Property identifier: error handler.
final protected static  StringEXTERNAL_GENERAL_ENTITIES
     Feature identifier: external general entities.
final protected static  StringEXTERNAL_PARAMETER_ENTITIES
     Feature identifier: external parameter entities.
final protected static  StringNAMESPACES
     Feature identifier: namespaces.
final protected static  StringSYMBOL_TABLE
     Property identifier: symbol table.
final protected static  StringVALIDATION
     Feature identifier: validation.
final protected static  StringXML_STRING
     Property identifier: xml string.
protected  ArrayListfComponents
     Components.
protected  XMLDTDContentModelHandlerfDTDContentModelHandler
     The DTD content model handler.
protected  XMLDTDHandlerfDTDHandler
     The DTD handler.
protected  XMLDocumentHandlerfDocumentHandler
     The document handler.
protected  XMLDocumentSourcefLastComponent
    
protected  LocalefLocale
     Locale.
protected  SymbolTablefSymbolTable
     Symbol table.

Constructor Summary
protected  BasicParserConfiguration()
     Default Constructor.
protected  BasicParserConfiguration(SymbolTable symbolTable)
     Constructs a parser configuration using the specified symbol table.
protected  BasicParserConfiguration(SymbolTable symbolTable, XMLComponentManager parentSettings)
     Constructs a parser configuration using the specified symbol table and parent settings.

Method Summary
protected  voidaddComponent(XMLComponent component)
     Adds a component to the parser configuration.
protected  voidcheckFeature(String featureId)
     Check a feature.
protected  voidcheckProperty(String propertyId)
     Check a property.
public  XMLDTDContentModelHandlergetDTDContentModelHandler()
     Returns the registered DTD content model handler.
public  XMLDTDHandlergetDTDHandler()
     Returns the registered DTD handler.
public  XMLDocumentHandlergetDocumentHandler()
     Returns the registered document handler.
public  XMLEntityResolvergetEntityResolver()
     Return the current entity resolver.
public  XMLErrorHandlergetErrorHandler()
     Return the current error handler.
public  LocalegetLocale()
     Returns the locale.
abstract public  voidparse(XMLInputSource inputSource)
     Parse an XML document.

The parser can use this method to instruct this configuration to begin parsing an XML document from any valid input source (a character stream, a byte stream, or a URI).

Parsers may not invoke this method while a parse is in progress. Once a parse is complete, the parser may then parse another XML document.

This method is synchronous: it will not return until parsing has ended.

protected  voidreset()
    
public  voidsetDTDContentModelHandler(XMLDTDContentModelHandler handler)
     Sets the DTD content model handler.
public  voidsetDTDHandler(XMLDTDHandler dtdHandler)
     Sets the DTD handler.
public  voidsetDocumentHandler(XMLDocumentHandler documentHandler)
     Sets the document handler on the last component in the pipeline to receive information about the document.
public  voidsetEntityResolver(XMLEntityResolver resolver)
     Sets the resolver used to resolve external entities.
public  voidsetErrorHandler(XMLErrorHandler errorHandler)
     Allow an application to register an error event handler.

If the application does not register an error handler, all error events reported by the SAX parser will be silently ignored; however, normal processing may not continue.

public  voidsetFeature(String featureId, boolean state)
     Set the state of a feature. Set the state of any feature in a SAX2 parser.
public  voidsetLocale(Locale locale)
     Set the locale to use for messages.
public  voidsetProperty(String propertyId, Object value)
    

Field Detail
ENTITY_RESOLVER
final protected static String ENTITY_RESOLVER(Code)
Property identifier: entity resolver.



ERROR_HANDLER
final protected static String ERROR_HANDLER(Code)
Property identifier: error handler.



EXTERNAL_GENERAL_ENTITIES
final protected static String EXTERNAL_GENERAL_ENTITIES(Code)
Feature identifier: external general entities.



EXTERNAL_PARAMETER_ENTITIES
final protected static String EXTERNAL_PARAMETER_ENTITIES(Code)
Feature identifier: external parameter entities.



NAMESPACES
final protected static String NAMESPACES(Code)
Feature identifier: namespaces.



SYMBOL_TABLE
final protected static String SYMBOL_TABLE(Code)
Property identifier: symbol table.



VALIDATION
final protected static String VALIDATION(Code)
Feature identifier: validation.



XML_STRING
final protected static String XML_STRING(Code)
Property identifier: xml string.



fComponents
protected ArrayList fComponents(Code)
Components.



fDTDContentModelHandler
protected XMLDTDContentModelHandler fDTDContentModelHandler(Code)
The DTD content model handler.



fDTDHandler
protected XMLDTDHandler fDTDHandler(Code)
The DTD handler.



fDocumentHandler
protected XMLDocumentHandler fDocumentHandler(Code)
The document handler.



fLastComponent
protected XMLDocumentSource fLastComponent(Code)
Last component in the document pipeline



fLocale
protected Locale fLocale(Code)
Locale.



fSymbolTable
protected SymbolTable fSymbolTable(Code)
Symbol table.




Constructor Detail
BasicParserConfiguration
protected BasicParserConfiguration()(Code)
Default Constructor.



BasicParserConfiguration
protected BasicParserConfiguration(SymbolTable symbolTable)(Code)
Constructs a parser configuration using the specified symbol table.
Parameters:
  symbolTable - The symbol table to use.



BasicParserConfiguration
protected BasicParserConfiguration(SymbolTable symbolTable, XMLComponentManager parentSettings)(Code)
Constructs a parser configuration using the specified symbol table and parent settings.
Parameters:
  symbolTable - The symbol table to use.
Parameters:
  parentSettings - The parent settings.




Method Detail
addComponent
protected void addComponent(XMLComponent component)(Code)
Adds a component to the parser configuration. This method will also add all of the component's recognized features and properties to the list of default recognized features and properties.
Parameters:
  component - The component to add.



checkFeature
protected void checkFeature(String featureId) throws XMLConfigurationException(Code)
Check a feature. If feature is know and supported, this method simply returns. Otherwise, the appropriate exception is thrown.
Parameters:
  featureId - The unique identifier (URI) of the feature.
throws:
  XMLConfigurationException - Thrown for configuration error.In general, components shouldonly throw this exception ifit is reallya critical error.



checkProperty
protected void checkProperty(String propertyId) throws XMLConfigurationException(Code)
Check a property. If the property is known and supported, this method simply returns. Otherwise, the appropriate exception is thrown.
Parameters:
  propertyId - The unique identifier (URI) of the propertybeing set.
exception:
  org.apache.xerces.xni.parser.XMLConfigurationException - If therequested feature is not known or supported.



getDTDContentModelHandler
public XMLDTDContentModelHandler getDTDContentModelHandler()(Code)
Returns the registered DTD content model handler.



getDTDHandler
public XMLDTDHandler getDTDHandler()(Code)
Returns the registered DTD handler.



getDocumentHandler
public XMLDocumentHandler getDocumentHandler()(Code)
Returns the registered document handler.



getEntityResolver
public XMLEntityResolver getEntityResolver()(Code)
Return the current entity resolver. The current entity resolver, or null if nonehas been registered.
See Also:   BasicParserConfiguration.setEntityResolver



getErrorHandler
public XMLErrorHandler getErrorHandler()(Code)
Return the current error handler. The current error handler, or null if nonehas been registered.
See Also:   BasicParserConfiguration.setErrorHandler



getLocale
public Locale getLocale()(Code)
Returns the locale.



parse
abstract public void parse(XMLInputSource inputSource) throws XNIException, IOException(Code)
Parse an XML document.

The parser can use this method to instruct this configuration to begin parsing an XML document from any valid input source (a character stream, a byte stream, or a URI).

Parsers may not invoke this method while a parse is in progress. Once a parse is complete, the parser may then parse another XML document.

This method is synchronous: it will not return until parsing has ended. If a client application wants to terminate parsing early, it should throw an exception.
Parameters:
  inputSource - The input source for the top-level of theXML document.
exception:
  XNIException - Any XNI exception, possibly wrapping another exception.
exception:
  IOException - An IO exception from the parser, possiblyfrom a byte stream or character streamsupplied by the parser.




reset
protected void reset() throws XNIException(Code)
reset all components before parsing and namespace context



setDTDContentModelHandler
public void setDTDContentModelHandler(XMLDTDContentModelHandler handler)(Code)
Sets the DTD content model handler.
Parameters:
  handler - The DTD content model handler.



setDTDHandler
public void setDTDHandler(XMLDTDHandler dtdHandler)(Code)
Sets the DTD handler.
Parameters:
  dtdHandler - The DTD handler.



setDocumentHandler
public void setDocumentHandler(XMLDocumentHandler documentHandler)(Code)
Sets the document handler on the last component in the pipeline to receive information about the document.
Parameters:
  documentHandler - The document handler.



setEntityResolver
public void setEntityResolver(XMLEntityResolver resolver)(Code)
Sets the resolver used to resolve external entities. The EntityResolver interface supports resolution of public and system identifiers.
Parameters:
  resolver - The new entity resolver. Passing a null value willuninstall the currently installed resolver.



setErrorHandler
public void setErrorHandler(XMLErrorHandler errorHandler)(Code)
Allow an application to register an error event handler.

If the application does not register an error handler, all error events reported by the SAX parser will be silently ignored; however, normal processing may not continue. It is highly recommended that all SAX applications implement an error handler to avoid unexpected bugs.

Applications may register a new or different handler in the middle of a parse, and the SAX parser must begin using the new handler immediately.


Parameters:
  errorHandler - The error handler.
exception:
  java.lang.NullPointerException - If the handler argument is null.
See Also:   BasicParserConfiguration.getErrorHandler



setFeature
public void setFeature(String featureId, boolean state) throws XMLConfigurationException(Code)
Set the state of a feature. Set the state of any feature in a SAX2 parser. The parser might not recognize the feature, and if it does recognize it, it might not be able to fulfill the request.
Parameters:
  featureId - The unique identifier (URI) of the feature.
Parameters:
  state - The requested state of the feature (true or false).
exception:
  org.apache.xerces.xni.parser.XMLConfigurationException - If therequested feature is not known.



setLocale
public void setLocale(Locale locale) throws XNIException(Code)
Set the locale to use for messages.
Parameters:
  locale - The locale object to use for localization of messages.
exception:
  XNIException - Thrown if the parser does not support thespecified locale.



setProperty
public void setProperty(String propertyId, Object value) throws XMLConfigurationException(Code)
setProperty
Parameters:
  propertyId -
Parameters:
  value -



Fields inherited from org.apache.xerces.util.ParserConfigurationSettings
final protected static String PARSER_SETTINGS(Code)(Java Doc)
protected HashMap fFeatures(Code)(Java Doc)
protected XMLComponentManager fParentSettings(Code)(Java Doc)
protected HashMap fProperties(Code)(Java Doc)
protected ArrayList fRecognizedFeatures(Code)(Java Doc)
protected ArrayList fRecognizedProperties(Code)(Java Doc)

Methods inherited from org.apache.xerces.util.ParserConfigurationSettings
public void addRecognizedFeatures(String[] featureIds)(Code)(Java Doc)
public void addRecognizedProperties(String[] propertyIds)(Code)(Java Doc)
protected void checkFeature(String featureId) throws XMLConfigurationException(Code)(Java Doc)
protected void checkProperty(String propertyId) throws XMLConfigurationException(Code)(Java Doc)
public boolean getFeature(String featureId) throws XMLConfigurationException(Code)(Java Doc)
public Object getProperty(String propertyId) throws XMLConfigurationException(Code)(Java Doc)
public void setFeature(String featureId, boolean state) throws XMLConfigurationException(Code)(Java Doc)
public void setProperty(String propertyId, Object value) throws XMLConfigurationException(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.