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
FieldsModifier and TypeFieldDescriptionprotected final booleanIf false, any use of extensions is reported as an error.Set of namespace URIs that designates enabled extensions.protected final NamespaceSupportRemembers in-scope namespace bindings.protected final StringNamespace URI of the target schema language. -
Constructor Summary
ConstructorsConstructorDescriptionAbstractExtensionBindingChecker(String schemaLanguage, Options options, ErrorHandler handler) -
Method Summary
Modifier and TypeMethodDescriptionprotected final voidcheckAndEnable(String uri) Verify that the given URI is indeed a valid extension namespace URI, and if so enable it.voidendPrefixMapping(String prefix) protected final SAXParseExceptionReports an error and returns the created SAXParseExceptionprotected final booleanisRecognizableExtension(String namespaceUri) Checks if the given namespace URI can be potentially recognized by this XJC.protected final booleanisSupportedExtension(String namespaceUri) Checks if the given namespace URI is supported as the extension bindings.voidsetDocumentLocator(Locator locator) voidvoidstartPrefixMapping(String prefix, String uri) protected final voidverifyTagName(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 voidReports a warning.Methods inherited from class com.sun.tools.xjc.util.SubtreeCutter
endElement, isCutting, setContentHandler, startCutting, startElementMethods 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:
setDocumentLocatorin interfaceContentHandler- Overrides:
setDocumentLocatorin classXMLFilterImpl
-
startDocument
- Specified by:
startDocumentin interfaceContentHandler- Overrides:
startDocumentin classSubtreeCutter- Throws:
SAXException
-
startPrefixMapping
- Specified by:
startPrefixMappingin interfaceContentHandler- Overrides:
startPrefixMappingin classXMLFilterImpl- Throws:
SAXException
-
endPrefixMapping
- Specified by:
endPrefixMappingin interfaceContentHandler- Overrides:
endPrefixMappingin classXMLFilterImpl- Throws:
SAXException
-
error
Reports an error and returns the created SAXParseException- Throws:
SAXException
-
warning
Reports a warning.- Throws:
SAXException
-