public abstract class ComplexValue extends Object implements Value, Collectible, EntityWithId, ModelInstanceAware, EvaluationLevelAware
Value
. The type cannot
be null.Modifier and Type | Field and Description |
---|---|
protected ModelInstance |
modelInstance
Model instance.
|
Modifier | Constructor and Description |
---|---|
protected |
ComplexValue()
Creates new empty instance of
ComplexValue . |
protected |
ComplexValue(ComplexValue source,
ModelInstance targetModelInstance)
Creates copy instance from source.
|
protected |
ComplexValue(long id,
ModelInstance modelInstance,
String type)
Creates new instance of
ComplexValue . |
protected |
ComplexValue(SComplexValue source,
ModelInstance modelInstance) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears evaluation data.
|
void |
collect()
Removes itself from the process.
|
protected abstract void |
convertToDirectReferences() |
com.whitestein.lsps.engine.state.xml.Copiable |
createCopy(ModelInstance targetModelInstance)
Creates a copy without references to other objects.
|
protected void |
fillSerializable(SComplexValue s,
SModelInstance smi,
MarshallerConfig config)
Fills attributes of the serializable value which is being created.
|
protected Long |
findReplacementId(Map<Long,Long> replacementMap,
Long oldId)
Returns replacement id.
|
void |
finishCopy(com.whitestein.lsps.engine.state.xml.Copiable source,
CopyHelper helper)
Copy references.
|
ComplexValue |
getBaseLevelEntity()
Returns base level value.
|
long |
getBaseLevelEntityId()
Returns id of the corresponding value in base level.
|
Type |
getCompiledType(ModelProvider modelProvider)
Returns the compiled type.
|
String |
getEvaluationLevel()
Returns evaluation level of this value.
|
Handle |
getHandle()
Returns handle.
|
long |
getId()
Returns the id.
|
ComplexValue |
getLowerLevelEntity()
Returns lower level value.
|
Long |
getLowerLevelEntityId()
Returns id of the corresponding value in previous lower level.
|
ModelInstance |
getModelInstance()
Returns the model instance.
|
String |
getType()
Returns the type.
|
boolean |
isPersistent()
Returns true if this object cannot be collected.
|
boolean |
isRemoved()
Returns true if value is removed
|
void |
rebind(ModelInstance modelInstance)
Re-binds to a model instance.
|
abstract void |
refreshDirectReferences()
Re-set references to elements from the same model instance.
|
void |
replaceIdAndEvaluationLevel(long newId,
long newBaseId)
Replaces id and base level entity id.
|
void |
replaceReferencedIds(Map<Long,Long> replacementMap)
Replace referenced ids according to mappings in the replacement map.
|
void |
setLowerLevelEntity(ComplexValue lowerLevelValue)
Sets the lower level value.
|
abstract SComplexValue |
toSerializable(SModelInstance smi,
MarshallerConfig config)
Creates a serializable object.
|
ValueRef |
toSimpleValue()
If this is
SimpleValue this method returns this, otherwise it returns a
ValueRef to this. |
Value |
toValue()
If this is a
ValueRef this method returns the referenced value, otherwise it returns
this. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getReferences
protected ModelInstance modelInstance
protected ComplexValue()
ComplexValue
.protected ComplexValue(ComplexValue source, ModelInstance targetModelInstance)
source
- targetModelInstance
- protected ComplexValue(SComplexValue source, ModelInstance modelInstance)
protected ComplexValue(long id, ModelInstance modelInstance, String type)
ComplexValue
.id
- modelInstance
- type
- NullPointerException
- if modelInstance
or type
is nullpublic abstract SComplexValue toSerializable(SModelInstance smi, MarshallerConfig config)
toSerializable
in interface Value
smi
- config
- protected void fillSerializable(SComplexValue s, SModelInstance smi, MarshallerConfig config)
s
- smi
- config
- public long getId()
EntityWithId
getId
in interface EntityWithId
public Handle getHandle()
public Type getCompiledType(ModelProvider modelProvider)
Value
getCompiledType
in interface Value
public ValueRef toSimpleValue()
Value
SimpleValue
this method returns this, otherwise it returns a
ValueRef
to this.toSimpleValue
in interface Value
SimpleValue
public Value toValue()
Value
ValueRef
this method returns the referenced value, otherwise it returns
this.public ModelInstance getModelInstance()
ModelInstanceAware
getModelInstance
in interface ModelInstanceAware
public boolean isPersistent()
Collectible
isPersistent
in interface Collectible
public void collect()
Collectible
collect
in interface Collectible
public String getEvaluationLevel()
getEvaluationLevel
in interface EvaluationLevelAware
public void rebind(ModelInstance modelInstance)
rebind
in interface ModelInstanceAware
modelInstance
- public void replaceIdAndEvaluationLevel(long newId, long newBaseId)
newId
- newBaseId
- public void replaceReferencedIds(Map<Long,Long> replacementMap)
replaceReferencedIds
in interface EvaluationLevelAware
replacementMap
- protected Long findReplacementId(Map<Long,Long> replacementMap, Long oldId)
replacementMap
- oldId
- public long getBaseLevelEntityId()
getBaseLevelEntityId
in interface EvaluationLevelAware
public ComplexValue getBaseLevelEntity()
getBaseLevelEntity
in interface EvaluationLevelAware
public Long getLowerLevelEntityId()
getLowerLevelEntityId
in interface EvaluationLevelAware
public ComplexValue getLowerLevelEntity()
getLowerLevelEntity
in interface EvaluationLevelAware
public void setLowerLevelEntity(ComplexValue lowerLevelValue)
lowerLevelValue
- public void clear()
EvaluationLevelAware
clear
in interface EvaluationLevelAware
public boolean isRemoved()
Value
protected abstract void convertToDirectReferences()
public abstract void refreshDirectReferences()
EvaluationLevelAware
refreshDirectReferences
in interface EvaluationLevelAware
public void finishCopy(com.whitestein.lsps.engine.state.xml.Copiable source, CopyHelper helper)
public com.whitestein.lsps.engine.state.xml.Copiable createCopy(ModelInstance targetModelInstance)
targetModelInstance
- Copyright © 2007-2020 Whitestein Technologies. All Rights Reserved.