Package org.apache.sis.internal.jaxb
Enum FilterByVersion
- All Implemented Interfaces:
Serializable
,Comparable<FilterByVersion>
,java.lang.constant.Constable
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 ConstantsEnum ConstantDescriptionaccept() == 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
FieldsModifier and TypeFieldDescriptionprivate final int
accept() == false
if the XML document version being marshalled is this version.private final int
Mask to apply onContext.bitMasks
in order to determine the version of the XML document being marshalled. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
FilterByVersion
(int mask, int exclude) Creates an enumeration value. -
Method Summary
Modifier and TypeMethodDescriptionboolean
accept()
Returnstrue
if we are marshalling the metadata or GML format identified by this constant, or if no marshalling is in progress.static FilterByVersion
Returns the enum constant of this type with the specified name.static FilterByVersion[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
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
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 maskMask to apply onContext.bitMasks
in order to determine the version of the XML document being marshalled. -
exclude
private final int excludeaccept() == false
if the XML document version being marshalled is this version. We use exclusion instead of inclusion as an opportunistic way to gettrue
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
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
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 nameNullPointerException
- if the argument is null
-
accept
public boolean accept()Returnstrue
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.
-