Enum FilterByVersion

java.lang.Object
java.lang.Enum<FilterByVersion>
org.apache.sis.internal.jaxb.FilterByVersion
All Implemented Interfaces:
Serializable, Comparable<FilterByVersion>, java.lang.constant.Constable

public enum FilterByVersion extends Enum<FilterByVersion>
An enumeration of metadata or GML versions which determine which XML elements to include or exclude during XML marshalling. If no marshalling is in progress, then all elements are considered included. This enumeration is used in getter methods for XML elements that exist only in some versions of ISO standards. They may be either deprecated elements to marshal only in legacy XML document formats, or new elements to marshal only in new XML document formats.
Since:
1.0
Version:
1.0
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.lang.Enum

    Enum.EnumDesc<E extends Enum<E>>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    accept() == true if marshalling of an ISO 19115-3 document is in progress, or if no marshalling in underway.
    accept() == true if marshalling of an ISO 19139:2007 document is in progress, or if no marshalling in underway.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final int
    accept() == false if the XML document version being marshalled is this version.
    private final int
    Mask to apply on Context.bitMasks in order to determine the version of the XML document being marshalled.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    FilterByVersion(int mask, int exclude)
    Creates an enumeration value.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns true if we are marshalling the metadata or GML format identified by this constant, or if no marshalling is in progress.
    Returns the enum constant of this type with the specified name.
    Returns an array containing the constants of this enum type, in the order they are declared.

    Methods inherited from class java.lang.Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • LEGACY_METADATA

      public static final FilterByVersion LEGACY_METADATA
      accept() == true if marshalling of an ISO 19139:2007 document is in progress, or if no marshalling in underway. Those documents are based on ISO 19115:2003 model.
    • CURRENT_METADATA

      public static final FilterByVersion CURRENT_METADATA
      accept() == true if marshalling of an ISO 19115-3 document is in progress, or if no marshalling in underway. Those documents are based on ISO 19115:2014 model.
  • Field Details

    • mask

      private final int mask
      Mask to apply on Context.bitMasks in order to determine the version of the XML document being marshalled.
    • exclude

      private final int exclude
      accept() == false if the XML document version being marshalled is this version. We use exclusion instead of inclusion as an opportunistic way to get true if no marshalling is in progress. This strategy works only if we have only two versions to support and will need to be changed when we will have more versions.
  • Constructor Details

    • FilterByVersion

      private FilterByVersion(int mask, int exclude)
      Creates an enumeration value.
  • Method Details

    • values

      public static FilterByVersion[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static FilterByVersion valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null
    • accept

      public boolean accept()
      Returns true if we are marshalling the metadata or GML format identified by this constant, or if no marshalling is in progress.
      Returns:
      false if the caller should omit XML element specific to the standard identified by this enumeration value.