Package com.sun.tools.xjc.reader
Class AbstractExtensionBindingChecker
java.lang.Object
org.xml.sax.helpers.XMLFilterImpl
com.sun.tools.xjc.util.SubtreeCutter
com.sun.tools.xjc.reader.AbstractExtensionBindingChecker
- All Implemented Interfaces:
ContentHandler
,DTDHandler
,EntityResolver
,ErrorHandler
,XMLFilter
,XMLReader
- Direct Known Subclasses:
ExtensionBindingChecker
Common code between
DTDExtensionBindingChecker
and ExtensionBindingChecker
.- Author:
- Kohsuke Kawaguchi
-
Field Summary
Modifier and TypeFieldDescriptionprotected final boolean
If false, any use of extensions is reported as an error.Set of namespace URIs that designates enabled extensions.protected final NamespaceSupport
Remembers in-scope namespace bindings.protected final String
Namespace URI of the target schema language. -
Constructor Summary
ConstructorDescriptionAbstractExtensionBindingChecker
(String schemaLanguage, Options options, ErrorHandler handler) -
Method Summary
Modifier and TypeMethodDescriptionprotected final void
checkAndEnable
(String uri) Verify that the given URI is indeed a valid extension namespace URI, and if so enable it.void
endPrefixMapping
(String prefix) protected final SAXParseException
Reports an error and returns the created SAXParseExceptionprotected final boolean
isRecognizableExtension
(String namespaceUri) Checks if the given namespace URI can be potentially recognized by this XJC.protected final boolean
isSupportedExtension
(String namespaceUri) Checks if the given namespace URI is supported as the extension bindings.void
setDocumentLocator
(Locator locator) void
void
startPrefixMapping
(String prefix, String uri) protected final void
verifyTagName
(String namespaceURI, String localName, String qName) If the tag name belongs to a plugin namespace-wise, check its local name to make sure it's correct.protected final void
Reports a warning.Methods inherited from class com.sun.tools.xjc.util.SubtreeCutter
endElement, isCutting, setContentHandler, startCutting, startElement
Methods inherited from class org.xml.sax.helpers.XMLFilterImpl
characters, endDocument, error, fatalError, getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getParent, getProperty, ignorableWhitespace, notationDecl, parse, parse, processingInstruction, resolveEntity, setDTDHandler, setEntityResolver, setErrorHandler, setFeature, setParent, setProperty, skippedEntity, unparsedEntityDecl, warning
-
Field Details
-
nsSupport
Remembers in-scope namespace bindings. -
enabledExtensions
Set of namespace URIs that designates enabled extensions. -
schemaLanguage
Namespace URI of the target schema language. Elements in this namespace are always allowed. -
allowExtensions
protected final boolean allowExtensionsIf false, any use of extensions is reported as an error.
-
-
Constructor Details
-
AbstractExtensionBindingChecker
public AbstractExtensionBindingChecker(String schemaLanguage, Options options, ErrorHandler handler) - Parameters:
handler
- This error handler will receive detected errors.
-
-
Method Details
-
checkAndEnable
Verify that the given URI is indeed a valid extension namespace URI, and if so enable it.This method does all the error handling.
- Throws:
SAXException
-
verifyTagName
protected final void verifyTagName(String namespaceURI, String localName, String qName) throws SAXException If the tag name belongs to a plugin namespace-wise, check its local name to make sure it's correct.- Throws:
SAXException
-
isSupportedExtension
Checks if the given namespace URI is supported as the extension bindings. -
isRecognizableExtension
Checks if the given namespace URI can be potentially recognized by this XJC. -
setDocumentLocator
- Specified by:
setDocumentLocator
in interfaceContentHandler
- Overrides:
setDocumentLocator
in classXMLFilterImpl
-
startDocument
- Specified by:
startDocument
in interfaceContentHandler
- Overrides:
startDocument
in classSubtreeCutter
- Throws:
SAXException
-
startPrefixMapping
- Specified by:
startPrefixMapping
in interfaceContentHandler
- Overrides:
startPrefixMapping
in classXMLFilterImpl
- Throws:
SAXException
-
endPrefixMapping
- Specified by:
endPrefixMapping
in interfaceContentHandler
- Overrides:
endPrefixMapping
in classXMLFilterImpl
- Throws:
SAXException
-
error
Reports an error and returns the created SAXParseException- Throws:
SAXException
-
warning
Reports a warning.- Throws:
SAXException
-