de.interactive_instruments.ShapeChange.Model.EA
Class ClassInfoEA

java.lang.Object
  extended by de.interactive_instruments.ShapeChange.Model.InfoImpl
      extended by de.interactive_instruments.ShapeChange.Model.ClassInfoImpl
          extended by de.interactive_instruments.ShapeChange.Model.EA.ClassInfoEA
All Implemented Interfaces:
ClassInfo, Info

public class ClassInfoEA
extends ClassInfoImpl
implements ClassInfo


Field Summary
protected  boolean aliasAccessed
          Flag used to prevent duplicate retrieval/computation of the alias of this class.
protected  AssociationInfo assoc
          Cache for the association this class belongs to if it is an association class.
protected  ClassInfoEA baseclassInfo
          Baseclasses
protected  HashSet<ClassInfoEA> baseclassInfoSet
           
protected  boolean connectorsAccessed
          Flag used to prevent duplicate retrieval/computation of the connectors of this class.
protected  org.sparx.Collection<org.sparx.Connector> conns
          Access to the connectors of this class in the EA model
protected  Vector<Constraint> constraintsCache
          Cache set of constraints
protected  EADocument document
          Access to the document object
protected  boolean documentationAccessed
          Flag used to prevent duplicate retrieval/computation of the documentation of this class.
protected  org.sparx.Element eaClassElement
          The EA element addressed by this ClassInfo
protected  int eaClassId
          The EA object id of the class element object
protected  String eaName
          Name of the class
protected  boolean hasNilReason
          Does this class possess nilReason properties?
protected  boolean isAbstract
          Some class flags.
protected  boolean isAssocClassAccessed
          Flag used to prevent duplicate retrieval/computation of the association of this class.
protected  boolean isLeaf
           
protected  TreeMap<Integer,OperationInfo> operationsCache
          Cache (ordered) set for operations
protected  PackageInfoEA packageInfo
          The package the class belongs to
protected  TreeMap<StructuredNumber,PropertyInfo> propertiesCache
          Cache (ordered) set for properties
protected  Vector<PropertyInfoEA> registeredRoles
          Roles registered as properties of the class
protected  HashSet<String> stereotypesCache
          Cache set for stereotypes
protected  HashSet<ClassInfoEA> subclassInfoSet
          Subclasses
protected  HashSet<String> supplierIds
          Cache for the IDs of the suppliers of this class
protected  HashMap<String,String> taggedValuesCache
          Cache map for tagged values
 
Fields inherited from class de.interactive_instruments.ShapeChange.Model.ClassInfoImpl
category, diagrams, processed
 
Fields inherited from class de.interactive_instruments.ShapeChange.Model.InfoImpl
aliasName, definition, description, documentation
 
Constructor Summary
ClassInfoEA(EADocument doc, PackageInfoEA pi, org.sparx.Element elmt)
          Create new ClassInfo object
 
Method Summary
 String aliasName()
          Get alias name of the class.
 ClassInfo baseClass()
          This determines the particular base class of a class in the sense of ISO19136 annex D+E.
 boolean checkSupertypes(int cat)
          This is supposed to find out, whether the given category 'cat' applied in 'this' class complies to the categories of all its base classes.
 Vector<Constraint> constraints()
          This method returns the constraints associated with the class.
 String documentation()
          Return the documentation attached to the property object.
 void establishAssociations()
           
 void establishClassDerivationHierarchy()
           
 void establishRoles(PropertyInfoEA pi)
           
 org.sparx.Element getEaClassElement()
          Inquire wrapped EA object
 boolean hasNilReason()
          This an indication that the class has a property that has the tagged value "implementedByNilReason" is set to "true".
 String id()
          Return model-unique id of class.
 boolean isAbstract()
          Determine whether the class is tagged as being an abstract class
 AssociationInfo isAssocClass()
           
 boolean isLeaf()
          Determine whether the class is tagged as being a leaf class
 Model model()
          Return EA model object.
 String name()
          Obtain the name of the class.
 OperationInfo operation(String name, String[] types)
          Find the operation identified by its name and the types of its parameters in this class or (if not present there) recursively in its base classes.
 Options options()
          Return options and configuration object.
 PackageInfo pkg()
          Return the parent package of the class.
 TreeMap<StructuredNumber,PropertyInfo> properties()
          Return all properties
 PropertyInfo property(String name)
          Find the property given by its name in this class or (if not present there) recursively in its base classes.
 ShapeChangeResult result()
          Return result object for error reporting.
 Set<String> stereotypes()
          Return the normalized stereotypes of the class.
 HashSet<String> subtypes()
          Provide the ids of all subclasses of this class.
 HashSet<String> supertypes()
          Provide the ids of all base classes of this class.
