Java Doc for XMLNamespaceBinder.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.XMLNamespaceBinder

XMLNamespaceBinder
public class XMLNamespaceBinder implements XMLComponent,XMLDocumentFilter(Code)
This class performs namespace binding on the startElement and endElement method calls and passes all other methods through to the registered document handler. This class can be configured to only pass the start and end prefix mappings (start/endPrefixMapping).

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

  • http://xml.org/sax/features/namespaces
  • http://apache.org/xml/properties/internal/symbol-table
  • http://apache.org/xml/properties/internal/error-reporter

author:
   Andy Clark, IBM
version:
   $Id: XMLNamespaceBinder.java,v 1.2 2006/04/01 06:01:48 jeffsuttor Exp $


Field Summary
final protected static  StringERROR_REPORTER
     Property identifier: error reporter.
final protected static  StringNAMESPACES
     Feature identifier: namespaces.
final protected static  StringSYMBOL_TABLE
     Property identifier: symbol table.
protected  XMLDocumentHandlerfDocumentHandler
     Document handler.
protected  XMLDocumentSourcefDocumentSource
    
protected  XMLErrorReporterfErrorReporter
     Error reporter.
protected  NamespaceSupportfNamespaceSupport
     Namespace support.
protected  booleanfNamespaces
     Namespaces.
protected  booleanfOnlyPassPrefixMappingEvents
     Only pass start and end prefix mapping events.
protected  SymbolTablefSymbolTable
     Symbol table.

Constructor Summary
public  XMLNamespaceBinder()
     Default constructor.
public  XMLNamespaceBinder(NamespaceContext namespaceContext)
     Constructs a namespace binder that shares the specified namespace context during each parse.

Method Summary
public  voidcharacters(XMLString text, Augmentations augs)
     Character content.
public  voidcomment(XMLString text, Augmentations augs)
     A comment.
public  voiddoctypeDecl(String rootElement, String publicId, String systemId, Augmentations augs)
     Notifies of the presence of the DOCTYPE line in the document.
public  voidemptyElement(QName element, XMLAttributes attributes, Augmentations augs)
     An empty element.
public  voidendCDATA(Augmentations augs)
     The end of a CDATA section.
public  voidendDocument(Augmentations augs)
     The end of the document.
public  voidendElement(QName element, Augmentations augs)
     The end of an element.
public  voidendGeneralEntity(String name, Augmentations augs)
     This method notifies the end of a general entity.
public  voidendPrefixMapping(String prefix, Augmentations augs)
     The end of a namespace prefix mapping.
public  XMLDocumentHandlergetDocumentHandler()
    
public  XMLDocumentSourcegetDocumentSource()
    
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  NamespaceContextgetNamespaceContext()
     Returns the current namespace context.
public  booleangetOnlyPassPrefixMappingEvents()
     Returns true if the namespace binder only passes the prefix mapping events to the registered document handler; false if the namespace binder passes all document events.
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.
protected  voidhandleEndElement(QName element, Augmentations augs, boolean isEmpty)
     Handles end element.
protected  voidhandleStartElement(QName element, XMLAttributes attributes, Augmentations augs, boolean isEmpty)
     Handles start element.
public  voidignorableWhitespace(XMLString text, Augmentations augs)
     Ignorable whitespace.
public  voidprocessingInstruction(String target, XMLString data, Augmentations augs)
     A processing instruction.
public  voidreset(XMLComponentManager componentManager)
     Resets the component.
public  voidsetDocumentHandler(XMLDocumentHandler documentHandler)
     Sets the document handler to receive information about the document.
public  voidsetDocumentSource(XMLDocumentSource source)
    
public  voidsetFeature(String featureId, boolean state)
     Sets the state of a feature.
public  voidsetOnlyPassPrefixMappingEvents(boolean onlyPassPrefixMappingEvents)
     Sets whether the namespace binder only passes the prefix mapping events to the registered document handler or passes all document events.
