|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.interactive_instruments.ShapeChange.Model.ModelImpl
de.interactive_instruments.ShapeChange.Model.Generic.GenericModel
public class GenericModel
Nested Class Summary | |
---|---|
static class |
GenericModel.PropertyCopyDuplicatBehaviorIndicator
Identifies different behaviors for situations in which a property is intended to be copied to a class but another property with the same name already exists in that class. |
static class |
GenericModel.PropertyCopyPositionIndicator
|
Field Summary | |
---|---|
protected Set<String> |
appSchemaPackageIds
|
protected String |
characterEncoding
|
protected Map<String,GenericPackageInfo> |
genAppSchema
Key: application schema package name Value: the application schema package |
protected Map<String,GenericAssociationInfo> |
genAssociationInfosById
|
protected Map<String,GenericClassInfo> |
genClassInfosById
|
protected Map<String,GenericClassInfo> |
genClassInfosByName
|
protected Map<String,GenericPackageInfo> |
genPackageInfosById
|
protected Map<String,GenericPropertyInfo> |
genPropertiesById
|
protected Model |
model
|
protected Options |
options
|
protected ShapeChangeResult |
result
|
Fields inherited from class de.interactive_instruments.ShapeChange.Model.ModelImpl |
---|
allowedTags, gmlTags, jsonTags, postprocessed, shapeChangeTags |
Constructor Summary | |
---|---|
GenericModel(Model model)
|
Method Summary | |
---|---|
void |
add(GenericPropertyInfo newProperty,
ClassInfo classToAddProperty)
Adds the property to the model map and also the given class. |
void |
add(GenericPropertyInfo newProperty,
ClassInfo classToAddProperty,
GenericModel.PropertyCopyDuplicatBehaviorIndicator behavior)
Adds the property to the model map and also the given class. |
void |
addClass(GenericClassInfo genCi)
|
String |
characterEncoding()
|
ClassInfo |
classById(String id)
|
ClassInfo |
classByName(String name)
|
HashSet<ClassInfo> |
classes(PackageInfo pi)
Return all ClassInfo objects contained in the given package and in sub- packages, which do not belong to an app schema different to the one of the given package. |
void |
copyClassContent(GenericClassInfo fromClass,
GenericClassInfo toClass,
GenericModel.PropertyCopyPositionIndicator copyPositionIndicator,
GenericModel.PropertyCopyDuplicatBehaviorIndicator duplicateHandling)
Copies the content of fromClass to toClass, including properties, associations (also self associations), but NOT constraints (because they are automatically retrieved and potentially overridden by each class while the input model is loaded). |
GenericAssociationInfo |
createCopy(AssociationInfo ai,
String copyId)
Creates a copy of the given association. |
GenericPropertyInfo |
createCopy(PropertyInfo pi,
String copyId)
Creates a copy of the given property. |
void |
dissolveAssociation(GenericAssociationInfo genAI)
Basically turns the properties representing the two ends of an association into attributes of the classes they are in (unless the association end is not navigable). |
Set<GenericPackageInfo> |
getAppSchemaPackages()
|
Map<String,GenericAssociationInfo> |
getGenAssociations()
|
Map<String,GenericClassInfo> |
getGenClasses()
|
Map<String,GenericPackageInfo> |
getGenPackages()
|
Map<String,GenericPropertyInfo> |
getGenProperties()
|
void |
initialise(ShapeChangeResult r,
Options o,
String repositoryFileName)
|
boolean |
isInAppSchema(ClassInfo ci)
|
boolean |
isInAppSchema(PackageInfo pi)
|
Options |
options()
|
PackageInfo |
packageById(String id)
|
HashSet<PackageInfo> |
packages()
|
void |
postprocessAfterLoadingAndValidate()
Execute postprocessing and validation checks before the conversion |
void |
remove(Collection<GenericClassInfo> cisToRemove)
Removes the given classes from the model. |
void |
remove(GenericClassInfo ciToRemove)
Removes the given class from the model. |
void |
remove(GenericPropertyInfo genPi,
boolean tryKeepAssociation)
Removes the property from the model. |
void |
remove(Set<PackageInfo> packagesToRemove)
Removes all of the packages in the set from the model, including all classes contained in these packages. |
void |
removeByClassCategory(int classCategory)
|
void |
removeByClassId(String id)
|
ShapeChangeResult |
result()
|
HashSet<PackageInfo> |
schemas(String name)
Collect and return all PackageInfo objects tagged as being a schema. |
void |
shutdown()
|
String |
toString(String indent)
|
int |
type()
|
void |
updateClassName(GenericClassInfo genCi,
String newName)
Replaces the current name of the class with the given name, applying the update in the model as well (superclasses, subtypes, model, and property type info). |
Methods inherited from class de.interactive_instruments.ShapeChange.Model.ModelImpl |
---|
initialise, normalizeTaggedValue, selectedSchemas |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Options options
protected ShapeChangeResult result
protected String characterEncoding
protected Model model
protected Set<String> appSchemaPackageIds
protected Map<String,GenericPropertyInfo> genPropertiesById
protected Map<String,GenericAssociationInfo> genAssociationInfosById
protected Map<String,GenericClassInfo> genClassInfosById
protected Map<String,GenericClassInfo> genClassInfosByName
protected Map<String,GenericPackageInfo> genPackageInfosById
protected Map<String,GenericPackageInfo> genAppSchema
Constructor Detail |
---|
public GenericModel(Model model)
Method Detail |
---|
public void addClass(GenericClassInfo genCi)
public boolean isInAppSchema(PackageInfo pi)
public boolean isInAppSchema(ClassInfo ci)
public Options options()
Model.options()
public ShapeChangeResult result()
Model.result()
public void initialise(ShapeChangeResult r, Options o, String repositoryFileName) throws ShapeChangeAbortException
ShapeChangeAbortException
de.interactive_instruments.ShapeChange.Model.Model#initialise(de.
interactive_instruments.ShapeChange.ShapeChangeResult,
de.interactive_instruments.ShapeChange.Options, java.lang.String)
public int type()
public HashSet<PackageInfo> schemas(String name)
de.interactive_instruments.ShapeChange.Model.Model#schemas(java.lang.
String)
public HashSet<ClassInfo> classes(PackageInfo pi)
de.interactive_instruments.ShapeChange.Model.Model#classes(de.
interactive_instruments.ShapeChange.Model.PackageInfo)
public void postprocessAfterLoadingAndValidate()
ModelImpl
postprocessAfterLoadingAndValidate
in interface Model
postprocessAfterLoadingAndValidate
in class ModelImpl
postprocessAfterLoadingAndValidate()
public PackageInfo packageById(String id)
de.interactive_instruments.ShapeChange.Model.Model#packageById(java.lang
.String)
public ClassInfo classById(String id)
de.interactive_instruments.ShapeChange.Model.Model#classById(java.lang
.String)
public ClassInfo classByName(String name)
de.interactive_instruments.ShapeChange.Model.Model#classByName(java.lang
.String)
public void shutdown()
Model.shutdown()
public String characterEncoding()
Model.characterEncoding()
public String toString(String indent)
public void add(GenericPropertyInfo newProperty, ClassInfo classToAddProperty)
add(GenericPropertyInfo, ClassInfo, PropertyCopyDuplicatBehaviorIndicator)
to control this behavior.
newProperty
- classToAddProperty
- public void add(GenericPropertyInfo newProperty, ClassInfo classToAddProperty, GenericModel.PropertyCopyDuplicatBehaviorIndicator behavior)
newProperty
- classToAddProperty
- behavior
- public void remove(GenericClassInfo ciToRemove)
ciToRemove
- public void remove(Collection<GenericClassInfo> cisToRemove)
cisToRemove
- public Map<String,GenericAssociationInfo> getGenAssociations()
public Map<String,GenericPropertyInfo> getGenProperties()
public Map<String,GenericPackageInfo> getGenPackages()
public Map<String,GenericClassInfo> getGenClasses()
public void remove(GenericPropertyInfo genPi, boolean tryKeepAssociation)
genPi
- the property that potentially is removed from the model and
its class (depends on the tryKeepAssociation parameter and
whether the property is navigable or not)tryKeepAssociation
- true if the algorithm should only delete the property if the
association it potentially belongs to is no longer navigable
(in both directions) after the property has been set to be
non-navigable, false if any association the property belongs
to shall be removed outright.public void removeByClassCategory(int classCategory)
public Set<GenericPackageInfo> getAppSchemaPackages()
public void copyClassContent(GenericClassInfo fromClass, GenericClassInfo toClass, GenericModel.PropertyCopyPositionIndicator copyPositionIndicator, GenericModel.PropertyCopyDuplicatBehaviorIndicator duplicateHandling)
fromClass
- toClass
- copyPositionIndicator
- duplicateHandling
- public GenericAssociationInfo createCopy(AssociationInfo ai, String copyId)
ai
- copyId
-
public GenericPropertyInfo createCopy(PropertyInfo pi, String copyId)
pi
- copyId
-
public void remove(Set<PackageInfo> packagesToRemove)
packagesToRemove
- public void dissolveAssociation(GenericAssociationInfo genAI)
null
. Each property that is kept in the model is set to be
an attribute, a composition, but no aggregation. Finally, the reference
to the association is removed from the model.
WARNING: a possibly existing association class is also removed from the
model, with all its properties and links to other model elements!
genAI
- public void updateClassName(GenericClassInfo genCi, String newName)
newName
- public HashSet<PackageInfo> packages()
PackageInfo
objects contained in the modelpublic void removeByClassId(String id)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |