Java Doc for XMLErrorReporter.java in  » 6.0-JDK-Modules » sjsxp » com » sun » xml » stream » 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 » 6.0 JDK Modules » sjsxp » com.sun.xml.stream 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.sun.xml.stream.XMLErrorReporter

All known Subclasses:   com.sun.xml.stream.StaxErrorReporter,
XMLErrorReporter
public class XMLErrorReporter implements XMLComponent(Code)
This class is a common element of all parser configurations and is used to report errors that occur. This component can be queried by parser components from the component manager using the following property ID:
 http://apache.org/xml/properties/internal/error-reporter
 

Errors are separated into domains that categorize a class of errors. In a parser configuration, the parser would register a MessageFormatter for each domain that is capable of localizing error messages and formatting them based on information about the error. Any parser component can invent new error domains and register additional message formatters to localize messages in those domains.

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

  • http://apache.org/xml/properties/internal/error-handler

This component can use the following features and properties but they are not required:

  • http://apache.org/xml/features/continue-after-fatal-error

See Also:   MessageFormatter
author:
   Eric Ye, IBM
author:
   Andy Clark, IBM
version:
   $Id: XMLErrorReporter.java,v 1.2 2006/04/01 06:01:49 jeffsuttor Exp $


Field Summary
final protected static  StringCONTINUE_AFTER_FATAL_ERROR
     Feature identifier: continue after fatal error.
final protected static  StringERROR_HANDLER
     Property identifier: error handler.
final public static  shortSEVERITY_ERROR
     Severity: error.
final public static  shortSEVERITY_FATAL_ERROR
     Severity: fatal error.
final public static  shortSEVERITY_WARNING
     Severity: warning.
protected  booleanfContinueAfterFatalError
     Continue after fatal error feature.
protected  XMLErrorHandlerfDefaultErrorHandler
     Default error handler.
protected  XMLErrorHandlerfErrorHandler
     Error handler.
protected  LocalefLocale
     The locale to be used to format error messages.
protected  XMLLocatorfLocator
     Document locator.
protected  HashtablefMessageFormatters
     Mapping of Message formatters for domains.

Constructor Summary
public  XMLErrorReporter()
     Constructs an error reporter with a locator.

Method Summary
public  XMLErrorHandlergetErrorHandler()
     Get the internal XMLErrrorHandler.
public  booleangetFeature(String featureId)
    
public  BooleangetFeatureDefault(String featureId)
     Returns the default state for a feature, or null if this component does not want to report a default value for this feature.
public  LocalegetLocale()
     Gets the current locale.
public  MessageFormattergetMessageFormatter(String domain)
     Returns the message formatter associated with the specified domain, or null if no message formatter is registered for that domain.
public  ObjectgetPropertyDefault(String propertyId)
     Returns the default state for a property, or null if this component does not want to report a default value for this property.
public  String[]getRecognizedFeatures()
     Returns a list of feature identifiers that are recognized by this component.
public  String[]getRecognizedProperties()
     Returns a list of property identifiers that are recognized by this component.
public  voidputMessageFormatter(String domain, MessageFormatter messageFormatter)
     Registers a message formatter for the specified domain.

Note: Registering a message formatter for a domain when there is already a formatter registered will cause the previous formatter to be lost.

public  MessageFormatterremoveMessageFormatter(String domain)
     Removes the message formatter for the specified domain and returns the removed message formatter.
public  voidreportError(String domain, String key, Object[] arguments, short severity)
     Reports an error.
public  voidreportError(XMLLocator location, String domain, String key, Object[] arguments, short severity)
     Reports an error at a specific location.
public  voidreset(XMLComponentManager componentManager)
     Resets the component.
public  voidsetDocumentLocator(XMLLocator locator)
     Sets the document locator.
public  voidsetFeature(String featureId, boolean state)
     Sets the state of a feature.
public  voidsetLocale(Locale locale)
     Sets the current locale.
public  voidsetProperty(String propertyId, Object value)
     Sets the value of a property.

Field Detail
CONTINUE_AFTER_FATAL_ERROR
final protected static String CONTINUE_AFTER_FATAL_ERROR(Code)
Feature identifier: continue after fatal error.



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



SEVERITY_ERROR
final public static short SEVERITY_ERROR(Code)
Severity: error. Common causes of errors are document structure and/or content that that does not conform to the grammar rules specified for the document. These are typically validation errors.



SEVERITY_FATAL_ERROR
final public static short SEVERITY_FATAL_ERROR(Code)
Severity: fatal error. Fatal errors are errors in the syntax of the XML document or invalid byte sequences for a given encoding. The XML 1.0 Specification mandates that errors of this type are not recoverable.

Note: The parser does have a "continue after fatal error" feature but it should be used with extreme caution and care.




SEVERITY_WARNING
final public static short SEVERITY_WARNING(Code)
Severity: warning. Warnings represent informational messages only that should not be considered serious enough to stop parsing or indicate an error in the document's validity.



fContinueAfterFatalError
protected boolean fContinueAfterFatalError(Code)
Continue after fatal error feature.



fDefaultErrorHandler
protected XMLErrorHandler fDefaultErrorHandler(Code)
Default error handler. This error handler is only used in the absence of a registered error handler so that errors are not "swallowed" silently. This is one of the most common "problems" reported by users of the parser.



