Package com._1c.g5.v8.dt.bsl.bm
Class BslObjectReferencePersistenceContributor
- java.lang.Object
-
- com._1c.g5.v8.dt.bsl.bm.BslObjectReferencePersistenceContributor
-
- All Implemented Interfaces:
IBmReferencePersistenceContributor
public final class BslObjectReferencePersistenceContributor extends Object implements IBmReferencePersistenceContributor
The implementation ofIBmReferencePersistenceContributor
responsible for persisting BSL object references.
-
-
Constructor Summary
Constructors Constructor Description BslObjectReferencePersistenceContributor(String extension)
Constructs a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
createReferenceValue(org.eclipse.emf.ecore.EObject target, IBmNamespace contextNs)
Creates internal representation of reference value.Object
deserializeReferenceValue(DataInput input)
Deserializes reference value.String
getId()
Gets ID of the contributor.org.eclipse.emf.ecore.EObject
resolveTarget(Object value, IBmNamespace contextNs, IBmPlatformTransaction transaction)
Resolves target object pointed by the specified reference value.org.eclipse.emf.common.util.URI
resolveTargetUri(Object value, IBmNamespace contextNs)
Resolves URI of the target object pointed by the specified reference value.void
serializeReferenceValue(Object value, DataOutput output)
Serializes the specified reference value.
-
-
-
Constructor Detail
-
BslObjectReferencePersistenceContributor
@Inject public BslObjectReferencePersistenceContributor(String extension)
Constructs a new instance.- Parameters:
extension
- The supported file extension. May not benull
.
-
-
Method Detail
-
createReferenceValue
public Object createReferenceValue(org.eclipse.emf.ecore.EObject target, IBmNamespace contextNs)
Description copied from interface:IBmReferencePersistenceContributor
Creates internal representation of reference value.- Specified by:
createReferenceValue
in interfaceIBmReferencePersistenceContributor
- Parameters:
target
- The object (may be a proxy) the reference points to (reference target). May not benull
.contextNs
- The context namespace, i.e. the namespace the referencing object belongs to. 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
public org.eclipse.emf.ecore.EObject resolveTarget(Object value, IBmNamespace contextNs, IBmPlatformTransaction transaction)
Description copied from interface:IBmReferencePersistenceContributor
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.- Specified by:
resolveTarget
in interfaceIBmReferencePersistenceContributor
- Parameters:
value
- The reference value. May not benull
.contextNs
- The context namespace, i.e. the namespace the referencing object belongs to. May not benull
.transaction
- The current transaction. May not benull
.- Returns:
- the target object or
null
if it does not exist.
-
resolveTargetUri
public org.eclipse.emf.common.util.URI resolveTargetUri(Object value, IBmNamespace contextNs)
Description copied from interface:IBmReferencePersistenceContributor
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.- Specified by:
resolveTargetUri
in interfaceIBmReferencePersistenceContributor
- Parameters:
value
- The reference value. May not benull
.contextNs
- The context namespace, i.e. the namespace the referencing object belongs to. May not benull
.- Returns:
- the URI of the target object, never
null
.
-
serializeReferenceValue
public void serializeReferenceValue(Object value, DataOutput output) throws IOException
Description copied from interface:IBmReferencePersistenceContributor
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.- Specified by:
serializeReferenceValue
in interfaceIBmReferencePersistenceContributor
- Parameters:
value
- The reference value to serialize. May not benull
.output
- The data output to write the serialized representation to. May not benull
.- Throws:
IOException
-
deserializeReferenceValue
public Object deserializeReferenceValue(DataInput input) throws IOException
Description copied from interface:IBmReferencePersistenceContributor
Deserializes reference value. In case data supplied by the specified input are corrupt the behaviour of this method is not specified.- Specified by:
deserializeReferenceValue
in interfaceIBmReferencePersistenceContributor
- Parameters:
input
- The data input to read the serialized representation from. May not benull
.- Returns:
- the deserialized reference value, never
null
. - Throws:
IOException
-
getId
public String getId()
Description copied from interface:IBmReferencePersistenceContributor
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.- Specified by:
getId
in interfaceIBmReferencePersistenceContributor
- Returns:
- the ID of the contributor.
-
-