de.deepamehta.core.model
Class AssociationDefinitionModel

Show UML class diagram
java.lang.Object
  extended by de.deepamehta.core.model.DeepaMehtaObjectModel
      extended by de.deepamehta.core.model.AssociationModel
          extended by de.deepamehta.core.model.AssociationDefinitionModel
All Implemented Interfaces:
Identifiable, JSONEnabled, Cloneable

public class AssociationDefinitionModel
extends AssociationModel

Definition of an association between 2 topic types -- part of DeepaMehta's type system, like an association in a class diagram. Used to represent both, aggregations and compositions. ### FIXDOC: also assoc types have assoc defs

Author:
Jörg Richter

Field Summary
private  String childCardinalityUri
           
private  String childTypeUri
           
private  String customAssocTypeUri
           
private  Logger logger
           
private  String parentCardinalityUri
           
private  String parentTypeUri
           
private  ViewConfigurationModel viewConfigModel
           
 
Fields inherited from class de.deepamehta.core.model.DeepaMehtaObjectModel
childTopics, id, typeUri, uri, value
 
Constructor Summary
AssociationDefinitionModel(org.codehaus.jettison.json.JSONObject assocDef)
           
AssociationDefinitionModel(long id, String uri, String assocTypeUri, String customAssocTypeUri, String parentTypeUri, String childTypeUri, String parentCardinalityUri, String childCardinalityUri, ViewConfigurationModel viewConfigModel)
           
AssociationDefinitionModel(String assocTypeUri, String parentTypeUri, String childTypeUri, String parentCardinalityUri, String childCardinalityUri)
           
AssociationDefinitionModel(String assocTypeUri, String customAssocTypeUri, String parentTypeUri, String childTypeUri, String parentCardinalityUri, String childCardinalityUri)
           
 
Method Summary
private static TopicRoleModel childRoleModel(org.codehaus.jettison.json.JSONObject assocDef)
           
private static TopicRoleModel childRoleModel(String childTypeUri)
           
private  String childTypeUri()
           
private  String defaultInstanceLevelAssocTypeUri()
           
 String getChildCardinalityUri()
           
 String getChildTypeUri()
           
 String getCustomAssocTypeUri()
           
 String getInstanceLevelAssocTypeUri()
          The type to be used to create an association instance based on this association definition.
 String getParentCardinalityUri()
           
 String getParentTypeUri()
           
 ViewConfigurationModel getViewConfigModel()
           
private static TopicRoleModel parentRoleModel(org.codehaus.jettison.json.JSONObject assocDef)
           
private static TopicRoleModel parentRoleModel(String parentTypeUri)
           
private  String parentTypeUri()
           
 void setChildCardinalityUri(String childCardinalityUri)
           
 void setCustomAssocTypeUri(String customAssocTypeUri)
           
 void setParentCardinalityUri(String parentCardinalityUri)
           
 void setViewConfigModel(ViewConfigurationModel viewConfigModel)
           
 org.codehaus.jettison.json.JSONObject toJSON()
           
(package private) static void toJSON(Collection<AssociationDefinitionModel> assocDefs, org.codehaus.jettison.json.JSONObject o)
           
 String toString()
           
 
Methods inherited from class de.deepamehta.core.model.AssociationModel
clone, createRoleModel, getOtherPlayerId, getRoleModel, getRoleModel1, getRoleModel2, hasSameRoleTypeUris, setRoleModel1, setRoleModel2
 
Methods inherited from class de.deepamehta.core.model.DeepaMehtaObjectModel
equals, getChildTopicsModel, getId, getSimpleValue, getTypeUri, getUri, hashCode, set, setChildTopicsModel, setId, setSimpleValue, setSimpleValue, setSimpleValue, setSimpleValue, setSimpleValue, setTypeUri, setUri
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

customAssocTypeUri

private String customAssocTypeUri

parentTypeUri

private String parentTypeUri

childTypeUri

private String childTypeUri

parentCardinalityUri

private String parentCardinalityUri

childCardinalityUri

private String childCardinalityUri

viewConfigModel

private ViewConfigurationModel viewConfigModel

logger

private Logger logger
Constructor Detail

AssociationDefinitionModel

public AssociationDefinitionModel(String assocTypeUri,
                                  String parentTypeUri,
                                  String childTypeUri,
                                  String parentCardinalityUri,
                                  String childCardinalityUri)

AssociationDefinitionModel

public AssociationDefinitionModel(String assocTypeUri,
                                  String customAssocTypeUri,
                                  String parentTypeUri,
                                  String childTypeUri,
                                  String parentCardinalityUri,
                                  String childCardinalityUri)

AssociationDefinitionModel

public AssociationDefinitionModel(long id,
                                  String uri,
                                  String assocTypeUri,
                                  String customAssocTypeUri,
                                  String parentTypeUri,
                                  String childTypeUri,
                                  String parentCardinalityUri,
                                  String childCardinalityUri,
                                  ViewConfigurationModel viewConfigModel)
Parameters:
customAssocTypeUri - if null no custom association type will be set.

AssociationDefinitionModel

AssociationDefinitionModel(org.codehaus.jettison.json.JSONObject assocDef)
                     throws org.codehaus.jettison.json.JSONException
Throws:
org.codehaus.jettison.json.JSONException
Method Detail

getCustomAssocTypeUri

public String getCustomAssocTypeUri()

getInstanceLevelAssocTypeUri

public String getInstanceLevelAssocTypeUri()
The type to be used to create an association instance based on this association definition.


getParentTypeUri

public String getParentTypeUri()

getChildTypeUri

public String getChildTypeUri()

getParentCardinalityUri

public String getParentCardinalityUri()

getChildCardinalityUri

public String getChildCardinalityUri()

getViewConfigModel

public ViewConfigurationModel getViewConfigModel()

setCustomAssocTypeUri

public void setCustomAssocTypeUri(String customAssocTypeUri)

setParentCardinalityUri

public void setParentCardinalityUri(String parentCardinalityUri)

setChildCardinalityUri

public void setChildCardinalityUri(String childCardinalityUri)

setViewConfigModel

public void setViewConfigModel(ViewConfigurationModel viewConfigModel)

toJSON

public org.codehaus.jettison.json.JSONObject toJSON()
Specified by:
toJSON in interface JSONEnabled
Overrides:
toJSON in class AssociationModel

toString

public String toString()
Overrides:
toString in class AssociationModel

toJSON

static void toJSON(Collection<AssociationDefinitionModel> assocDefs,
                   org.codehaus.jettison.json.JSONObject o)
            throws Exception
Throws:
Exception

parentRoleModel

private static TopicRoleModel parentRoleModel(org.codehaus.jettison.json.JSONObject assocDef)
                                       throws org.codehaus.jettison.json.JSONException
Throws:
org.codehaus.jettison.json.JSONException

childRoleModel

private static TopicRoleModel childRoleModel(org.codehaus.jettison.json.JSONObject assocDef)
                                      throws org.codehaus.jettison.json.JSONException
Throws:
org.codehaus.jettison.json.JSONException

parentRoleModel

private static TopicRoleModel parentRoleModel(String parentTypeUri)

childRoleModel

private static TopicRoleModel childRoleModel(String childTypeUri)

parentTypeUri

private String parentTypeUri()

childTypeUri

private String childTypeUri()

defaultInstanceLevelAssocTypeUri

private String defaultInstanceLevelAssocTypeUri()


Copyright © 2015. All Rights Reserved.