protected  HashSet<String> supplierIds()
           
 String taggedValue(String tag)
          Return the tagged value for the tag given or null if missing.
 void taggedValue(String tag, String value)
          Set the tagged value for the tag given.
 HashMap<String,String> taggedValues()
           
 HashMap<String,String> taggedValues(String tagList)
          Return all the tagged values listed in the input string.
 
Methods inherited from class de.interactive_instruments.ShapeChange.Model.ClassInfoImpl
asCharacterString, asDictionary, asDictionaryGml33, asGroup, category, encodingRule, establishCategory, fixIfCategoryIsUnknown, fullName, getDiagrams, hasConstraint, includeByValuePropertyType, includePropertyType, inSchema, isCollection, isKindOf, isSubtype, isUnionDirect, ns, nsabr, postprocessAfterLoadingAndValidate, processed, processed, qname, setDiagrams, suppressed, unsuppressedSupertype, xmlSchemaType
 
Methods inherited from class de.interactive_instruments.ShapeChange.Model.InfoImpl
definition, description, matches, stereotype
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.interactive_instruments.ShapeChange.Model.ClassInfo
asCharacterString, asDictionary, asDictionaryGml33, asGroup, category, getDiagrams, hasConstraint, includeByValuePropertyType, includePropertyType, inSchema, isCollection, isKindOf, isSubtype, isUnionDirect, processed, processed, qname, setDiagrams, suppressed, unsuppressedSupertype, xmlSchemaType
 
Methods inherited from interface de.interactive_instruments.ShapeChange.Model.Info
definition, description, encodingRule, fullName, matches, postprocessAfterLoadingAndValidate, stereotype
 

Field Detail

aliasAccessed

protected boolean aliasAccessed
Flag used to prevent duplicate retrieval/computation of the alias of this class.


connectorsAccessed

protected boolean connectorsAccessed
Flag used to prevent duplicate retrieval/computation of the connectors of this class.


documentationAccessed

protected boolean documentationAccessed
Flag used to prevent duplicate retrieval/computation of the documentation of this class.


isAssocClassAccessed

protected boolean isAssocClassAccessed
Flag used to prevent duplicate retrieval/computation of the association of this class.


assoc

protected AssociationInfo assoc
Cache for the association this class belongs to if it is an association class.


conns

protected org.sparx.Collection<org.sparx.Connector> conns
Access to the connectors of this class in the EA model


supplierIds

protected HashSet<String> supplierIds
Cache for the IDs of the suppliers of this class


document

protected EADocument document
Access to the document object


packageInfo

protected PackageInfoEA packageInfo
The package the class belongs to


baseclassInfo

protected ClassInfoEA baseclassInfo
Baseclasses


baseclassInfoSet

protected HashSet<ClassInfoEA> baseclassInfoSet

subclassInfoSet

protected HashSet<ClassInfoEA> subclassInfoSet
Subclasses


eaClassElement

protected org.sparx.Element eaClassElement
The EA element addressed by this ClassInfo


eaClassId

protected int eaClassId
The EA object id of the class element object


eaName

protected String eaName
Name of the class


isAbstract

protected boolean isAbstract
Some class flags.


isLeaf

protected boolean isLeaf

registeredRoles

protected Vector<PropertyInfoEA> registeredRoles
Roles registered as properties of the class


taggedValuesCache

protected HashMap<String,String> taggedValuesCache
Cache map for tagged values


stereotypesCache

protected HashSet<String> stereotypesCache
Cache set for stereotypes


propertiesCache

protected TreeMap<StructuredNumber,PropertyInfo> propertiesCache
Cache (ordered) set for properties


operationsCache

protected TreeMap<Integer,OperationInfo> operationsCache
Cache (ordered) set for operations


constraintsCache

protected Vector<Constraint> constraintsCache
Cache set of constraints


hasNilReason

protected boolean hasNilReason
Does this class possess nilReason properties?

Constructor Detail

ClassInfoEA

public ClassInfoEA(EADocument doc,
                   PackageInfoEA pi,
                   org.sparx.Element elmt)
            throws ShapeChangeAbortException
Create new ClassInfo object

Throws:
ShapeChangeAbortException
Method Detail

establishClassDerivationHierarchy

public void establishClassDerivationHierarchy()

establishAssociations

public void establishAssociations()

establishRoles

public void establishRoles(PropertyInfoEA pi)

getEaClassElement

public org.sparx.Element getEaClassElement()
Inquire wrapped EA object


model

public Model model()
Return EA model object.

