However, one unfortunate downside of this philosophically correct behavior is that there is no provision or safety check when an user misspelled JAXB binding customization namespace.
This checker inspects the input document and look for the use of the prefix "jaxb". If the document doesn't associate any prefix to the JAXB customization URI and if it does associate the jaxb prefix, this checker will issue a warning.
This warning can happen to completely correct schema (because nothing prevents you from using the prefix "jaxb" for other purpose while using a JAXB compiler on the same schema) but in practice this would be quite unlikely.
This justifies the use of this filter.
| Modifier and Type | Field and Description |
|---|---|
| private ErrorHandler | |
| private boolean | isCustomizationUsed
Sets to true once we see the JAXB customization namespace URI. |
| private boolean | isJAXBPrefixUsed
Sets to true once we see the jaxb prefix in use. |
| private Locator |
| Access | Constructor and Description |
|---|---|
| public |
| errorHandler | back to summary |
|---|---|
| private ErrorHandler errorHandler | |
| isCustomizationUsed | back to summary |
|---|---|
| private boolean isCustomizationUsed Sets to true once we see the JAXB customization namespace URI. | |
| isJAXBPrefixUsed | back to summary |
|---|---|
| private boolean isJAXBPrefixUsed Sets to true once we see the jaxb prefix in use. | |
| locator | back to summary |
|---|---|
| private Locator locator | |
| IncorrectNamespaceURIChecker | back to summary |
|---|---|
| public IncorrectNamespaceURIChecker(ErrorHandler handler) | |
| endDocument | back to summary |
|---|---|
| public void endDocument() throws SAXException Overrides org. Implements org. Doc from org. Filter an end document event.
| |
| endPrefixMapping | back to summary |
|---|---|
| public void endPrefixMapping(String prefix) throws SAXException Overrides org. Implements org. Doc from org. Filter an end Namespace prefix mapping event.
| |
| setDocumentLocator | back to summary |
|---|---|
| public void setDocumentLocator(Locator locator) Overrides org. Implements org. Doc from org. Filter a new document locator event.
| |
| startElement | back to summary |
|---|---|
| public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException Overrides org. Implements org. Doc from org. Filter a start element event.
| |
| startPrefixMapping | back to summary |
|---|---|
| public void startPrefixMapping(String prefix, String uri) throws SAXException Overrides org. Implements org. Doc from org. Filter a start Namespace prefix mapping event.
| |