Class SimpleNamespaceContext

  • All Implemented Interfaces:
    NamespaceContext

    @Deprecated(since="8.3.0",
                forRemoval=true)
    @ThreadSafe
    public class SimpleNamespaceContext
    extends Object
    implements NamespaceContext
    Deprecated, for removal: This API element is subject to removal in a future version.
    Simple implementation of NamespaceContext based on a map from prefix values to corresponding URIs. This implementation only supports a single mapping for a given prefix, that is getPrefixes(String) will always contain at most 1 element.
    • Field Detail

      • mappings

        private final ImmutableBiMap<String,​String> mappings
        Deprecated, for removal: This API element is subject to removal in a future version.
        Mappings between namespace prefixes and namespace URIs.
    • Constructor Detail

      • SimpleNamespaceContext

        public SimpleNamespaceContext()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Constructor.
      • SimpleNamespaceContext

        public SimpleNamespaceContext​(@Nullable @NullableElements
                                      Map<String,​String> prefixToUriMappings)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Constructor.
        Parameters:
        prefixToUriMappings - Maps prefix values to the corresponding namespace URIs.
    • Method Detail

      • getNamespaceURI

        @Nullable
        public String getNamespaceURI​(String prefix)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Specified by:
        getNamespaceURI in interface NamespaceContext
      • getPrefix

        @Nullable
        public String getPrefix​(String namespaceURI)
        Deprecated, for removal: This API element is subject to removal in a future version.
        Specified by:
        getPrefix in interface NamespaceContext
      • getMappingsBuilder

        @Nonnull
        private ImmutableBiMap.Builder<String,​String> getMappingsBuilder()
        Deprecated, for removal: This API element is subject to removal in a future version.
        Build the initial set of mappings which contains entries for XML and XMLNS.
        Returns:
        initial set of mappings