com.sun.tools.xjc.reader

Class AbstractExtensionBindingChecker

public abstract class AbstractExtensionBindingChecker extends SubtreeCutter

Common code between {@code DTDExtensionBindingChecker} and ExtensionBindingChecker.
Field Summary
protected booleanallowExtensions
If false, any use of extensions is reported as an error.
protected Set<String>enabledExtensions
Set of namespace URIs that designates enabled extensions.
protected NamespaceSupportnsSupport
Remembers in-scope namespace bindings.
protected StringschemaLanguage
Namespace URI of the target schema language.
Constructor Summary
AbstractExtensionBindingChecker(String schemaLanguage, Options options, ErrorHandler handler)
Method Summary
protected voidcheckAndEnable(String uri)
Verify that the given URI is indeed a valid extension namespace URI, and if so enable it.
voidendPrefixMapping(String prefix)
protected SAXParseExceptionerror(String msg)
Reports an error and returns the created SAXParseException
protected booleanisRecognizableExtension(String namespaceUri)
Checks if the given namespace URI can be potentially recognized by this XJC.
protected booleanisSupportedExtension(String namespaceUri)
Checks if the given namespace URI is supported as the extension bindings.
voidsetDocumentLocator(Locator locator)
voidstartDocument()
voidstartPrefixMapping(String prefix, String uri)
protected 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 voidwarning(String msg)
Reports a warning.

Field Detail

allowExtensions

protected final boolean allowExtensions
If false, any use of extensions is reported as an error.

enabledExtensions

protected final Set<String> enabledExtensions
Set of namespace URIs that designates enabled extensions.

nsSupport

protected final NamespaceSupport nsSupport
Remembers in-scope namespace bindings.

schemaLanguage

protected final String schemaLanguage
Namespace URI of the target schema language. Elements in this namespace are always allowed.

Constructor Detail

AbstractExtensionBindingChecker

public AbstractExtensionBindingChecker(String schemaLanguage, Options options, ErrorHandler handler)

Parameters: handler This error handler will receive detected errors.

Method Detail

checkAndEnable

protected final void checkAndEnable(String uri)
Verify that the given URI is indeed a valid extension namespace URI, and if so enable it.

This method does all the error handling.

endPrefixMapping

void endPrefixMapping(String prefix)

error

protected final SAXParseException error(String msg)
Reports an error and returns the created SAXParseException

isRecognizableExtension

protected final boolean isRecognizableExtension(String namespaceUri)
Checks if the given namespace URI can be potentially recognized by this XJC.

isSupportedExtension

protected final boolean isSupportedExtension(String namespaceUri)
Checks if the given namespace URI is supported as the extension bindings.

setDocumentLocator

void setDocumentLocator(Locator locator)

startDocument

void startDocument()

startPrefixMapping

void startPrefixMapping(String prefix, String uri)

verifyTagName

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.

warning

protected final void warning(String msg)
Reports a warning.