Package org.apache.sis.internal.jaxb.gco
Class UnitAdapter
java.lang.Object
javax.xml.bind.annotation.adapters.XmlAdapter<String,javax.measure.Unit<?>>
org.apache.sis.internal.jaxb.gco.UnitAdapter
- Direct Known Subclasses:
UnitAdapter.ForCS
,UnitAdapter.Since2014
JAXB adapter for unit of measurement.
- Since:
- 0.3
- Version:
- 1.0
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
A variant ofUnitAdapter
which marshal units as a URN for Coordinate System (CS) axes.static final class
Wraps the value only if marshalling ISO 19115-3 element. -
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
UnitAdapter
public UnitAdapter()Invoked by reflection by JAXB.
-
-
Method Details
-
unmarshal
Returns a unit for the given string.- Specified by:
unmarshal
in classXmlAdapter<String,
javax.measure.Unit<?>> - Parameters:
value
- the unit symbol.- Returns:
- the unit for the given symbol.
- Throws:
IllegalArgumentException
- if the given symbol is unknown.
-
marshal
Returns the symbol of the given unit.- Specified by:
marshal
in classXmlAdapter<String,
javax.measure.Unit<?>> - Parameters:
value
- the unit.- Returns:
- the unit symbol.
-