Specified by:
model in interface Info

options

public Options options()
Return options and configuration object.

Specified by:
options in interface Info

result

public ShapeChangeResult result()
Return result object for error reporting.

Specified by:
result in interface Info

baseClass

public ClassInfo baseClass()
This determines the particular base class of a class in the sense of ISO19136 annex D+E. Only classes of categories resulting from the acknowledged stereotypes are considered. A base class is selected if it has the same category as this class or category unknown. However mixin classes are always ignored.

Specified by:
baseClass in interface ClassInfo

checkSupertypes

public boolean checkSupertypes(int cat)
This is supposed to find out, whether the given category 'cat' applied in 'this' class complies to the categories of all its base classes. If at least one base class does not comply, 'false' is returned. Overloaded from supertype, because we here have more comfortable data structures available.

Specified by:
checkSupertypes in interface ClassInfo
Overrides:
checkSupertypes in class ClassInfoImpl

pkg

public PackageInfo pkg()
Return the parent package of the class.

Specified by:
pkg in interface ClassInfo

properties

public TreeMap<StructuredNumber,PropertyInfo> properties()
Return all properties

Specified by:
properties in interface ClassInfo

property

public PropertyInfo property(String name)
Find the property given by its name in this class or (if not present there) recursively in its base classes.

Specified by:
property in interface ClassInfo
Returns:

stereotypes

public Set<String> stereotypes()
Return the normalized stereotypes of the class.

Specified by:
stereotypes in interface Info

subtypes

public HashSet<String> subtypes()
Provide the ids of all subclasses of this class.

Specified by:
subtypes in interface ClassInfo
Returns:
Set with the ids of all subtypes of this class (WARNING: this can be a shallow copy or derived set, thus it is not safe to assume that modifications to this set will update the subtype information in the class itself).

supertypes

public HashSet<String> supertypes()
Provide the ids of all base classes of this class.

Specified by:
supertypes in interface ClassInfo
Returns:
Set of ids of the base classes of this class.

documentation

public String documentation()
Return the documentation attached to the property object. This is fetched from tagged values and - if this is absent - from the 'notes' specific to the EA objects model.

Specified by:
documentation in interface Info
Overrides:
documentation in class InfoImpl

id

public String id()
Return model-unique id of class.

Specified by:
id in interface Info

name

public String name()
Obtain the name of the class.

Specified by:
name in interface Info

aliasName

public String aliasName()
Get alias name of the class.

Specified by:
aliasName in interface Info
Overrides:
aliasName in class InfoImpl
Returns:
the human readable name or an empty string if none exists

taggedValues

public HashMap<String,String> taggedValues(String tagList)
Return all the tagged values listed in the input string. Tags are assumed to be separated by commas.

Specified by:
taggedValues in interface Info

taggedValue

public String taggedValue(String tag)
Return the tagged value for the tag given or null if missing.

Specified by:
taggedValue in interface Info
Parameters:
tag - name of the tagged value to look up
Returns:
the tagged value for the tag given or null if the tagged value is missing.

taggedValue

public void taggedValue(String tag,
                        String value)
Set the tagged value for the tag given.


isAbstract

public boolean isAbstract()
Determine whether the class is tagged as being an abstract class

Specified by:
isAbstract in interface ClassInfo

isLeaf

public boolean isLeaf()
Determine whether the class is tagged as being a leaf class

Specified by:
isLeaf in interface ClassInfo

hasNilReason

public boolean hasNilReason()
This an indication that the class has a property that has the tagged value "implementedByNilReason" is set to "true". This is a specific encoding rule to support a modelling pattern that NGA uses (they do not like the <> stereotype and think it hides concepts). These extensions need to be separated better from the core rules.

Specified by:
hasNilReason in interface ClassInfo

constraints

public Vector<Constraint> constraints()
This method returns the constraints associated with the class.

Specified by:
constraints in interface ClassInfo

operation

public OperationInfo operation(String name,
                               String[] types)
Find the operation identified by its name and the types of its parameters in this class or (if not present there) recursively in its base classes.

Specified by:
operation in interface ClassInfo

isAssocClass

public AssociationInfo isAssocClass()
Specified by:
isAssocClass in interface ClassInfo

taggedValues

public HashMap<String,String> taggedValues()
Specified by:
taggedValues in interface Info
Returns:
a map with the tagged values defined for this object (key: tagged value name, value: the value of the tagged value); can be an empty map but not null
See Also:
Info.taggedValues()

supplierIds

protected HashSet<String> supplierIds()
Returns:
set of ids of classes this class depends on


Copyright © 2015. All rights reserved.