public  voidsetProperty(String propertyId, Object value)
     Sets the value of a property during parsing.
public  voidstartCDATA(Augmentations augs)
     The start of a CDATA section.
public  voidstartDocument(XMLLocator locator, String encoding, NamespaceContext namespaceContext, Augmentations augs)
     The start of the document.
Parameters:
  locator - The system identifier of the entity if the entityis external, null otherwise.
Parameters:
  encoding - The auto-detected IANA encoding name of the entitystream.
public  voidstartElement(QName element, XMLAttributes attributes, Augmentations augs)
     Binds the namespaces.
public  voidstartGeneralEntity(String name, XMLResourceIdentifier identifier, String encoding, Augmentations augs)
     This method notifies the start of a general entity.

Note: This method is not called for entity references appearing as part of attribute values.
Parameters:
  name - The name of the general entity.
Parameters:
  identifier - The resource identifier.
Parameters:
  encoding - The auto-detected IANA encoding name of the entitystream.

public  voidstartPrefixMapping(String prefix, String uri, Augmentations augs)
     The start of a namespace prefix mapping.
public  voidtextDecl(String version, String encoding, Augmentations augs)
     Notifies of the presence of a TextDecl line in an entity.
public  voidxmlDecl(String version, String encoding, String standalone, Augmentations augs)
     Notifies of the presence of an XMLDecl line in the document.

Field Detail
ERROR_REPORTER
final protected static String ERROR_REPORTER(Code)
Property identifier: error reporter.



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



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



fDocumentHandler
protected XMLDocumentHandler fDocumentHandler(Code)
Document handler.



fDocumentSource
protected XMLDocumentSource fDocumentSource(Code)



fErrorReporter
protected XMLErrorReporter fErrorReporter(Code)
Error reporter.



fNamespaceSupport
protected NamespaceSupport fNamespaceSupport(Code)
Namespace support.



fNamespaces
protected boolean fNamespaces(Code)
Namespaces.



fOnlyPassPrefixMappingEvents
protected boolean fOnlyPassPrefixMappingEvents(Code)
Only pass start and end prefix mapping events.



fSymbolTable
protected SymbolTable fSymbolTable(Code)
Symbol table.




Constructor Detail
XMLNamespaceBinder
public XMLNamespaceBinder()(Code)
Default constructor.



XMLNamespaceBinder
public XMLNamespaceBinder(NamespaceContext namespaceContext)(Code)
Constructs a namespace binder that shares the specified namespace context during each parse.
Parameters:
  namespaceContext - The shared context.




Method Detail
characters
public void characters(XMLString text, Augmentations augs) throws XNIException(Code)
Character content.
Parameters:
  text - The content.
Parameters:
  augs - Additional information that may include infoset augmentations
throws:
  XNIException - Thrown by handler to signal an error.



comment
public void comment(XMLString text, Augmentations augs) throws XNIException(Code)
A comment.
Parameters:
  text - The text in the comment.
Parameters:
  augs - Additional information that may include infoset augmentations
throws:
  XNIException - Thrown by application to signal an error.



doctypeDecl
public void doctypeDecl(String rootElement, String publicId, String systemId, Augmentations augs) throws XNIException(Code)
Notifies of the presence of the DOCTYPE line in the document.
Parameters:
  rootElement - The name of the root element.
Parameters:
  publicId - The public identifier if an external DTD or nullif the external DTD is specified using SYSTEM.
Parameters:
  systemId - The system identifier if an external DTD, nullotherwise.
Parameters:
  augs - Additional information that may include infoset augmentations
throws:
  XNIException - Thrown by handler to signal an error.



emptyElement
public void emptyElement(QName element, XMLAttributes attributes, Augmentations augs) throws XNIException(Code)
An empty element.
Parameters:
  element - The name of the element.
Parameters:
  attributes - The element attributes.
Parameters:
  augs - Additional information that may include infoset augmentations
