public class GenericClassInfo extends ClassInfoImpl implements MessageSource
Modifier and Type | Field and Description |
---|---|
protected AssociationInfo |
assocClass |
protected ClassInfo |
baseClass |
protected Vector<Constraint> |
constraints
May be null
|
protected String |
id |
protected boolean |
isAbstract |
protected boolean |
isLeaf |
protected GenericModel |
model |
protected String |
name |
protected Options |
options |
protected PackageInfo |
pkg |
protected SortedMap<StructuredNumber,PropertyInfo> |
properties |
protected ShapeChangeResult |
result |
protected TreeSet<String> |
subtypes |
protected TreeSet<String> |
supertypes
Set of ids of all base classes of this class
|
category, diagrams, profiles
descriptors, stereotypesCache, taggedValuesCache
Constructor and Description |
---|
GenericClassInfo() |
GenericClassInfo(GenericModel model,
String id,
String name,
int category) |
Modifier and Type | Method and Description |
---|---|
void |
addConstraints(List<Constraint> list)
Adds the given constraints to the constraints of this class, preventing
duplicates (references to same constraint object).
|
void |
addPrefixToModelElementIDs(String prefix)
Adds the prefix to the 'id' of this class as well as the 'subtypes' (if
not
null ) and the 'supertypes' (if not null ). |
void |
addPropertiesAtBottom(List<GenericPropertyInfo> newProps,
GenericModel.PropertyCopyDuplicatBehaviorIndicator duplicateHandling)
Adds the given list of new properties to this class.
|
void |
addPropertiesAtTop(List<GenericPropertyInfo> newProps,
GenericModel.PropertyCopyDuplicatBehaviorIndicator duplicateHandling)
Adds the given list of new properties to this class.
|
void |
addPropertiesInSequence(List<GenericPropertyInfo> newProps,
GenericModel.PropertyCopyDuplicatBehaviorIndicator duplicateHandling)
Adds the given list of new properties to this class.
|
void |
addProperty(GenericPropertyInfo newProperty,
GenericModel.PropertyCopyDuplicatBehaviorIndicator duplicateHandling)
Adds the new property to the set of properties of this class.
|
void |
addPropertyAtBottom(GenericPropertyInfo newProp,
GenericModel.PropertyCopyDuplicatBehaviorIndicator duplicateHandling)
Adds the given property to this class.
|
boolean |
addSubtype(String subtypeId) |
boolean |
addSupertype(String supertypeId) |
ClassInfo |
baseClass()
This determines the particular base class of a class in the sense of
ISO19136 annex D+E.
|
List<Constraint> |
constraints()
This method returns the constraints associated with the class.
|
GenericClassInfo |
createCopy(String copyId,
String copyName,
int copyCategory)
WARNING: creates copies of attributes, but NOT of association roles
|
String |
fullName()
Fully qualified UML name (Package1::...
|
StructuredNumber |
getNextSequenceNumber() |
boolean |
hasConstraints() |
boolean |
hasSubtypes() |
boolean |
hasSupertypes() |
String |
id()
Return unique id of model element (unique within the model).
|
boolean |
isAbstract() |
AssociationInfo |
isAssocClass() |
boolean |
isLeaf() |
String |
message(int mnr)
Return a message for a message number.
|
GenericModel |
model() |
String |
name()
Obtain the name of the model element.
|
OperationInfo |
operation(String name,
String[] types)
NOTE: Operations are currently not supported
|
Options |
options() |
PackageInfo |
pkg() |
String |
printAsString(String indent) |
SortedMap<StructuredNumber,PropertyInfo> |
properties()
Get a map of all navigable properties (attributes and association roles)
that belong to this class - NOT one of its base classes.
|
PropertyInfo |
property(String name)
Find the property given by its name in this class or (if not present
there) recursively in its base classes.
|
GenericPropertyInfo |
propertyBySequenceNumber(StructuredNumber sn) |
void |
removeByStructuredNumber(StructuredNumber sn)
Removes the property from this class where
property.sequenceNumber().equals(sn) . |
void |
removePropertyById(String id) |
void |
removeSubtype(String subtypeId) |
void |
removeSupertype(String supertypeId)
Removes the supertype with given ID from the list of supertypes defined
for this class.
|
ShapeChangeResult |
result() |
void |
setAssocInfo(AssociationInfo assocClass) |
void |
setBaseClass(ClassInfo baseClass) |
void |
setCategory(int category) |
void |
setConstraints(Vector<Constraint> list) |
void |
setId(String id) |
void |
setIsAbstract(boolean isAbstract) |
void |
setIsLeaf(boolean isLeaf) |
void |
setModel(GenericModel model) |
void |
setName(String name) |
void |
setOptions(Options options) |
void |
setPkg(PackageInfo pkg) |
void |
setProfiles(Profiles profiles) |
void |
setProperties(SortedMap<StructuredNumber,PropertyInfo> properties) |
void |
setResult(ShapeChangeResult result) |
void |
setStereotype(String stereotype) |
void |
setStereotypes(Stereotypes stereotypeSet) |
void |
setSubtypes(TreeSet<String> subtypes) |
void |
setSupertypes(TreeSet<String> supertypes) |
void |
setTaggedValue(String tvName,
String tvValue,
boolean updateFields)
Puts the given tagged value into the existing tagged values cache,
updating fields if requested via parameter.
|
void |
setTaggedValues(TaggedValues taggedValues,
boolean updateFields) |
TreeSet<String> |
subtypes()
Returns the list of ids of the subtypes that belong to this class.
|
TreeSet<String> |
supertypes()
Provides the ids of all direct base classes of this class (includes the
class that is returned by method
ClassInfo.baseClass() ). |
void |
updateSubtypeId(String currentId,
String newId) |
void |
updateSupertypeId(String currentId,
String newId)
NOTE: does not update baseclass info
|
void |
validateStereotypesCache()
Save the (normalized) stereotypes in the cache.
|
void |
validateTaggedValuesCache()
Create cache of stereotypes and tagged values
|
asCharacterString, asDictionary, asDictionaryGml33, asGroup, category, checkSupertypes, encodingRule, establishCategory, fixIfCategoryIsUnknown, fullNameInSchema, getDiagrams, hasConstraint, hasNilReason, includeByValuePropertyType, includePropertyType, inSchema, isCollection, isKindOf, isSubtype, isUnionDirect, language, ns, nsabr, ownedProperty, postprocessAfterLoadingAndValidate, profiles, propertiesAll, qname, setDiagrams, subtypesInCompleteHierarchy, supertypesInCompleteHierarchy, suppressed, unsuppressedSupertype, xmlSchemaType
aliasName, compareTo, dataCaptureStatements, definition, derivedDocumentation, description, descriptors, descriptorSource, descriptorValues, documentation, examples, globalIdentifier, legalBasis, matches, primaryCode, removeTaggedValue, setDescriptors, stereotype, stereotypes, taggedValue, taggedValueInLanguage, taggedValues, taggedValues, taggedValuesAll, taggedValuesForTag, taggedValuesForTagAsLangStrings, taggedValuesForTagList, taggedValuesInLanguage
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
aliasName, dataCaptureStatements, definition, derivedDocumentation, description, descriptors, documentation, examples, globalIdentifier, legalBasis, matches, primaryCode, removeTaggedValue, stereotype, stereotypes, taggedValue, taggedValueInLanguage, taggedValues, taggedValues, taggedValuesAll, taggedValuesForTag, taggedValuesForTagAsLangStrings, taggedValuesForTagList, taggedValuesInLanguage
compareTo
protected Options options
protected ShapeChangeResult result
protected GenericModel model
protected String id
protected String name
protected boolean isAbstract
protected boolean isLeaf
protected PackageInfo pkg
protected AssociationInfo assocClass
protected ClassInfo baseClass
protected SortedMap<StructuredNumber,PropertyInfo> properties
protected Vector<Constraint> constraints
public GenericClassInfo()
public GenericClassInfo(GenericModel model, String id, String name, int category)
public void setPkg(PackageInfo pkg)
pkg
- the pkg to setpublic void setIsAbstract(boolean isAbstract)
isAbstract
- the isAbstract to setpublic void setIsLeaf(boolean isLeaf)
isLeaf
- the isLeaf to setpublic void setAssocInfo(AssociationInfo assocClass)
isAssocClass
- the isAssocClass to setpublic void setSupertypes(TreeSet<String> supertypes)
supertypes
- the supertypes to set, can be null
public void setSubtypes(TreeSet<String> subtypes)
subtypes
- the subtypes to set, can be null
public void setBaseClass(ClassInfo baseClass)
baseClass
- the baseClass to set, can be null
public void setProperties(SortedMap<StructuredNumber,PropertyInfo> properties)
properties
- the properties to setpublic void setConstraints(Vector<Constraint> list)
list
- the constraints to set, may be null
public String fullName()
Info
fullName
in interface Info
fullName
in class ClassInfoImpl
PackageInfoImpl.fullName()
public String id()
Info
public GenericModel model()
model
in interface Info
Info.model()
public String name()
Info
name
in interface Info
Info.name()
public Options options()
options
in interface Info
Info.options()
public ShapeChangeResult result()
result
in interface Info
Info.result()
public void setId(String id)
id
- public void setModel(GenericModel model)
model
- public void setName(String name)
name
- public void setOptions(Options options)
options
- public void setResult(ShapeChangeResult result)
result
- public void validateStereotypesCache()
validateStereotypesCache
in interface Info
public void setStereotypes(Stereotypes stereotypeSet)
stereotypeSet
- public void setStereotype(String stereotype)
stereotype
- public void validateTaggedValuesCache()
Info
validateTaggedValuesCache
in interface Info
public void setTaggedValues(TaggedValues taggedValues, boolean updateFields)
taggedValues
- updateFields
- true if class fields should be updated based upon information
from given tagged values, else falsepublic PackageInfo pkg()
pkg
in interface ClassInfo
ClassInfo.pkg()
public boolean isAbstract()
isAbstract
in interface ClassInfo
ClassInfo.isAbstract()
public boolean isLeaf()
isLeaf
in interface ClassInfo
ClassInfo.isLeaf()
public AssociationInfo isAssocClass()
isAssocClass
in interface ClassInfo
ClassInfo.isAssocClass()
public TreeSet<String> supertypes()
ClassInfo
ClassInfo.baseClass()
).supertypes
in interface ClassInfo
public TreeSet<String> subtypes()
NOTE: does NOT return a shallow copy, thus modifications of the returned set will modify the subtype information for this class
public boolean hasSupertypes()
public boolean hasSubtypes()
public boolean hasConstraints()
public ClassInfo baseClass()
ClassInfo
public SortedMap<StructuredNumber,PropertyInfo> properties()
ClassInfo
properties
in interface ClassInfo
null
.ClassInfo.properties()
public List<Constraint> constraints()
ClassInfo
constraints
in interface ClassInfo
null
public PropertyInfo property(String name)
ClassInfo
public OperationInfo operation(String name, String[] types)
public void setCategory(int category)
category
- public void removeSubtype(String subtypeId)
public boolean addSubtype(String subtypeId)
subtypeId
- true
if the specified subtype was not already
contained in the set of subtypespublic void removeSupertype(String supertypeId)
supertypeId
- public boolean addSupertype(String supertypeId)
supertypeId
- true
if the specified supertypeId was not already
contained in the set of supertypespublic void addProperty(GenericPropertyInfo newProperty, GenericModel.PropertyCopyDuplicatBehaviorIndicator duplicateHandling)
newProperty
- duplicateHandling
- public StructuredNumber getNextSequenceNumber()
public void addConstraints(List<Constraint> list)
list
- constraints to add; can be empty or null
public void removePropertyById(String id)
public void updateSupertypeId(String currentId, String newId)
currentId
- newId
- public GenericClassInfo createCopy(String copyId, String copyName, int copyCategory)
copyId
- copyName
- copyCategory
- useProxies
- true
if copies of attributes shall be created as
GenericPropertyInfoProxy instances, else false
.public void removeByStructuredNumber(StructuredNumber sn)
property.sequenceNumber().equals(sn)
.sn
- public void addPropertiesAtTop(List<GenericPropertyInfo> newProps, GenericModel.PropertyCopyDuplicatBehaviorIndicator duplicateHandling)
newProps
- duplicateHandling
- public GenericPropertyInfo propertyBySequenceNumber(StructuredNumber sn)
sn
- null
if no such property exists.public void addPropertiesInSequence(List<GenericPropertyInfo> newProps, GenericModel.PropertyCopyDuplicatBehaviorIndicator duplicateHandling)
newProps
- duplicateHandling
- public void addPropertyAtBottom(GenericPropertyInfo newProp, GenericModel.PropertyCopyDuplicatBehaviorIndicator duplicateHandling)
newProps
- duplicateHandling
- public void addPropertiesAtBottom(List<GenericPropertyInfo> newProps, GenericModel.PropertyCopyDuplicatBehaviorIndicator duplicateHandling)
newProps
- duplicateHandling
- public void setTaggedValue(String tvName, String tvValue, boolean updateFields)
tvName
- tvValue
- updateFields
- true if class fields should be updated based upon information
from given tagged value, else falsepublic void addPrefixToModelElementIDs(String prefix)
null
) and the 'supertypes' (if not null
).
Does NOT update the 'globalIdentifier'.
NOTE: this method is used by the FeatureCatalogue target to ensure that
IDs used in a reference model are unique to that model and do not get
mixed up with the IDs of the input model.prefix
- public void setProfiles(Profiles profiles)
profiles
- new set of profiles for this class; may be null
public String message(int mnr)
MessageSource
message
in interface MessageSource
Copyright © 2017. All rights reserved.