public class RecordValue extends ComplexValue implements RecordChangeProxy, MarshalCallback
modelInstance
Modifier | Constructor and Description |
---|---|
protected |
RecordValue()
Creates new instance of
RecordValue . |
|
RecordValue(ExternalValue value)
Creates change proxy on external value.
|
|
RecordValue(long id,
ModelInstance modelInstance,
String type,
Map<String,? extends Value> values)
Creates new instance of
RecordValue . |
|
RecordValue(long id,
ModelInstance modelInstance,
String type,
Map<String,? extends Value> values,
String level,
Long baseLevelValueId,
Long lowestLevelValueId,
Long lowerLevelValueId)
Creates new instance of
RecordValue . |
|
RecordValue(long id,
ModelInstance modelInstance,
String type,
Map<String,? extends Value> values,
String level,
Long baseLevelValueId,
Long lowestLevelValueId,
Long lowerLevelValueId,
boolean isChangeProxy,
Long proxiedRecordId)
Creates new instance of
RecordValue . |
|
RecordValue(ModelInstance modelInstance,
ExternalRecordType externalRecordType)
Creates change proxy on non-created external value.
|
|
RecordValue(ModelInstance modelInstance,
String type,
Map<String,? extends Value> values)
Creates new instance of
RecordValue . |
|
RecordValue(ModelInstance modelInstance,
String type,
Map<String,? extends Value> values,
String level,
Long baseLevelValueId,
Long lowestLevelValueId,
Long lowerLevelValueId)
Creates new instance of
RecordValue . |
|
RecordValue(RecordValue value)
Creates change proxy on record value.
|
Modifier and Type | Method and Description |
---|---|
<T,E extends Throwable> |
accept(ValueVisitor<T,E> visitor)
Accepts visitor.
|
void |
clear()
Clears evaluation data.
|
void |
clearProxy(Collection<String> properties)
Clear properties on proxy.
|
void |
clearTouchedProxies()
Clears touched proxies.
|
RecordValue |
createChangeProxy()
Created a change proxy on this object.
|
Collection<? extends RecordValue> |
getAllProxies()
Returns all proxies of this record.
|
RecordChangeProxy |
getOriginalRecord()
Returns a record object that is original non-proxy record.
|
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.
|
Long |
getPropertyInitialVersion(String name)
Returns initial version of the property.
|
Long |
getPropertyVersion(String name)
Returns version of the property.
|
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.
|
Collection<Collectible> |
getReferences()
Returns collection of all referenced collectible objects.
|
Set<RecordValue> |
getTouchedProxies()
Returns touched proxies that are or were in association with this proxy.
|
String |
getVersionString() |
boolean |
hasProperties()
Returns
true if there is any property set. |
boolean |
hasProperty(String name)
Returns true if the value contains the property.
|
protected void |
initItemsMap()
Initializes item map.
|
String |
internalVersionConflictMessage(EvaluationLevelAware entity)
Returns message for internal versioning conflict.
|
boolean |
isInternalyVersioned()
Returns true if the entity is internally (in scope of model instance) versioned.
|
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
|
RecordValue |
makeCopy(ModelInstance targetModelInstance)
Creates copy of the value in the target model instance.
|
void |
postMarshal(javax.xml.bind.Marshaller marshaller)
Callback method invoked after marshalling source to XML.
|
void |
postUnmarshal(javax.xml.bind.Unmarshaller unmarshaller,
Object parent)
Callback method invoked after unmarshalling XML data into target.
|
void |
preMarshal(javax.xml.bind.Marshaller marshaller)
Callback method invoked before marshalling from source to XML.
|
void |
preUnmarshal(javax.xml.bind.Unmarshaller unmarshaller,
Object parent)
Callback method invoked before unmarshalling into target.
|
void |
rebind(ModelInstance modelInstance)
Re-binds to a 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(ExternalValue val)
Sets proxied record.
|
void |
setVersionString(String versionString) |
String |
toString() |
Map<String,Value> |
values()
Returns the contained values.
|
collect, commonAfterUnmarshal, createContext, findReplacementId, getBaseLevelEntity, getBaseLevelEntityId, getCompiledType, getEvaluationLevel, getHandle, getId, getLowerLevelEntity, getLowerLevelEntityId, getLowestLevelEntity, getLowestLevelEntityId, getModelInstance, getOwnContext, getType, isLocked, isLowestExistingEntity, isPersistent, replaceIdAndEvaluationLevel, setLowerLevelEntityId, setPersistent, toSimpleValue, toValue, updateLevelData
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getCompiledType, getType, toSimpleValue, toValue
protected RecordValue()
RecordValue
.public RecordValue(long id, ModelInstance modelInstance, String type, Map<String,? extends Value> values, String level, Long baseLevelValueId, Long lowestLevelValueId, Long lowerLevelValueId)
RecordValue
.id
- modelInstance
- type
- values
- a map of values, may be null
level
- baseLevelValueId
- lowestLevelValueId
- lowerLevelValueId
- NullPointerException
- if modelInstance
or type
or any of its
elements is nullpublic RecordValue(long id, ModelInstance modelInstance, String type, Map<String,? extends Value> values, String level, Long baseLevelValueId, Long lowestLevelValueId, Long lowerLevelValueId, boolean isChangeProxy, Long proxiedRecordId)
RecordValue
.id
- modelInstance
- type
- values
- a map of values, may be null
level
- baseLevelValueId
- lowestLevelValueId
- lowerLevelValueId
- isChangeProxy
- proxiedRecordId
- NullPointerException
- if modelInstance
or type
or any of its
elements is nullpublic RecordValue(long id, ModelInstance modelInstance, String type, Map<String,? extends Value> values)
RecordValue
.id
- modelInstance
- type
- 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, Map<String,? extends Value> values, String level, Long baseLevelValueId, Long lowestLevelValueId, Long lowerLevelValueId)
RecordValue
.modelInstance
- type
- values
- a map of values, may be null
level
- baseLevelValueId
- lowestLevelValueId
- lowerLevelValueId
- NullPointerException
- if modelInstance
or type
or any of its
elements is nullpublic RecordValue(ModelInstance modelInstance, String type, Map<String,? extends Value> values)
RecordValue
.modelInstance
- type
- values
- a map of values, may be null
NullPointerException
- if modelInstance
or type
or any of its
elements is nullpublic RecordValue(RecordValue value)
value
- public RecordValue(ExternalValue value)
value
- public RecordValue(ModelInstance modelInstance, ExternalRecordType externalRecordType)
modelInstance
- externalRecordType
- 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 void clearTouchedProxies()
public Value getProperty(String name)
name
- NullPointerException
- if name
is nullpublic Long getPropertyInitialVersion(String name)
name
- public Long getPropertyVersion(String name)
name
- public 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 void preMarshal(javax.xml.bind.Marshaller marshaller)
MarshalCallback
preMarshal
in interface MarshalCallback
public void postMarshal(javax.xml.bind.Marshaller marshaller)
MarshalCallback
postMarshal
in interface MarshalCallback
public void preUnmarshal(javax.xml.bind.Unmarshaller unmarshaller, Object parent)
UnmarshalCallback
preUnmarshal
in interface UnmarshalCallback
parent
- instance of JAXB mapped class that will eventually reference target.
null when target is root element.public void postUnmarshal(javax.xml.bind.Unmarshaller unmarshaller, Object parent)
UnmarshalCallback
postUnmarshal
in interface UnmarshalCallback
parent
- instance of JAXB mapped class that will reference target.
null when target is root element.protected void initItemsMap()
public Collection<Collectible> getReferences()
Collectible
getReferences
in interface Collectible
public void replaceReferencedIds(Map<Long,Long> replacementMap)
ComplexValue
replaceReferencedIds
in interface EvaluationLevelAware
replaceReferencedIds
in class ComplexValue
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 isInternalyVersioned()
EvaluationLevelAware
isInternalyVersioned
in interface EvaluationLevelAware
isInternalyVersioned
in class ComplexValue
public String internalVersionConflictMessage(EvaluationLevelAware entity)
EvaluationLevelAware
internalVersionConflictMessage
in interface EvaluationLevelAware
internalVersionConflictMessage
in class ComplexValue
public boolean isRemoved()
Value
isRemoved
in interface Value
isRemoved
in class ComplexValue
public void remove()
public RecordValue makeCopy(ModelInstance targetModelInstance)
Value
public RecordValue createChangeProxy()
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 RecordChangeProxy getOriginalRecord()
RecordChangeProxy
getOriginalRecord
in interface RecordChangeProxy
public void setProxiedRecord(ExternalValue val)
val
- public Set<RecordValue> getTouchedProxies()
public String getVersionString()
public void setVersionString(String versionString)
Copyright © 2007-2018 Whitestein Technologies. All Rights Reserved.