public class RecordValue extends ComplexValueWithEvalLevels implements RecordChangeProxy, CommonRecordValue
modelInstance
Constructor and Description |
---|
RecordValue(long id,
ModelInstance modelInstance,
String type,
RecordType compiledType,
Map<String,? extends Value> values)
Creates new instance of
RecordValue . |
RecordValue(long id,
ModelInstance modelInstance,
String type,
RecordType compiledType,
Map<String,? extends Value> values,
String level,
long baseLevelValueId,
ComplexValue lowerLevelValue)
Creates new instance of
RecordValue . |
RecordValue(ModelInstance modelInstance,
ExternalRecordType externalRecordType,
RecordProxySetValue proxySet,
boolean isLazySpreading)
Creates change proxy on non-created external value and adds it provided proxy set.
|
RecordValue(ModelInstance modelInstance,
String type,
RecordType compiledType,
Map<String,? extends Value> values)
Creates new instance of
RecordValue . |
RecordValue(ModelInstance modelInstance,
String type,
RecordType compiledType,
Map<String,? extends Value> values,
String level,
long baseLevelValueId,
ComplexValue lowerLevelValue)
Creates new instance of
RecordValue . |
RecordValue(RecordChangeProxy value,
RecordProxySetValue proxySet,
boolean isLazySpreading)
Creates change proxy on record value.
|
RecordValue(SRecordValue source,
ModelInstance modelInstance)
Creates a new instance from the serialized companion.
|
Modifier and Type | Method and Description |
---|---|
<T,E extends Throwable> |
accept(ValueVisitor<T,E> visitor)
Accepts visitor.
|
void |
addPropertyToCreateProxy(String name) |
void |
clear()
Clears evaluation data.
|
void |
clearProxy(Collection<String> properties)
Clear properties on proxy.
|
protected void |
convertToDirectReferences() |
RecordValue |
createChangeProxy(RecordProxySetValue proxySet,
boolean isLazySpreading)
Created a change proxy on this object.
|
protected Context |
createContext(long parentContextId) |
RecordValue |
createCopy(ModelInstance targetModelInstance)
Creates a copy without references to other objects.
|
void |
finishCopy(com.whitestein.lsps.engine.state.xml.Copiable source,
CopyHelper helper)
Copy references.
|
Collection<? extends RecordValue> |
getAllProxies()
Returns all proxies of this record.
|
RecordType |
getCachedCompiledType() |
RecordType |
getCompiledType(ModelProvider modelProvider)
Returns the compiled type.
|
RecordChangeProxy |
getOriginalRecord()
Returns a record object that is original non-proxy record.
|
Context |
getOwnContext(long parentContextId)
Returns own context
|
Set<String> |
getProperties()
Returns the unmodifiable set of property names.
|
Value |
getProperty(String name)
Returns record property by its name or null if given property does not
exist.
|
RecordChangeProxy |
getProxiedRecord()
Returns proxied record.
|
Long |
getProxiedRecordId()
Returns id of proxied record.
|
int |
getProxyLevel()
Gets number of proxies from this object to original non-proxy record.
|
RecordProxySetValue |
getProxySet()
Returns proxy set in which the proxy is registered.
|
Collection<Collectible> |
getReferences()
Returns collection of all referenced collectible objects.
|
Long |
getVersion() |
boolean |
hasProperties()
Returns
true if there is any property set. |
boolean |
hasProperty(String name)
Returns true if the value contains the property.
|
boolean |
isLazySpreadingProxy()
Returns true if the proxy is lazy spreading.
|
boolean |
isPropertyInitialValueChanged(String name)
Returns
true if the property with a given name changed its value. |
boolean |
isPropertyToCreateProxy(String name) |
boolean |
isProxy()
Returns true if this is change proxy for a record.
|
boolean |
isProxyOf(RecordChangeProxy record)
Returns true if this is direct or non-direct proxy of the record.
|
boolean |
isRemoved()
Returns true if value is removed
|
void |
rebind(ModelInstance modelInstance)
Re-binds to a model instance.
|
void |
refreshDirectReferences()
Re-set references to elements from the same model instance.
|
void |
remove()
Set this value to removed.
|
void |
replaceReferencedIds(Map<Long,Long> replacementMap)
Replace referenced ids according to mappings in the replacement map.
|
void |
setProperty(String name,
Value value)
Sets record property.
|
void |
setProxiedRecord(CommonRecordValue val)
Sets proxied record.
|
void |
setProxySet(RecordProxySetValue proxySet) |
void |
setVersion(Long version) |
SRecordValue |
toSerializable(SModelInstance smi,
MarshallerConfig config)
Creates a serializable object.
|
String |
toString() |
Map<String,Value> |
values()
Returns the contained values.
|
fillSerializable, getBaseLevelEntity, getBaseLevelEntityId, getEvaluationLevel, getLowerLevelEntity, getLowerLevelEntityId, replaceIdAndEvaluationLevel, setLowerLevelEntity
collect, findReplacementId, getHandle, getId, getModelInstance, getType, isPersistent, toSimpleValue, toValue
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getId, getModelInstance
getType, toSimpleValue, toValue
collect, isPersistent
public RecordValue(SRecordValue source, ModelInstance modelInstance)
source
- modelInstance
- public RecordValue(long id, ModelInstance modelInstance, String type, RecordType compiledType, Map<String,? extends Value> values, String level, long baseLevelValueId, ComplexValue lowerLevelValue)
RecordValue
.id
- modelInstance
- type
- compiledType
- a resolved type, may be null
values
- a map of values, may be null
level
- baseLevelValueId
- lowerLevelValue
- NullPointerException
- if modelInstance
or type
or any of its
elements is nullpublic RecordValue(long id, ModelInstance modelInstance, String type, RecordType compiledType, Map<String,? extends Value> values)
RecordValue
.id
- modelInstance
- type
- compiledType
- a resolved type, may be null
values
- a map of values, may be null
NullPointerException
- if modelInstance
or type
or any of its
elements is nullpublic RecordValue(ModelInstance modelInstance, String type, RecordType compiledType, Map<String,? extends Value> values, String level, long baseLevelValueId, ComplexValue lowerLevelValue)
RecordValue
.modelInstance
- type
- compiledType
- a resolved type, may be null
values
- a map of values, may be null
level
- baseLevelValueId
- lowerLevelValue
- NullPointerException
- if modelInstance
or type
or any of its
elements is nullpublic RecordValue(ModelInstance modelInstance, String type, RecordType compiledType, Map<String,? extends Value> values)
RecordValue
.modelInstance
- type
- compiledType
- a resolved type, may be null
values
- a map of values, may be null
NullPointerException
- if modelInstance
or type
or any of its
elements is nullpublic RecordValue(RecordChangeProxy value, RecordProxySetValue proxySet, boolean isLazySpreading)
value
- proxySet
- isLazySpreading
- public RecordValue(ModelInstance modelInstance, ExternalRecordType externalRecordType, RecordProxySetValue proxySet, boolean isLazySpreading)
modelInstance
- externalRecordType
- proxySet
- isLazySpreading
- public SRecordValue toSerializable(SModelInstance smi, MarshallerConfig config)
ComplexValueWithEvalLevels
toSerializable
in interface Value
toSerializable
in class ComplexValueWithEvalLevels
public RecordType getCompiledType(ModelProvider modelProvider)
Value
getCompiledType
in interface Value
getCompiledType
in class ComplexValue
public RecordType getCachedCompiledType()
null
)public boolean hasProperty(String name)
name
- public void setProperty(String name, Value value)
name
- property namevalue
- new property valueNullPointerException
- if name
or value
is nuvoid checkConflictsOnInternalVersions(EvaluationLevelAware entity);llpublic Value getProperty(String name)
name
- NullPointerException
- if name
is nullpublic Set<String> getProperties()
public boolean hasProperties()
true
if there is any property set.
It is equivalent to !getProperties().isEmpty()
.
true
if there is any property setpublic Map<String,Value> values()
public <T,E extends Throwable> T accept(ValueVisitor<T,E> visitor) throws E extends Throwable
Value
public Collection<Collectible> getReferences()
Collectible
getReferences
in interface Collectible
public void replaceReferencedIds(Map<Long,Long> replacementMap)
ComplexValueWithEvalLevels
replaceReferencedIds
in interface EvaluationLevelAware
replaceReferencedIds
in class ComplexValueWithEvalLevels
public void rebind(ModelInstance modelInstance)
rebind
in interface ModelInstanceAware
rebind
in class ComplexValue
modelInstance
- public void clear()
EvaluationLevelAware
clear
in interface EvaluationLevelAware
clear
in class ComplexValue
public void clearProxy(Collection<String> properties)
properties
- public boolean isRemoved()
Value
isRemoved
in interface Value
isRemoved
in class ComplexValue
public void remove()
public RecordValue createCopy(ModelInstance targetModelInstance)
public void finishCopy(com.whitestein.lsps.engine.state.xml.Copiable source, CopyHelper helper)
finishCopy
in class ComplexValueWithEvalLevels
public RecordValue createChangeProxy(RecordProxySetValue proxySet, boolean isLazySpreading)
RecordChangeProxy
createChangeProxy
in interface RecordChangeProxy
public boolean isProxy()
public boolean isProxyOf(RecordChangeProxy record)
RecordChangeProxy
isProxyOf
in interface RecordChangeProxy
public Collection<? extends RecordValue> getAllProxies()
public Long getProxiedRecordId()
isProxy()
returns true and proxied record id is null it means that this is proxy for external/shared record that is not created so far.public RecordChangeProxy getProxiedRecord()
public int getProxyLevel()
RecordChangeProxy
getProxyLevel
in interface RecordChangeProxy
public RecordProxySetValue getProxySet()
RecordChangeProxy
getProxySet
in interface RecordChangeProxy
public boolean isLazySpreadingProxy()
RecordChangeProxy
isLazySpreadingProxy
in interface RecordChangeProxy
public RecordChangeProxy getOriginalRecord()
RecordChangeProxy
getOriginalRecord
in interface RecordChangeProxy
public void setProxiedRecord(CommonRecordValue val)
val
- public void setProxySet(RecordProxySetValue proxySet)
protected void convertToDirectReferences()
convertToDirectReferences
in class ComplexValueWithEvalLevels
public void refreshDirectReferences()
EvaluationLevelAware
refreshDirectReferences
in interface EvaluationLevelAware
refreshDirectReferences
in class ComplexValueWithEvalLevels
public boolean isPropertyInitialValueChanged(String name)
true
if the property with a given name changed its value.name
- true
if the property with a given name changed its valueprotected Context createContext(long parentContextId)
public Context getOwnContext(long parentContextId)
getOwnContext
in interface CommonRecordValue
parentContextId
- public Long getVersion()
public void setVersion(Long version)
public boolean isPropertyToCreateProxy(String name)
public void addPropertyToCreateProxy(String name)
Copyright © 2007-2020 Whitestein Technologies. All Rights Reserved.