|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.deepamehta.core.impl.ValueStorage
class ValueStorage
Helper for storing/fetching simple values and composite value models.
Field Summary | |
---|---|
private EmbeddedService |
dms
|
private static String |
LABEL_CHILD_SEPARATOR
|
private static String |
LABEL_TOPIC_SEPARATOR
|
private Logger |
logger
|
Constructor Summary | |
---|---|
ValueStorage(EmbeddedService dms)
|
Method Summary | |
---|---|
private void |
appendLabel(String label,
StringBuilder builder,
String separator)
|
(package private) void |
associateChildTopic(DeepaMehtaObjectModel parent,
RelatedTopicModel childTopic,
AssociationDefinitionModel assocDef)
Creates an association between the given parent object ("Parent" role) and the child topic ("Child" role). |
private String |
buildChildLabel(DeepaMehtaObjectModel parent,
String childTypeUri)
|
private String |
buildLabel(DeepaMehtaObjectModel model)
|
private RelatedTopicModel |
fetchChildTopic(long parentId,
AssociationDefinitionModel assocDef)
Fetches and returns a child topic or null if no such topic extists. |
private void |
fetchChildTopics(DeepaMehtaObjectModel parent)
Fetches the child topic models (recursively) of the given parent object model and updates it in-place. |
(package private) void |
fetchChildTopics(DeepaMehtaObjectModel parent,
AssociationDefinitionModel assocDef)
Fetches the child topic models (recursively) of the given parent object model and updates it in-place. |
private ResultList<RelatedTopicModel> |
fetchChildTopics(long parentId,
AssociationDefinitionModel assocDef)
|
private Topic |
fetchReferencedTopic(TopicReferenceModel topicRef)
|
private SimpleValue |
getIndexValue(DeepaMehtaObjectModel model)
Calculates the simple value that is to be indexed for this object. |
(package private) List<String> |
getLabelChildTypeUris(DeepaMehtaObjectModel parent)
Prerequisite: parent is a composite model. |
private TypeModel |
getType(DeepaMehtaObjectModel model)
Returns the type model of a DeepaMehta object model. |
(package private) void |
indexSimpleValue(DeepaMehtaObjectModel model,
IndexMode indexMode)
Indexes the simple value of the given object model according to the given index mode. |
(package private) void |
refreshLabel(DeepaMehtaObjectModel parent)
Recalculates the label of the given parent object model and updates it in-place. |
(package private) void |
resolveReference(TopicReferenceModel topicRef)
Replaces a reference with the real thing. |
(package private) void |
setSimpleValue(DeepaMehtaObjectModel model,
SimpleValue value)
|
private void |
storeChildTopic(RelatedTopicModel childTopic,
DeepaMehtaObjectModel parent,
AssociationDefinitionModel assocDef)
|
private void |
storeChildTopics(DeepaMehtaObjectModel parent)
Stores the composite value (child topics) of the specified topic or association model. |
private void |
storeSimpleValue(DeepaMehtaObjectModel model)
Stores and indexes the simple value of the specified topic or association model. |
(package private) void |
storeValue(DeepaMehtaObjectModel model)
Stores and indexes the specified model's value, either a simple value or a composite value (child topics). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final String LABEL_CHILD_SEPARATOR
private static final String LABEL_TOPIC_SEPARATOR
private EmbeddedService dms
private Logger logger
Constructor Detail |
---|
ValueStorage(EmbeddedService dms)
Method Detail |
---|
private void fetchChildTopics(DeepaMehtaObjectModel parent)
void fetchChildTopics(DeepaMehtaObjectModel parent, AssociationDefinitionModel assocDef)
Works for both, "one" and "many" association definitions.
assocDef
- The child topic models according to this association definition are fetched.void storeValue(DeepaMehtaObjectModel model)
Called to store the initial value of a newly created topic/association.
void indexSimpleValue(DeepaMehtaObjectModel model, IndexMode indexMode)
Called to index existing topics/associations once an index mode has been added to a type definition.
void refreshLabel(DeepaMehtaObjectModel parent)
parent
- The object model the label is calculated for. This is expected to be a composite model.void setSimpleValue(DeepaMehtaObjectModel model, SimpleValue value)
private void storeSimpleValue(DeepaMehtaObjectModel model)
private void storeChildTopics(DeepaMehtaObjectModel parent)
Note: the given model can contain childs not defined in the type definition. Only the childs defined in the type definition are stored.
private void storeChildTopic(RelatedTopicModel childTopic, DeepaMehtaObjectModel parent, AssociationDefinitionModel assocDef)
void resolveReference(TopicReferenceModel topicRef)
private Topic fetchReferencedTopic(TopicReferenceModel topicRef)
void associateChildTopic(DeepaMehtaObjectModel parent, RelatedTopicModel childTopic, AssociationDefinitionModel assocDef)
private String buildLabel(DeepaMehtaObjectModel model)
List<String> getLabelChildTypeUris(DeepaMehtaObjectModel parent)
private String buildChildLabel(DeepaMehtaObjectModel parent, String childTypeUri)
private void appendLabel(String label, StringBuilder builder, String separator)
private RelatedTopicModel fetchChildTopic(long parentId, AssociationDefinitionModel assocDef)
null
if no such topic extists.
private ResultList<RelatedTopicModel> fetchChildTopics(long parentId, AssociationDefinitionModel assocDef)
private SimpleValue getIndexValue(DeepaMehtaObjectModel model)
private TypeModel getType(DeepaMehtaObjectModel model)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |