Class TransformVersion

java.lang.Object
org.apache.sis.xml.TransformVersion

final class TransformVersion extends Object
The target version of standards for Transformer. This is used only for versions different than the native versions declared in JAXB annotations.
Since:
0.4
Version:
1.0
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) static final TransformVersion
    Apply all known namespace replacements.
    private final Map<String,String>
    The URI replacements to apply when going from the model implemented by Apache SIS to the transforming reader/writer.
    (package private) static final TransformVersion
    GML using the legacy "http://www.opengis.net/gml" namespace.
    private final Map<String,String>
    The URI replacements to apply when going from the transforming reader/writer to the model implemented by Apache SIS.
    (package private) static final TransformVersion
    Metadata using the legacy ISO 19139:2007 schema (replaced by ISO 19115-3).
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    TransformVersion(int ec, int ic)
    Creates a new enumeration initialized to the given capacity.
    private
    Creates an enumeration initialized to a copy of the given enumeration.
  • Method Summary

    Modifier and Type
    Method
    Description
    private void
    addAlias(String standard, String alias)
    Adds a namespace to be considered as an alias of another namespace.
    private void
    Adds a two-directional association between a namespace used in JAXB annotation and a namespace used in XML document.
    private void
    Adds a one-way association from JAXB namespace to XML namespace.
    private void
    Adds one-way associations from JAXB namespaces to a single XML namespace.
    (package private) final String
    Converts a namespace used in JAXB annotation to the namespace used in XML document.
    (package private) final Iterator<Map.Entry<String,String>>
    Returns the URI replacements to apply when going from the model implemented by Apache SIS to the transforming reader/writer.
    (package private) final String
    Converts a namespace used in XML document to the namespace used in JAXB annotation.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • ISO19139

      static final TransformVersion ISO19139
      Metadata using the legacy ISO 19139:2007 schema (replaced by ISO 19115-3).
    • GML31

      static final TransformVersion GML31
      GML using the legacy "http://www.opengis.net/gml" namespace. Note that the use of GML 3.2 implies the use of ISO 19139:2007.
    • ALL

      static final TransformVersion ALL
      Apply all known namespace replacements. This can be used only at unmarshalling time, for replacing all namespaces by the namespaces declared in Apache SIS JAXB annotations.
    • exports

      private final Map<String,String> exports
      The URI replacements to apply when going from the model implemented by Apache SIS to the transforming reader/writer. Keys are the URIs as declared in JAXB annotations, and values are the URIs to write instead of the actual ones.

      This map shall not be modified after construction. We do not wrap in Collections.unmodifiableMap(Map) for efficiency.

      See Also:
    • imports

      private final Map<String,String> imports
      The URI replacements to apply when going from the transforming reader/writer to the model implemented by Apache SIS. This map is the converse of exports. It does not contain the map of properties to rename because that map is handled by TransformingReader instead, as part of "RenameOnImport.lst" file.

      This map shall not be modified after construction. We do not wrap in Collections.unmodifiableMap(Map) for efficiency.

  • Constructor Details

    • TransformVersion

      private TransformVersion(int ec, int ic)
      Creates a new enumeration initialized to the given capacity.
      Parameters:
      ec - exports capacity.
      ic - imports capacity.
    • TransformVersion

      private TransformVersion(TransformVersion first)
      Creates an enumeration initialized to a copy of the given enumeration. This construction should be followed by calls to add(…) methods.
  • Method Details

    • addAlias

      private void addAlias(String standard, String alias)
      Adds a namespace to be considered as an alias of another namespace. The aliases are usually non-official URL and should not be used in exports.
    • addBijective

      private void addBijective(String jaxb, String xml)
      Adds a two-directional association between a namespace used in JAXB annotation and a namespace used in XML document. A bijective association means that the renaming is reversible.
    • addSurjective

      private void addSurjective(String jaxb, String xml)
      Adds a one-way association from JAXB namespace to XML namespace. Many JAXB namespaces may map to the same XML namespace. For example, most ISO 19115-3:2016 namespaces map to the same legacy ISO 19139:2007 namespace. Consequently, this association is not easily reversible.
    • addSurjectives

      private void addSurjectives(String[] jaxb, String xml)
      Adds one-way associations from JAXB namespaces to a single XML namespace. This method is used when the legacy schema (the xml one) was one large monolithic schema, and the new schema (represented by jaxb) has been separated in many smaller modules.
    • exportNS

      final String exportNS(String uri)
      Converts a namespace used in JAXB annotation to the namespace used in XML document. Returns the same URI if there is no replacement.
    • importNS

      final String importNS(String uri)
      Converts a namespace used in XML document to the namespace used in JAXB annotation. Returns the same URI if there is no replacement.
    • exports

      final Iterator<Map.Entry<String,String>> exports()
      Returns the URI replacements to apply when going from the model implemented by Apache SIS to the transforming reader/writer. Used only for more sophisticated work than what exportNS(String) does. Returned as an iterator for avoiding to expose modifiable map; do not invoke Iterator.remove().