Class SimpleNamespaceResolver
java.lang.Object
org.codehaus.mojo.jaxb2.schemageneration.postprocessing.schemaenhancement.SimpleNamespaceResolver
- All Implemented Interfaces:
NamespaceContext
Namespace resolver for XML documents, which relates XML Namespace Prefixes to XML Namespace URIs. Doubles as a JAXB NamespaceContext, if we decide to use JAXB instead of DOM to parse our generated schema files.
- Since:
- 1.4
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate class
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSimpleNamespaceResolver
(File xmlFile) Creates a new SimpleNamespaceResolver which collects namespace data from the provided XML file. -
Method Summary
Modifier and TypeMethodDescriptiongetNamespaceURI
(String prefix) getPrefixes
(String namespaceURI) private void
initialize
(Reader xmlFileStream) Initializes this SimpleNamespaceResolver to collect namespace data from the provided stream.
-
Field Details
-
DEFAULT_NS
- See Also:
-
TARGET_NAMESPACE
- See Also:
-
SCHEMA
- See Also:
-
sourceFilename
-
localNamespaceURI
-
prefix2Uri
-
uri2Prefix
-
-
Constructor Details
-
SimpleNamespaceResolver
Creates a new SimpleNamespaceResolver which collects namespace data from the provided XML file.- Parameters:
xmlFile
- The XML file from which to collect namespace data, should not be null.
-
-
Method Details
-
getNamespaceURI
- Specified by:
getNamespaceURI
in interfaceNamespaceContext
-
getPrefix
- Specified by:
getPrefix
in interfaceNamespaceContext
-
getPrefixes
- Specified by:
getPrefixes
in interfaceNamespaceContext
-
getNamespaceURI2PrefixMap
- Returns:
- A readonly map relating namespace URIs to namespace prefixes.
-
getLocalNamespaceURI
- Returns:
- The namespace URI of the default namespace within the sourceFile of this SimpleNamespaceResolver.
-
getSourceFilename
- Returns:
- The name of the source file used for this SimpleNamespaceResolver.
-
initialize
Initializes this SimpleNamespaceResolver to collect namespace data from the provided stream.- Parameters:
xmlFileStream
- A Reader connected to the XML file from which we should read namespace data.
-