Top Description Fields Constructors Methods
com.sun.tools.xjc.reader

public abstract Class AbstractExtensionBindingChecker

extends SubtreeCutter
Class Inheritance
Known Direct Subclasses
com.sun.tools.xjc.reader.ExtensionBindingChecker, com.sun.tools.xjc.reader.dtd.bindinfo.DTDExtensionBindingChecker
Imports
java.util.Set, .HashSet, com.sun.tools.xjc.util.SubtreeCutter, com.sun.tools.xjc.Options, .Plugin, org.glassfish.jaxb.core.v2.util.EditDistance, org.xml.sax.helpers.NamespaceSupport, org.xml.sax.Locator, .ErrorHandler, .SAXParseException, .SAXException, javax.xml.XMLConstants

Common code between DTDExtensionBindingChecker and ExtensionBindingChecker.
Author
Kohsuke Kawaguchi

Field Summary

Modifier and TypeField and Description
protected final boolean
allowExtensions

If false, any use of extensions is reported as an error.

protected final Set<String>
enabledExtensions

Set of namespace URIs that designates enabled extensions.

private Locator
protected final NamespaceSupport
nsSupport

Remembers in-scope namespace bindings.

private final Options
private final Set<String>
protected final String
schemaLanguage

Namespace URI of the target schema language.

Constructor Summary

AccessConstructor and Description
public
AbstractExtensionBindingChecker(String schemaLanguage, Options options, ErrorHandler
This error handler will receive detected errors.
handler
)

Method Summary

Modifier and TypeMethod and Description
protected final void
checkAndEnable(String uri)

Verify that the given URI is indeed a valid extension namespace URI, and if so enable it.

public void
endPrefixMapping(String prefix)

Overrides org.xml.sax.helpers.XMLFilterImpl.endPrefixMapping.

Implements org.xml.sax.ContentHandler.endPrefixMapping.

Filter an end Namespace prefix mapping event.

protected final SAXParseException
error(String msg)

Reports an error and returns the created SAXParseException

protected 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.

public void
public void
public void
startPrefixMapping(String prefix, String uri)

Overrides org.xml.sax.helpers.XMLFilterImpl.startPrefixMapping.

Implements org.xml.sax.ContentHandler.startPrefixMapping.

Filter a start Namespace prefix mapping event.

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
warning(String msg)

Reports a warning.

Inherited from com.sun.tools.xjc.util.SubtreeCutter:
endElementisCuttingsetContentHandlerstartCuttingstartElement

Field Detail

allowExtensionsback to summary
protected final boolean allowExtensions

If false, any use of extensions is reported as an error.

enabledExtensionsback to summary
protected final Set<String> enabledExtensions

Set of namespace URIs that designates enabled extensions.

locatorback to summary
private Locator locator

Hides org.xml.sax.helpers.XMLFilterImpl.locator.

nsSupportback to summary
protected final NamespaceSupport nsSupport

Remembers in-scope namespace bindings.

optionsback to summary
private final Options options
recognizableExtensionsback to summary
private final Set<String> recognizableExtensions
schemaLanguageback to summary
protected final String schemaLanguage

Namespace URI of the target schema language. Elements in this namespace are always allowed.

Constructor Detail

AbstractExtensionBindingCheckerback to summary
public AbstractExtensionBindingChecker(String schemaLanguage, Options options, ErrorHandler handler)
Parameters
handler:ErrorHandler

This error handler will receive detected errors.

Method Detail

checkAndEnableback to summary
protected final void checkAndEnable(String uri) throws SAXException

Verify that the given URI is indeed a valid extension namespace URI, and if so enable it.

This method does all the error handling.

endPrefixMappingback to summary
public void endPrefixMapping(String prefix) throws SAXException

Overrides org.xml.sax.helpers.XMLFilterImpl.endPrefixMapping.

Implements org.xml.sax.ContentHandler.endPrefixMapping.

Doc from org.xml.sax.helpers.XMLFilterImpl.endPrefixMapping.

Filter an end Namespace prefix mapping event.

Annotations
@Override
Exceptions
SAXException:
The client may throw an exception during processing.
errorback to summary
protected final SAXParseException error(String msg) throws SAXException

Reports an error and returns the created SAXParseException

isRecognizableExtensionback to summary
protected final boolean isRecognizableExtension(String namespaceUri)

Checks if the given namespace URI can be potentially recognized by this XJC.

isSupportedExtensionback to summary
protected final boolean isSupportedExtension(String namespaceUri)

Checks if the given namespace URI is supported as the extension bindings.

setDocumentLocatorback to summary
public void setDocumentLocator(Locator locator)

Overrides org.xml.sax.helpers.XMLFilterImpl.setDocumentLocator.

Implements org.xml.sax.ContentHandler.setDocumentLocator.

Doc from org.xml.sax.helpers.XMLFilterImpl.setDocumentLocator.

Filter a new document locator event.

Annotations
@Override
startDocumentback to summary
public void startDocument() throws SAXException

Overrides com.sun.tools.xjc.util.SubtreeCutter.startDocument.

Implements org.xml.sax.ContentHandler.startDocument.

Doc from org.xml.sax.helpers.XMLFilterImpl.startDocument.

Filter a start document event.

Annotations
@Override
Exceptions
SAXException:
The client may throw an exception during processing.
startPrefixMappingback to summary
public void startPrefixMapping(String prefix, String uri) throws SAXException

Overrides org.xml.sax.helpers.XMLFilterImpl.startPrefixMapping.

Implements org.xml.sax.ContentHandler.startPrefixMapping.

Doc from org.xml.sax.helpers.XMLFilterImpl.startPrefixMapping.

Filter a start Namespace prefix mapping event.

Annotations
@Override
Exceptions
SAXException:
The client may throw an exception during processing.
verifyTagNameback to summary
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.

warningback to summary
protected final void warning(String msg) throws SAXException

Reports a warning.