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 classA variant ofUnitAdapterwhich marshal units as a URN for Coordinate System (CS) axes.static final classWraps 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:
unmarshalin 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:
marshalin classXmlAdapter<String,javax.measure.Unit<?>> - Parameters:
value- the unit.- Returns:
- the unit symbol.
-