|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.deepamehta.core.impl.AttachedCompositeValue
class AttachedCompositeValue
A composite value model that is attached to the DB.
Field Summary | |
---|---|
private Map<String,Object> |
childTopics
Attached object cache. |
private EmbeddedService |
dms
|
private Logger |
logger
|
private CompositeValueModel |
model
|
private AttachedDeepaMehtaObject |
parent
|
Constructor Summary | |
---|---|
AttachedCompositeValue(CompositeValueModel model,
AttachedDeepaMehtaObject parent,
EmbeddedService dms)
|
Method Summary | |
---|---|
private Topic |
_getTopic(String childTypeUri)
|
private AttachedTopic |
_getTopic(String childTypeUri,
AttachedTopic defaultTopic)
|
private List<Topic> |
_getTopics(String childTypeUri)
|
private List<Topic> |
_getTopics(String childTypeUri,
List<Topic> defaultValue)
|
private CompositeValue |
_update(String childTypeUri,
TopicModel newChildTopic,
ClientState clientState,
Directives directives)
|
private void |
add(String childTypeUri,
Topic topic)
Adds a value to a multiple-valued child. |
private void |
addToCompositeValue(Topic childTopic,
AssociationDefinition assocDef)
For multiple-valued childs |
Iterable<String> |
childTypeUris()
|
private Topic |
createAttachedObject(TopicModel model)
Creates an attached topic to be put in this attached object cache. |
private void |
createChildTopicMany(TopicModel newChildTopic,
AssociationDefinition assocDef,
ClientState clientState,
Directives directives)
|
private void |
createChildTopicOne(TopicModel newChildTopic,
AssociationDefinition assocDef,
ClientState clientState,
Directives directives)
|
private AttachedRelatedTopic |
findChildTopic(long childTopicId,
AssociationDefinition assocDef)
|
Object |
get(String childTypeUri)
|
private AssociationDefinition |
getAssocDef(String childTypeUri)
|
boolean |
getBoolean(String childTypeUri)
Convenience accessor for the *simple* value of a single-valued child. |
boolean |
getBoolean(String childTypeUri,
boolean defaultValue)
Convenience accessor for the *simple* value of a single-valued child. |
CompositeValue |
getCompositeValue(String childTypeUri)
Convenience accessor for the *composite* value of a single-valued child. |
CompositeValue |
getCompositeValue(String childTypeUri,
CompositeValue defaultValue)
Convenience accessor for the *composite* value of a single-valued child. |
double |
getDouble(String childTypeUri)
Convenience accessor for the *simple* value of a single-valued child. |
double |
getDouble(String childTypeUri,
double defaultValue)
Convenience accessor for the *simple* value of a single-valued child. |
int |
getInt(String childTypeUri)
Convenience accessor for the *simple* value of a single-valued child. |
int |
getInt(String childTypeUri,
int defaultValue)
Convenience accessor for the *simple* value of a single-valued child. |
long |
getLong(String childTypeUri)
Convenience accessor for the *simple* value of a single-valued child. |
long |
getLong(String childTypeUri,
long defaultValue)
Convenience accessor for the *simple* value of a single-valued child. |
CompositeValueModel |
getModel()
|
Object |
getObject(String childTypeUri)
Convenience accessor for the *simple* value of a single-valued child. |
Object |
getObject(String childTypeUri,
Object defaultValue)
Convenience accessor for the *simple* value of a single-valued child. |
String |
getString(String childTypeUri)
Convenience accessor for the *simple* value of a single-valued child. |
String |
getString(String childTypeUri,
String defaultValue)
Convenience accessor for the *simple* value of a single-valued child. |
Topic |
getTopic(String childTypeUri)
Accesses a single-valued child. |
Topic |
getTopic(String childTypeUri,
Topic defaultTopic)
Accesses a single-valued child. |
List<Topic> |
getTopics(String childTypeUri)
Accesses a multiple-valued child. |
List<Topic> |
getTopics(String childTypeUri,
List<Topic> defaultValue)
Accesses a multiple-valued child. |
boolean |
has(String childTypeUri)
|
private void |
initAttachedObjectCache()
Initializes this attached object cache. |
private void |
initAttachedObjectCache(String childTypeUri)
Initializes this attached object cache selectively (and recursively). |
private boolean |
isReferingToAny(TopicReferenceModel topicRef,
AssociationDefinition assocDef)
Checks weather the given topic reference refers to any of the child topics. |
(package private) void |
loadChildTopics()
|
private void |
loadChildTopics(AssociationDefinition assocDef)
Recursively loads child topics (model) and updates this attached object cache accordingly. |
(package private) void |
loadChildTopics(String childTypeUri)
|
private void |
put(String childTypeUri,
Topic topic)
Puts a single-valued child. |
private void |
putInCompositeValue(Topic childTopic,
AssociationDefinition assocDef)
For single-valued childs |
CompositeValue |
remove(String childTypeUri,
long topicId,
ClientState clientState,
Directives directives)
|
private void |
remove(String childTypeUri,
Topic topic)
Removes a value from a multiple-valued child. |
private void |
removeFromCompositeValue(Topic childTopic,
AssociationDefinition assocDef)
For multiple-valued childs |
CompositeValue |
set(String childTypeUri,
CompositeValueModel value,
ClientState clientState,
Directives directives)
Convenience method to set the composite value of a child. |
CompositeValue |
set(String childTypeUri,
Object value,
ClientState clientState,
Directives directives)
Convenience method to set the simple value of a child. |
CompositeValue |
set(String childTypeUri,
TopicModel value,
ClientState clientState,
Directives directives)
Sets a child. |
CompositeValue |
setRef(String childTypeUri,
long refTopicId,
ClientState clientState,
Directives directives)
|
CompositeValue |
setRef(String childTypeUri,
String refTopicUri,
ClientState clientState,
Directives directives)
|
int |
size()
|
(package private) void |
update(CompositeValueModel newComp,
ClientState clientState,
Directives directives)
|
private void |
updateAggregationMany(List<? extends TopicModel> newChildTopics,
AssociationDefinition assocDef,
ClientState clientState,
Directives directives)
|
private void |
updateAggregationOne(TopicModel newChildTopic,
AssociationDefinition assocDef,
ClientState clientState,
Directives directives)
|
private void |
updateChildTopicMany(TopicModel newChildTopic,
AssociationDefinition assocDef,
ClientState clientState,
Directives directives)
|
private void |
updateChildTopicOne(TopicModel newChildTopic,
AssociationDefinition assocDef,
ClientState clientState,
Directives directives)
|
(package private) void |
updateChildTopics(TopicModel newChildTopic,
List<? extends TopicModel> newChildTopics,
AssociationDefinition assocDef,
ClientState clientState,
Directives directives)
|
private void |
updateCompositionMany(List<? extends TopicModel> newChildTopics,
AssociationDefinition assocDef,
ClientState clientState,
Directives directives)
|
private void |
updateCompositionOne(TopicModel newChildTopic,
AssociationDefinition assocDef,
ClientState clientState,
Directives directives)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private CompositeValueModel model
private AttachedDeepaMehtaObject parent
private Map<String,Object> childTopics
private EmbeddedService dms
private Logger logger
Constructor Detail |
---|
AttachedCompositeValue(CompositeValueModel model, AttachedDeepaMehtaObject parent, EmbeddedService dms)
Method Detail |
---|
public Topic getTopic(String childTypeUri)
CompositeValue
getTopic
in interface CompositeValue
public Topic getTopic(String childTypeUri, Topic defaultTopic)
CompositeValue
getTopic
in interface CompositeValue
public List<Topic> getTopics(String childTypeUri)
CompositeValue
getTopics
in interface CompositeValue
public List<Topic> getTopics(String childTypeUri, List<Topic> defaultValue)
CompositeValue
getTopics
in interface CompositeValue
public Object get(String childTypeUri)
get
in interface CompositeValue
public boolean has(String childTypeUri)
has
in interface CompositeValue
public Iterable<String> childTypeUris()
childTypeUris
in interface CompositeValue
public int size()
size
in interface CompositeValue
public CompositeValueModel getModel()
getModel
in interface CompositeValue
public String getString(String childTypeUri)
CompositeValue
getString
in interface CompositeValue
public String getString(String childTypeUri, String defaultValue)
CompositeValue
getString
in interface CompositeValue
public int getInt(String childTypeUri)
CompositeValue
getInt
in interface CompositeValue
public int getInt(String childTypeUri, int defaultValue)
CompositeValue
getInt
in interface CompositeValue
public long getLong(String childTypeUri)
CompositeValue
getLong
in interface CompositeValue
public long getLong(String childTypeUri, long defaultValue)
CompositeValue
getLong
in interface CompositeValue
public double getDouble(String childTypeUri)
CompositeValue
getDouble
in interface CompositeValue
public double getDouble(String childTypeUri, double defaultValue)
CompositeValue
getDouble
in interface CompositeValue
public boolean getBoolean(String childTypeUri)
CompositeValue
getBoolean
in interface CompositeValue
public boolean getBoolean(String childTypeUri, boolean defaultValue)
CompositeValue
getBoolean
in interface CompositeValue
public Object getObject(String childTypeUri)
CompositeValue
getObject
in interface CompositeValue
public Object getObject(String childTypeUri, Object defaultValue)
CompositeValue
getObject
in interface CompositeValue
public CompositeValue getCompositeValue(String childTypeUri)
CompositeValue
getCompositeValue
in interface CompositeValue
public CompositeValue getCompositeValue(String childTypeUri, CompositeValue defaultValue)
CompositeValue
getCompositeValue
in interface CompositeValue
public CompositeValue set(String childTypeUri, TopicModel value, ClientState clientState, Directives directives)
CompositeValue
set
in interface CompositeValue
public CompositeValue set(String childTypeUri, Object value, ClientState clientState, Directives directives)
CompositeValue
set
in interface CompositeValue
value
- The simple value.
Either String, Integer, Long, Double, or Boolean. Primitive values are auto-boxed.public CompositeValue set(String childTypeUri, CompositeValueModel value, ClientState clientState, Directives directives)
CompositeValue
set
in interface CompositeValue
public CompositeValue setRef(String childTypeUri, long refTopicId, ClientState clientState, Directives directives)
setRef
in interface CompositeValue
public CompositeValue setRef(String childTypeUri, String refTopicUri, ClientState clientState, Directives directives)
setRef
in interface CompositeValue
public CompositeValue remove(String childTypeUri, long topicId, ClientState clientState, Directives directives)
remove
in interface CompositeValue
void update(CompositeValueModel newComp, ClientState clientState, Directives directives)
void updateChildTopics(TopicModel newChildTopic, List<? extends TopicModel> newChildTopics, AssociationDefinition assocDef, ClientState clientState, Directives directives)
void loadChildTopics(String childTypeUri)
private Topic _getTopic(String childTypeUri)
private AttachedTopic _getTopic(String childTypeUri, AttachedTopic defaultTopic)
private List<Topic> _getTopics(String childTypeUri)
private List<Topic> _getTopics(String childTypeUri, List<Topic> defaultValue)
private CompositeValue _update(String childTypeUri, TopicModel newChildTopic, ClientState clientState, Directives directives)
private void updateCompositionOne(TopicModel newChildTopic, AssociationDefinition assocDef, ClientState clientState, Directives directives)
private void updateCompositionMany(List<? extends TopicModel> newChildTopics, AssociationDefinition assocDef, ClientState clientState, Directives directives)
private void updateAggregationOne(TopicModel newChildTopic, AssociationDefinition assocDef, ClientState clientState, Directives directives)
private void updateAggregationMany(List<? extends TopicModel> newChildTopics, AssociationDefinition assocDef, ClientState clientState, Directives directives)
private void updateChildTopicOne(TopicModel newChildTopic, AssociationDefinition assocDef, ClientState clientState, Directives directives)
private void updateChildTopicMany(TopicModel newChildTopic, AssociationDefinition assocDef, ClientState clientState, Directives directives)
private void createChildTopicOne(TopicModel newChildTopic, AssociationDefinition assocDef, ClientState clientState, Directives directives)
private void createChildTopicMany(TopicModel newChildTopic, AssociationDefinition assocDef, ClientState clientState, Directives directives)
void loadChildTopics()
private void loadChildTopics(AssociationDefinition assocDef)
assocDef
- the child topics according to this association definition are loaded.
Note: the association definition must not necessarily originate from this object's type definition. It may originate from a facet definition as well.
private void initAttachedObjectCache()
private void initAttachedObjectCache(String childTypeUri)
private Topic createAttachedObject(TopicModel model)
private void putInCompositeValue(Topic childTopic, AssociationDefinition assocDef)
private void addToCompositeValue(Topic childTopic, AssociationDefinition assocDef)
private void removeFromCompositeValue(Topic childTopic, AssociationDefinition assocDef)
private void put(String childTypeUri, Topic topic)
private void add(String childTypeUri, Topic topic)
private void remove(String childTypeUri, Topic topic)
private AttachedRelatedTopic findChildTopic(long childTopicId, AssociationDefinition assocDef)
private boolean isReferingToAny(TopicReferenceModel topicRef, AssociationDefinition assocDef)
assocDef
- the child topics according to this association definition are considered.private AssociationDefinition getAssocDef(String childTypeUri)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |