Package org.apache.sis.internal.jaxb.gco
Class ObjectReference
java.lang.Object
org.apache.sis.internal.jaxb.gco.ObjectReference
The
gco:ObjectReference
XML attribute group is included by all metadata wrappers defined
in the org.apache.sis.internal.jaxb.metadata
package. The attributes of interest defined
in this group are uuidref
, xlink:href
, xlink:role
, xlink:arcrole
,
xlink:title
, xlink:show
and xlink:actuate
.
This gco:ObjectReference
group is complementary to gco:ObjectIdentification
,
which define the id
and uuid
attributes to be supported by all metadata
implementations in the public org.apache.sis.metadata.iso
package and sub-packages.
- Since:
- 0.3
- Version:
- 0.3
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates an initially empty object reference.ObjectReference
(UUID uuid, XLink link) Creates an object reference initialized to the given value. -
Method Summary
Modifier and TypeMethodDescriptionprivate static <T> void
putInto
(Context context, IdentifierMap map, IdentifierSpace<T> authority, T value) Adds a new identifier into the given map, if non null.(package private) final <T> T
If the given metadata object is null, tries to get an instance from the identifiers declared in thisObjectReference
.
-
Field Details
-
Constructor Details
-
ObjectReference
ObjectReference()Creates an initially empty object reference. -
ObjectReference
Creates an object reference initialized to the given value.- See Also:
-
-
Method Details
-
resolve
If the given metadata object is null, tries to get an instance from the identifiers declared in thisObjectReference
. If the given metadata object is non-null, assigns to that object the identifiers declared in thisObjectReference
.This method is invoked at unmarshalling time by
PropertyType.resolve(Context)
.- Type Parameters:
T
- the compile-time type of thetype
argument.- Parameters:
context
- the marshalling context, ornull
if none.type
- the expected type of the metadata object.metadata
- the metadata object, ornull
.- Returns:
- a metadata object for the identifiers, or
null
-
putInto
private static <T> void putInto(Context context, IdentifierMap map, IdentifierSpace<T> authority, T value) Adds a new identifier into the given map, if non null. No previous value should exist in normal situation. However, a previous value may exit in unusual (probably not very valid) XML, as in the following example: In such situation, this method is silent if the two identifiers are equal, or logs a warning and restores the previous value if they are not equal. The previous value is the "uuid
" attribute, which is assumed more closely tied to the actual metadata than theuuidref
attribute.- Parameters:
map
- the map in which to write the identifier.authority
- the identifier authority.value
- the identifier value, ornull
if not yet defined.
-