Class MarshalContext
Object
MarshalContext
- All Implemented Interfaces:
Localized
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the URI of the document being (un)marshalled, if this URI is known.abstract LocaleReturns the locale to use for (un)marshalling, ornullif no locale was explicitly specified.abstract MarshallerPoolgetPool()Returns the marshaller pool that produced the marshaller or unmarshaller in use.Returns the legacy 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.abstract ZoneIdReturns the timezone to use for (un)marshalling, ornullif none was explicitly specified.
-
Constructor Details
-
MarshalContext
protected MarshalContext()Creates a new (un)marshalling context.
-
-
Method Details
-
getPool
Returns the marshaller pool that produced the marshaller or unmarshaller in use. This pool may be used for creating new (un)marshaller when a document containsxlink:hrefto another document.- Returns:
- the marshaller pool that produced the marshaller or unmarshaller in use.
- Since:
- 1.5
-
getLocale
Returns the locale to use for (un)marshalling, ornullif no locale was 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 of
Locale.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 of the rules of the English locale.Handling of
Anulllocalenullvalue means that the locale is unspecified. Callers are encouraged to use the root locale as the default value, but some flexibility is allowed.- Specified by:
getLocalein interfaceLocalized- Returns:
- the locale for the XML fragment being (un)marshalled, or
nullif unspecified. - See Also:
-
getZoneId
Returns the timezone to use for (un)marshalling, ornullif none was explicitly specified.Handling of
Anulltimezonenullvalue means that the timezone is unspecified. Callers are encouraged to use the UTC timezone as the default value, but some flexibility is allowed.- Returns:
- the timezone for the XML fragment being (un)marshalled, or
nullif unspecified. - Since:
- 1.5
-
getTimeZone
Returns the legacy timezone to use for (un)marshalling, ornullif none was explicitly specified. This is he value returned bygetZoneId()converted to the legacy Java object.- Returns:
- the timezone for the XML fragment being (un)marshalled, or
nullif unspecified.
-
getVersion
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.
-
getDocumentURI
Returns the URI of the document being (un)marshalled, if this URI is known. The URI is generally unknown if the source of the XML document is, for example, anInputStream.- Returns:
- the URI of the document being marshalled or unmarshalled.
- Since:
- 1.5
-