class TypeModelImpl extends TopicModelImpl implements TypeModel
Modifier and Type | Class and Description |
---|---|
private static class |
TypeModelImpl.JSONWrapper |
Modifier and Type | Field and Description |
---|---|
private SequencedHashMap<String,AssociationDefinitionModelImpl> |
assocDefs |
private String |
dataTypeUri |
private List<IndexMode> |
indexModes |
private Logger |
logger |
private ViewConfigurationModelImpl |
viewConfig |
childTopics, em, id, mf, pl, typeUri, uri, value
Constructor and Description |
---|
TypeModelImpl(TopicModelImpl typeTopic,
String dataTypeUri,
List<IndexMode> indexModes,
List<AssociationDefinitionModel> assocDefs,
ViewConfigurationModelImpl viewConfig) |
TypeModelImpl(TypeModelImpl type) |
Modifier and Type | Method and Description |
---|---|
(package private) void |
_addAssocDef(AssociationModelImpl assoc) |
(package private) void |
_addAssocDefBefore(AssociationDefinitionModelImpl assocDef,
String beforeAssocDefUri) |
(package private) void |
_addIndexMode(IndexMode indexMode) |
private AssociationDefinitionModelImpl |
_getAssocDef(String assocDefUri) |
(package private) void |
_removeAssocDef(String assocDefUri) |
(package private) void |
_removeAssocDefFromMemoryAndRebuildSequence(AssociationModel assoc)
Removes an association from memory and rebuilds the sequence in DB.
|
(package private) void |
_updateAssocDef(AssociationModel assoc,
AssociationModel oldAssoc)
Adjusts the type cache on post-update-assoc.
|
private void |
_updateAssocDefs(Collection<AssociationDefinitionModelImpl> newAssocDefs) |
private void |
_updateDataTypeUri(String newDataTypeUri) |
private void |
_updateSequence(Collection<AssociationDefinitionModelImpl> newAssocDefs) |
TypeModel |
addAssocDef(AssociationDefinitionModel assocDef) |
TypeModel |
addAssocDefBefore(AssociationDefinitionModel assocDef,
String beforeAssocDefUri) |
void |
addIndexMode(IndexMode indexMode) |
private void |
addUpdateTypeDirective() |
private long |
checkAssocDefId(AssociationDefinitionModel assocDef) |
TypeModelImpl |
clone() |
(package private) <M extends TypeModelImpl> |
filterReadableAssocDefs() |
private String[] |
findAssocDefUris(long assocDefId)
Finds an assoc def by ID and returns its URI (at index 0).
|
private long |
firstAssocDefId() |
(package private) List<? extends DeepaMehtaObjectModelImpl> |
getAllInstances() |
AssociationDefinitionModelImpl |
getAssocDef(String assocDefUri) |
private AssociationDefinitionModelImpl |
getAssocDefOrThrow(String assocDefUri) |
Collection<AssociationDefinitionModelImpl> |
getAssocDefs() |
String |
getDataTypeUri() |
(package private) Directive |
getDeleteTypeDirective() |
private String |
getFirstAssocDefUri() |
List<IndexMode> |
getIndexModes() |
(package private) List<String> |
getLabelConfig() |
(package private) Directive |
getUpdateTypeDirective() |
ViewConfigurationModelImpl |
getViewConfig() |
Object |
getViewConfigValue(String configTypeUri,
String childTypeUri) |
boolean |
hasAssocDef(String assocDefUri) |
private boolean |
hasSameAssocDefSequence(Collection<? extends AssociationDefinitionModel> assocDefs) |
private void |
indexAllInstances(IndexMode indexMode) |
(package private) DeepaMehtaTypeImpl |
instantiate() |
Iterator<String> |
iterator()
Returns an interator which iterates this TypeModel's assoc def URIs.
|
private long |
lastAssocDefId()
Returns the ID of the last association definition of this type or
-1 if there are no association definitions. |
(package private) void |
postDelete() |
(package private) void |
postUpdate(DeepaMehtaObjectModel updateModel,
DeepaMehtaObjectModel oldObject) |
(package private) void |
preDelete() |
(package private) void |
preUpdate(DeepaMehtaObjectModel updateModel) |
private void |
putInTypeCache() |
private void |
rehashAssocDef(String assocDefUri,
String beforeAssocDefUri) |
private void |
rehashAssocDefs(Collection<AssociationDefinitionModelImpl> newAssocDefs) |
AssociationDefinitionModel |
removeAssocDef(String assocDefUri) |
private void |
removeFromTypeCache()
Removes this type from type cache and adds a DELETE TYPE directive to the given set of directives.
|
void |
setDataTypeUri(String dataTypeUri) |
void |
setViewConfig(ViewConfigurationModel viewConfig) |
private void |
storeDataTypeUri() |
org.codehaus.jettison.json.JSONObject |
toJSON() |
private org.codehaus.jettison.json.JSONArray |
toJSONArray(Collection<? extends AssociationDefinitionModel> assocDefs) |
private org.codehaus.jettison.json.JSONArray |
toJSONArray(List<IndexMode> indexModes) |
private SequencedHashMap<String,AssociationDefinitionModelImpl> |
toMap(Collection<? extends AssociationDefinitionModel> assocDefs) |
String |
toString() |
(package private) void |
updateDataTypeUri(String dataTypeUri) |
private void |
updateType(TypeModelImpl updateModel) |
_delete, checkReadAccess, checkWriteAccess, className, createModelWithChildTopics, createRoleModel, findChildTopic, getAssociations, getDeleteDirective, getPostDeleteEvent, getPostUpdateEvent, getPreDeleteEvent, getPreUpdateEvent, getRelatedTopic, getRelatedTopics, getRelatedTopics, getType, getUpdateDirective, indexSimpleValue, removeProperty, storeProperty, storeSimpleValue, storeTypeUri, storeUri
_updateChildTopics, calculateLabel, calculateLabelAndUpdate, delete, equals, getChildTopicsModel, getId, getIndexValue, getSimpleValue, getTypeUri, getUri, hashCode, isSimple, loadChildTopics, loadChildTopics, postCreate, preCreate, set, setChildTopicsModel, setId, setSimpleValue, setSimpleValue, setSimpleValue, setSimpleValue, setSimpleValue, setTypeUri, setUri, update, updateChildTopics, updateSimpleValue, updateTypeUri, updateUri, updateWithChildTopics, uriChange
finalize, getClass, notify, notifyAll, wait, wait, wait
createRoleModel, getChildTopicsModel, getId, getSimpleValue, getTypeUri, getUri, set, setChildTopicsModel, setId, setSimpleValue, setSimpleValue, setSimpleValue, setSimpleValue, setSimpleValue, setTypeUri, setUri
forEach, spliterator
private String dataTypeUri
private List<IndexMode> indexModes
private SequencedHashMap<String,AssociationDefinitionModelImpl> assocDefs
private ViewConfigurationModelImpl viewConfig
TypeModelImpl(TopicModelImpl typeTopic, String dataTypeUri, List<IndexMode> indexModes, List<AssociationDefinitionModel> assocDefs, ViewConfigurationModelImpl viewConfig)
TypeModelImpl(TypeModelImpl type)
public String getDataTypeUri()
getDataTypeUri
in interface TypeModel
public void setDataTypeUri(String dataTypeUri)
setDataTypeUri
in interface TypeModel
public List<IndexMode> getIndexModes()
getIndexModes
in interface TypeModel
public void addIndexMode(IndexMode indexMode)
addIndexMode
in interface TypeModel
public Collection<AssociationDefinitionModelImpl> getAssocDefs()
getAssocDefs
in interface TypeModel
public AssociationDefinitionModelImpl getAssocDef(String assocDefUri)
getAssocDef
in interface TypeModel
public boolean hasAssocDef(String assocDefUri)
hasAssocDef
in interface TypeModel
public TypeModel addAssocDef(AssociationDefinitionModel assocDef)
addAssocDef
in interface TypeModel
assocDef
- the assoc def to add.
Note: its ID might be uninitialized (-1).public TypeModel addAssocDefBefore(AssociationDefinitionModel assocDef, String beforeAssocDefUri)
addAssocDefBefore
in interface TypeModel
assocDef
- the assoc def to add.
Note: its ID might be uninitialized (-1).beforeAssocDefUri
- the URI of the assoc def before the given assoc def is inserted.
If null
the assoc def is appended at the end.public AssociationDefinitionModel removeAssocDef(String assocDefUri)
removeAssocDef
in interface TypeModel
public ViewConfigurationModelImpl getViewConfig()
getViewConfig
in interface TypeModel
public Object getViewConfigValue(String configTypeUri, String childTypeUri)
getViewConfigValue
in interface TypeModel
public void setViewConfig(ViewConfigurationModel viewConfig)
setViewConfig
in interface TypeModel
public Iterator<String> iterator()
public org.codehaus.jettison.json.JSONObject toJSON()
toJSON
in interface JSONEnabled
toJSON
in class DeepaMehtaObjectModelImpl
public TypeModelImpl clone()
clone
in interface DeepaMehtaObjectModel
clone
in interface TopicModel
clone
in class TopicModelImpl
public String toString()
toString
in class TopicModelImpl
DeepaMehtaTypeImpl instantiate()
instantiate
in class TopicModelImpl
List<? extends DeepaMehtaObjectModelImpl> getAllInstances()
Directive getUpdateTypeDirective()
Directive getDeleteTypeDirective()
void preUpdate(DeepaMehtaObjectModel updateModel)
preUpdate
in class DeepaMehtaObjectModelImpl
void postUpdate(DeepaMehtaObjectModel updateModel, DeepaMehtaObjectModel oldObject)
postUpdate
in class DeepaMehtaObjectModelImpl
void preDelete()
preDelete
in class TopicModelImpl
void postDelete()
postDelete
in class DeepaMehtaObjectModelImpl
final void updateDataTypeUri(String dataTypeUri)
final void _addIndexMode(IndexMode indexMode)
final void _addAssocDefBefore(AssociationDefinitionModelImpl assocDef, String beforeAssocDefUri)
final void _removeAssocDef(String assocDefUri)
final void _addAssocDef(AssociationModelImpl assoc)
final void _updateAssocDef(AssociationModel assoc, AssociationModel oldAssoc)
assoc
- the updated generic association. ### FIXDOC: might be an assoc def as wellfinal void _removeAssocDefFromMemoryAndRebuildSequence(AssociationModel assoc)
final List<String> getLabelConfig()
final <M extends TypeModelImpl> M filterReadableAssocDefs()
private void addUpdateTypeDirective()
private void updateType(TypeModelImpl updateModel)
private void _updateDataTypeUri(String newDataTypeUri)
private void _updateAssocDefs(Collection<AssociationDefinitionModelImpl> newAssocDefs)
private void _updateSequence(Collection<AssociationDefinitionModelImpl> newAssocDefs)
private void storeDataTypeUri()
private void indexAllInstances(IndexMode indexMode)
private String[] findAssocDefUris(long assocDefId)
private boolean hasSameAssocDefSequence(Collection<? extends AssociationDefinitionModel> assocDefs)
private void rehashAssocDefs(Collection<AssociationDefinitionModelImpl> newAssocDefs)
private void rehashAssocDef(String assocDefUri, String beforeAssocDefUri)
private AssociationDefinitionModelImpl getAssocDefOrThrow(String assocDefUri)
private AssociationDefinitionModelImpl _getAssocDef(String assocDefUri)
private long lastAssocDefId()
-1
if there are no association definitions.private long firstAssocDefId()
private String getFirstAssocDefUri()
private long checkAssocDefId(AssociationDefinitionModel assocDef)
private SequencedHashMap<String,AssociationDefinitionModelImpl> toMap(Collection<? extends AssociationDefinitionModel> assocDefs)
private void putInTypeCache()
private void removeFromTypeCache()
private org.codehaus.jettison.json.JSONArray toJSONArray(List<IndexMode> indexModes)
private org.codehaus.jettison.json.JSONArray toJSONArray(Collection<? extends AssociationDefinitionModel> assocDefs)
Copyright © 2018. All Rights Reserved.