fErrorHandler
protected XMLErrorHandler fErrorHandler(Code)
Error handler.



fLocale
protected Locale fLocale(Code)
The locale to be used to format error messages.



fLocator
protected XMLLocator fLocator(Code)
Document locator.



fMessageFormatters
protected Hashtable fMessageFormatters(Code)
Mapping of Message formatters for domains.




Constructor Detail
XMLErrorReporter
public XMLErrorReporter()(Code)
Constructs an error reporter with a locator.




Method Detail
getErrorHandler
public XMLErrorHandler getErrorHandler()(Code)
Get the internal XMLErrrorHandler.



getFeature
public boolean getFeature(String featureId) throws XMLConfigurationException(Code)



getFeatureDefault
public Boolean getFeatureDefault(String featureId)(Code)
Returns the default state for a feature, or null if this component does not want to report a default value for this feature.
Parameters:
  featureId - The feature identifier.
since:
   Xerces 2.2.0



getLocale
public Locale getLocale()(Code)
Gets the current locale. the current Locale



getMessageFormatter
public MessageFormatter getMessageFormatter(String domain)(Code)
Returns the message formatter associated with the specified domain, or null if no message formatter is registered for that domain.
Parameters:
  domain - The domain of the message formatter.



getPropertyDefault
public Object getPropertyDefault(String propertyId)(Code)
Returns the default state for a property, or null if this component does not want to report a default value for this property.
Parameters:
  propertyId - The property identifier.
since:
   Xerces 2.2.0



getRecognizedFeatures
public String[] getRecognizedFeatures()(Code)
Returns a list of feature identifiers that are recognized by this component. This method may return null if no features are recognized by this component.



getRecognizedProperties
public String[] getRecognizedProperties()(Code)
Returns a list of property identifiers that are recognized by this component. This method may return null if no properties are recognized by this component.



putMessageFormatter
public void putMessageFormatter(String domain, MessageFormatter messageFormatter)(Code)
Registers a message formatter for the specified domain.

Note: Registering a message formatter for a domain when there is already a formatter registered will cause the previous formatter to be lost. This method replaces any previously registered message formatter for the specified domain.
Parameters:
  domain -
Parameters:
  messageFormatter -




removeMessageFormatter
public MessageFormatter removeMessageFormatter(String domain)(Code)
Removes the message formatter for the specified domain and returns the removed message formatter.
Parameters:
  domain - The domain of the message formatter.



reportError
public void reportError(String domain, String key, Object[] arguments, short severity) throws XNIException(Code)
Reports an error. The error message passed to the error handler is formatted for the locale by the message formatter installed for the specified error domain.
Parameters:
  domain - The error domain.
Parameters:
  key - The key of the error message.
Parameters:
  arguments - The replacement arguments for the error message,if needed.
Parameters:
  severity - The severity of the error.
See Also:   XMLErrorReporter.SEVERITY_WARNING
See Also:   XMLErrorReporter.SEVERITY_ERROR
See Also:   XMLErrorReporter.SEVERITY_FATAL_ERROR



reportError
public void reportError(XMLLocator location, String domain, String key, Object[] arguments, short severity) throws XNIException(Code)
Reports an error at a specific location.
Parameters:
  location - The error location.
Parameters:
  domain - The error domain.
Parameters:
  key - The key of the error message.
Parameters:
  arguments - The replacement arguments for the error message,if needed.
Parameters:
  severity - The severity of the error.
See Also:   XMLErrorReporter.SEVERITY_WARNING
See Also:   XMLErrorReporter.SEVERITY_ERROR
See Also:   XMLErrorReporter.SEVERITY_FATAL_ERROR



reset
public void reset(XMLComponentManager componentManager) throws XNIException(Code)
Resets the component. The component can query the component manager about any features and properties that affect the operation of the component.
Parameters:
  componentManager - The component manager.
throws:
  SAXException - Thrown by component on initialization error.For example, if a feature or property isrequired for the operation of the component, thecomponent manager may throw aSAXNotRecognizedException or aSAXNotSupportedException.



setDocumentLocator
public void setDocumentLocator(XMLLocator locator)(Code)
Sets the document locator.
Parameters:
  locator - The locator.



setFeature
public void setFeature(String featureId, boolean state) throws XMLConfigurationException(Code)
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.
Parameters:
  featureId - The feature identifier.
Parameters:
  state - The state of the feature.
throws:
  SAXNotRecognizedException - The component should not throwthis exception.
throws:
  SAXNotSupportedException - The component should not throwthis exception.




setLocale
public void setLocale(Locale locale)(Code)
Sets the current locale.
Parameters:
  locale - The new locale.



setProperty
public void setProperty(String propertyId, Object value) throws XMLConfigurationException(Code)
Sets the value of a property. This method is called by the component manager any time after reset when a property changes value.

Note: Components should silently ignore properties that do not affect the operation of the component.
Parameters:
  propertyId - The property identifier.
Parameters:
  value - The value of the property.
throws:
  SAXNotRecognizedException - The component should not throwthis exception.
throws:
  SAXNotSupportedException - The component should not throwthis exception.




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.