Package org.apache.sis.xml
Class MarshalContext
- Object
-
- MarshalContext
-
public abstract class MarshalContext extends Object
Context of a marshalling or unmarshalling process.- Since:
- 0.3
Defined in the
sis-metadatamodule
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedMarshalContext()Creates a new (un)marshalling context.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract LocalegetLocale()Returns the locale to use for (un)marshalling, ornullif no locale were explicitly specified.abstract TimeZonegetTimeZone()Returns the timezone to use for (un)marshalling, ornullif none was explicitly specified.abstract VersiongetVersion(String prefix)Returns the schema version of the XML document being (un)marshalled.
-
-
-
Method Detail
-
getLocale
public abstract Locale getLocale()
Returns the locale to use for (un)marshalling, ornullif no locale were explicitly specified. The locale returned by this method can be used for choosing a language in anInternationalString.This locale may vary in different fragments of the same XML document. In particular children of
Metadatainherit the locale specified by theMetadata.getLanguage()attribute.Handling ofLocale.ROOTLocale.ROOTis interpreted as a request for locale-neutral strings. The meaning of "locale-neutral" is implementation specific - this is usually very close to the English locale, but not necessarily. For examples dates are formatted according ISO standard instead than the rules of the English locale.Handling ofAnulllocalenullvalue means that the locale is unspecified. Callers are encouraged to use the root locale as the default value, but some flexibility is allowed.- Returns:
- the locale for the XML fragment being (un)marshalled, or
nullis unspecified. - See Also:
DefaultInternationalString.toString(Locale)
-
getTimeZone
public abstract TimeZone getTimeZone()
Returns the timezone to use for (un)marshalling, ornullif none was explicitly specified.Handling ofAnulltimezonenullvalue means that the timezone is unspecified. Callers are encouraged to use the UTC timezone as the default value, but some flexibility is allowed.Upcoming API change — Java time API
Return type may be changed toZoneIdwhen Apache SIS will target Java 8. This change may be applied in synchronization with GeoAPI 4.0.- Returns:
- the timezone for the XML fragment being (un)marshalled, or
nullif unspecified.
-
getVersion
public abstract Version getVersion(String prefix)
Returns the schema version of the XML document being (un)marshalled. Theprefixargument can be any of the following values (case-sensitive):Supported schemas Prefix Standard Typical values gml Geographic Markup Language 3.0,3.2gmd Geographic MetaData 2007,2016- Parameters:
prefix- one of the above-cited prefix.- Returns:
- the version for the given schema, or
nullif unknown.
-
-