throws:
  XNIException - Thrown by handler to signal an error.



endCDATA
public void endCDATA(Augmentations augs) throws XNIException(Code)
The end of a CDATA section.
Parameters:
  augs - Additional information that may include infoset augmentations
throws:
  XNIException - Thrown by handler to signal an error.



endDocument
public void endDocument(Augmentations augs) throws XNIException(Code)
The end of the document.
Parameters:
  augs - Additional information that may include infoset augmentations
throws:
  XNIException - Thrown by handler to signal an error.



endElement
public void endElement(QName element, Augmentations augs) throws XNIException(Code)
The end of an element.
Parameters:
  element - The name of the element.
Parameters:
  augs - Additional information that may include infoset augmentations
throws:
  XNIException - Thrown by handler to signal an error.



endGeneralEntity
public void endGeneralEntity(String name, Augmentations augs) throws XNIException(Code)
This method notifies the end of a general entity.

Note: This method is not called for entity references appearing as part of attribute values.
Parameters:
  name - The name of the entity.
Parameters:
  augs - Additional information that may include infoset augmentations
exception:
  XNIException - Thrown by handler to signal an error.




endPrefixMapping
public void endPrefixMapping(String prefix, Augmentations augs) throws XNIException(Code)
The end of a namespace prefix mapping. This method will only be called when namespace processing is enabled.
Parameters:
  prefix - The namespace prefix.
Parameters:
  augs - Additional information that may include infoset augmentations
throws:
  XNIException - Thrown by handler to signal an error.



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



getDocumentSource
public XMLDocumentSource getDocumentSource()(Code)
Returns the document source



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



getNamespaceContext
public NamespaceContext getNamespaceContext()(Code)
Returns the current namespace context.



getOnlyPassPrefixMappingEvents
public boolean getOnlyPassPrefixMappingEvents()(Code)
Returns true if the namespace binder only passes the prefix mapping events to the registered document handler; false if the namespace binder passes all document events.



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.



handleEndElement
protected void handleEndElement(QName element, Augmentations augs, boolean isEmpty) throws XNIException(Code)
Handles end element.



handleStartElement
protected void handleStartElement(QName element, XMLAttributes attributes, Augmentations augs, boolean isEmpty) throws XNIException(Code)
Handles start element.



ignorableWhitespace
public void ignorableWhitespace(XMLString text, Augmentations augs) throws XNIException(Code)
Ignorable whitespace. For this method to be called, the document source must have some way of determining that the text containing only whitespace characters should be considered ignorable. For example, the validator can determine if a length of whitespace characters in the document are ignorable based on the element content model.
Parameters:
  text - The ignorable whitespace.
Parameters:
  augs - Additional information that may include infoset augmentations
throws:
  XNIException - Thrown by handler to signal an error.



processingInstruction
public void processingInstruction(String target, XMLString data, Augmentations augs) throws XNIException(Code)
A processing instruction. Processing instructions consist of a target name and, optionally, text data. The data is only meaningful to the application.

Typically, a processing instruction's data will contain a series of pseudo-attributes. These pseudo-attributes follow the form of element attributes but are not parsed or presented to the application as anything other than text. The application is responsible for parsing the data.
Parameters:
  target - The target.
Parameters:
  data - The data or null if none specified.
Parameters:
  augs - Additional information that may include infoset augmentations
throws:
  XNIException - Thrown by handler to signal an 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.



setDocumentHandler
public void setDocumentHandler(XMLDocumentHandler documentHandler)(Code)
Sets the document handler to receive information about the document.



setDocumentSource
public void setDocumentSource(XMLDocumentSource source)(Code)
Sets the document source



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.




setOnlyPassPrefixMappingEvents
public void setOnlyPassPrefixMappingEvents(boolean onlyPassPrefixMappingEvents)(Code)
Sets whether the namespace binder only passes the prefix mapping events to the registered document handler or passes all document events.
Parameters:
  onlyPassPrefixMappingEvents - True to pass only the prefixmapping events; false to passall events.



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



