Package org.apache.sis.xml
Enum Implementation
- All Implemented Interfaces:
Serializable
,Comparable<Implementation>
,java.lang.constant.Constable
Known JAXB implementations.
This enumeration allows to set vendor-specific marshaller properties.
- Since:
- 0.8
- 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 -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String
The prefix of property names which are provided in external (endorsed) implementation of JAXB.(package private) final String
The JAXB property for setting the indentation string, ornull
if none.private static final String
The prefix of property names which are provided in internal implementation of JAXB (the one bundled with the JDK 6). -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
Implementation
(String indentKey) Creates a new enumeration value for a JAXB implementation. -
Method Summary
Modifier and TypeMethodDescriptionstatic Implementation
detect
(JAXBContext context) Detects if we are using the endorsed JAXB implementation (the one provided in separated JAR files) or the one bundled in JDK.(package private) boolean
filterProperty
(String key) Returnsfalse
if the given (un)marshaller property should be silently ignored.(package private) static String
toInternal
(String key) Converts the given key from"com.sun.xml.bind.*"
to"com.sun.xml.internal.bind.*"
namespace.static Implementation
Returns the enum constant of this type with the specified name.static Implementation[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
INTERNAL
JAXB implementation bundled in the JDK. -
ENDORSED
JAXB implementation provided in a separated JAR, used for instance by Glassfish. -
OTHER
Unrecognized implementation.
-
-
Field Details
-
ENDORSED_PREFIX
The prefix of property names which are provided in external (endorsed) implementation of JAXB. This is slightly different than the prefix used by the implementation bundled with the JDK 6, which is"com.sun.xml.internal.bind"
.- See Also:
-
INTERNAL_PREFIX
The prefix of property names which are provided in internal implementation of JAXB (the one bundled with the JDK 6).- See Also:
-
indentKey
The JAXB property for setting the indentation string, ornull
if none.
-
-
Constructor Details
-
Implementation
Creates a new enumeration value for a JAXB implementation.
-
-
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
-
detect
Detects if we are using the endorsed JAXB implementation (the one provided in separated JAR files) or the one bundled in JDK. We use the JAXB context package name as a criterion:- JAXB endorsed JAR uses
"com.sun.xml.bind.*"
- JAXB bundled in JDK uses
"com.sun.xml.internal.bind.*"
- Parameters:
context
- the JAXB context for which to detect the implementation.- Returns:
- the implementation, or
OTHER
if unknown.
- JAXB endorsed JAR uses
-
filterProperty
Returnsfalse
if the given (un)marshaller property should be silently ignored. A value oftrue
does not necessarily mean that the given property is supported, but that the caller should either support the property or throw an exception.This method excludes the
"com.sun.xml.bind.*"
properties if the implementation is notENDORSED
orINTERNAL
. We do not distinguish between the endorsed and internal namespaces since Apache SIS uses only the endorsed namespace and letsorg.apache.sis.xml.Pooled
do the conversion to internal namespace if needed.- Parameters:
key
- the property key to test.- Returns:
false
if the given property should be silently ignored.
-
toInternal
Converts the given key from"com.sun.xml.bind.*"
to"com.sun.xml.internal.bind.*"
namespace. This method is invoked when the JAXB implementation is known to be theINTERNAL
one. We perform this conversion for allowing Apache SIS to ignore the difference between internal and endorsed JAXB.- Parameters:
key
- the key that may potentially a endorsed JAXB key.- Returns:
- the key as an internal JAXB key, or the given key unchanged if it is not an endorsed JAXB key.
-