Package com._1c.g5.v8.bm.core
Interface IBmReferencePersistenceContributor
-
public interface IBmReferencePersistenceContributor
Interface to contribute custom logic to reference persistence mechanism. This interface is intended to replaceIBmExternalUriResolver
. Note that an instance of contributor must not be shared between different BM engines.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
close()
Closes this contributor.Object
createReferenceValue(org.eclipse.emf.ecore.EObject target)
Creates internal representation of reference value.Object
deserializeReferenceValue(DataInput input)
Deserializes reference value.String
getId()
Gets ID of the contributor.void
initialize(Path storePath)
Initializes the contributor.org.eclipse.emf.ecore.EObject
resolveTarget(Object value)
Resolves target object pointed by the specified reference value.org.eclipse.emf.common.util.URI
resolveTargetUri(Object value)
Resolves URI of the target object pointed by the specified reference value.void
serializeReferenceValue(Object value, DataOutput output)
Serializes the specified reference value.
-
-
-
Method Detail
-
createReferenceValue
Object createReferenceValue(org.eclipse.emf.ecore.EObject target)
Creates internal representation of reference value.- Parameters:
target
- The object (may be a proxy) the reference points to (reference target). May not benull
.- Returns:
- the internal representation of the reference value or
null
if the target object is not supported by this contributor or reference to the target object may not be created. The class of the returned object must implementequals
method so that it returnstrue
in case either reference value points to the same target.
-
resolveTarget
org.eclipse.emf.ecore.EObject resolveTarget(Object value)
Resolves target object pointed by the specified reference value. In case the provided value has not been created by this contributor the behaviour of this method is not specified.- Parameters:
value
- The reference value. May not benull
.- Returns:
- the target object or
null
if it does not exist.
-
resolveTargetUri
org.eclipse.emf.common.util.URI resolveTargetUri(Object value)
Resolves URI of the target object pointed by the specified reference value. In case the provided value has not been created by this contributor the behaviour of this method is not specified.- Parameters:
value
- The reference value. May not benull
.- Returns:
- the URI of the target object, never
null
.
-
serializeReferenceValue
void serializeReferenceValue(Object value, DataOutput output)
Serializes the specified reference value. In case the provided value has not been created by this contributor the behaviour of this method is not specified.- Parameters:
value
- The reference value to serialize. May not benull
.output
- The data output to write the serialized representation to. May not benull
.
-
deserializeReferenceValue
Object deserializeReferenceValue(DataInput input)
Deserializes reference value. In case data supplied by the specified input are corrupt the behaviour of this method is not specified.- Parameters:
input
- The data input to read the serialized representation from. May not benull
.- Returns:
- the deserialized reference value, never
null
.
-
getId
String getId()
Gets ID of the contributor. The ID must not change after the application restart. It is convenient to use the class name of the contributor as the ID unless several instances of the same contributor class are bound to the same engine.- Returns:
- the ID of the contributor.
-
initialize
void initialize(Path storePath)
Initializes the contributor.- Parameters:
storePath
- The path where the contributor is allowed to store its data if necessary. May not benull
.
-
close
void close()
Closes this contributor.
-
-