startCDATA
public void startCDATA(Augmentations augs) throws XNIException(Code)
The start of a CDATA section.
Parameters:
  augs - Additional information that may include infoset augmentations
throws:
  XNIException - Thrown by handler to signal an error.



startDocument
public void startDocument(XMLLocator locator, String encoding, NamespaceContext namespaceContext, Augmentations augs) throws XNIException(Code)
The start of the document.
Parameters:
  locator - The system identifier of the entity if the entityis external, null otherwise.
Parameters:
  encoding - The auto-detected IANA encoding name of the entitystream. This value will be null in those situationswhere the entity encoding is not auto-detected (e.g.internal entities or a document entity that isparsed from a java.io.Reader).
Parameters:
  namespaceContext - The namespace context in effect at thestart of this document.This object represents the current context.Implementors of this class are responsiblefor copying the namespace bindings from thethe current context (and its parent contexts)if that information is important.
Parameters:
  augs - Additional information that may include infoset augmentations
throws:
  XNIException - Thrown by handler to signal an error.



startElement
public void startElement(QName element, XMLAttributes attributes, Augmentations augs) throws XNIException(Code)
Binds the namespaces. This method will handle calling the document handler to start the prefix mappings.

Note: This method makes use of the fAttributeQName variable. Any contents of the variable will be destroyed. Caller should copy the values out of this temporary variable before calling this method.
Parameters:
  element - The name of the element.
Parameters:
  attributes - The element attributes.
Parameters:
  augs - Additional information that may include infoset augmentations
throws:
  XNIException - Thrown by handler to signal an error.




startGeneralEntity
public void startGeneralEntity(String name, XMLResourceIdentifier identifier, String encoding, Augmentations augs) throws XNIException(Code)
This method notifies the start of a general entity.

Note: This method is not called for entity references appearing as part of attribute values.
Parameters:
  name - The name of the general entity.
Parameters:
  identifier - The resource identifier.
Parameters:
  encoding - The auto-detected IANA encoding name of the entitystream. This value will be null in those situationswhere the entity encoding is not auto-detected (e.g.internal entities or a document entity that isparsed from a java.io.Reader).
Parameters:
  augs - Additional information that may include infoset augmentations
exception:
  XNIException - Thrown by handler to signal an error.




startPrefixMapping
public void startPrefixMapping(String prefix, String uri, Augmentations augs) throws XNIException(Code)
The start of a namespace prefix mapping. This method will only be called when namespace processing is enabled.
Parameters:
  prefix - The namespace prefix.
Parameters:
  uri - The URI bound to the prefix.
Parameters:
  augs - Additional information that may include infoset augmentations
throws:
  XNIException - Thrown by handler to signal an error.



textDecl
public void textDecl(String version, String encoding, Augmentations augs) throws XNIException(Code)
Notifies of the presence of a TextDecl line in an entity. If present, this method will be called immediately following the startEntity call.

Note: This method will never be called for the document entity; it is only called for external general entities referenced in document content.

Note: This method is not called for entity references appearing as part of attribute values.
Parameters:
  version - The XML version, or null if not specified.
Parameters:
  encoding - The IANA encoding name of the entity.
Parameters:
  augs - Additional information that may include infoset augmentations
throws:
  XNIException - Thrown by handler to signal an error.




xmlDecl
public void xmlDecl(String version, String encoding, String standalone, Augmentations augs) throws XNIException(Code)
Notifies of the presence of an XMLDecl line in the document. If present, this method will be called immediately following the startDocument call.
Parameters:
  version - The XML version.
Parameters:
  encoding - The IANA encoding name of the document, or null ifnot specified.
Parameters:
  standalone - The standalone value, or null if not specified.
Parameters:
  augs - Additional information that may include infoset augmentations
throws:
  XNIException - Thrown by handler to signal an error.



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.