Package cruise.umple.compiler
Class UmpleClass
java.lang.Object
cruise.umple.compiler.UmpleElement
cruise.umple.compiler.UmpleClassifier
cruise.umple.compiler.UmpleClass
- Direct Known Subclasses:
AssociationClass
,UmpleTemplate
public class UmpleClass extends UmpleClassifier
An UmpleClass can contain attributes, associations, state machines and methods.
It can also have various other information such as a key (to identify uniqueness),
code to inject into generated code, and comments. It can be tagged with various
patterns, such as 'singleton', meaning that there can only be one instance,
and abstract, meaning it can't have any instances.
In Umple_Code.ump: Methods for computing complex properties
Fragment source file: Umple_Code.ump
Line : 1311
Fragment source file: Umple_Code.ump
Line : 1566
---------------------------------------------------------------------------------------------
------------------------------------class end------------------------------------------------
---------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------
------------------------------------class start----------------------------------------------
---------------------------------------------------------------------------------------------
----------------------------------------------------------
Handle the existing templates in the current umple model.
class UmpleModel {
UmpleTemplate getUmpleTemplate(String name){
for (UmpleTemplate aTemplate : getUmpleTemplates())
{
if (aTemplate.getName().equals(name))
{
return aTemplate;
}
}
return null;
}
public UmpleTemplate addUmpleTemplate(String name)
{
UmpleTemplate newTemplate = getUmpleTemplate(name);
if (newTemplate == null)
{
newTemplate = new UmpleTemplate(name, this);
addUmpleTemplate(newTemplate);
}
return newTemplate;
}
}
----------------------------------------------------------
An umple template contains a map for emittable strings
-
Field Summary
Fields Modifier and Type Field Description protected GeneratedClass
gClass
-
Constructor Summary
Constructors Constructor Description UmpleClass(java.lang.String name)
UmpleClass(java.lang.String aName, UmpleModel aSourceModel)
-
Method Summary
Methods inherited from class cruise.umple.compiler.UmpleClassifier
addConstant, addConstantAt, addDepend, addDependAt, addMethod, addMethodAt, addModelConstraint, addModelConstraintAt, addOrMoveConstantAt, addOrMoveDependAt, addOrMoveMethodAt, addOrMoveModelConstraintAt, getConstant, getConstants, getDepend, getDepends, getDistributeTechnology, getExtendsToken, getIsDistributable, getMethod, getMethods, getModelConstraint, getModelConstraints, getRelativePath, getSourceModel, hasConstants, hasDepends, hasExtendsToken, hasMethod, hasMethods, hasModelConstraints, indexOfConstant, indexOfDepend, indexOfMethod, indexOfModelConstraint, isIsDistributable, minimumNumberOfConstants, minimumNumberOfDepends, minimumNumberOfMethods, minimumNumberOfModelConstraints, numberOfConstants, numberOfDepends, numberOfMethods, numberOfModelConstraints, removeConstant, removeDepend, removeMethod, removeModelConstraint, setDistributeTechnology, setExtendsToken, setIsDistributable, setSourceModel
Methods inherited from class cruise.umple.compiler.UmpleElement
addEndPosition, addEndPositionAt, addNamespace, addOrMoveEndPositionAt, addOrMovePositionAt, addPosition, addPositionAt, appendExtraCode, appendExtraCode, appendExtraCode, getCoordinates, getDisplayColor, getEndPosition, getEndPositions, getExtraCode, getHasMainMethod, getIsInternal, getModifier, getName, getNamespace, getNameSpace, getNamespaces, getPackageName, getPosition, getPositions, hasEndPositions, hasExtraCode, hasNamespaces, hasPositions, indexOfEndPosition, indexOfNamespace, indexOfPosition, isHasMainMethod, isIsInternal, isUmpleInterface, isUmpleTrait, minimumNumberOfEndPositions, minimumNumberOfPositions, numberOfEndPositions, numberOfNamespaces, numberOfPositions, removeEndPosition, removeNamespace, removePosition, resetExtraCode, setCoordinates, setDisplayColor, setHasMainMethod, setIsInternal, setModifier, setName, setNameSpace, setPackageName
-
Field Details
-
Constructor Details
-
UmpleClass
-
UmpleClass
public UmpleClass(java.lang.String name)
-
-
Method Details
-
setHasProxyPattern
public boolean setHasProxyPattern(boolean aHasProxyPattern) -
setNeedsDefaultInterface
public boolean setNeedsDefaultInterface(boolean aNeedsDefaultInterface) -
setIsDistributed
public boolean setIsDistributed(boolean aIsDistributed) -
setIsInternalSerializable
public boolean setIsInternalSerializable(boolean aIsInternalSerializable) -
setIsDefaultInterfaceRemoteRMI
public boolean setIsDefaultInterfaceRemoteRMI(boolean aIsDefaultInterfaceRemoteRMI) -
setLevel
public boolean setLevel(int aLevel) -
setIsInitialized
public boolean setIsInitialized(boolean aIsInitialized) -
setIsAbstract
public boolean setIsAbstract(boolean aIsAbstract) -
setIsSingleton
public boolean setIsSingleton(boolean aIsSingleton) -
addAssociation
-
removeAssociation
-
addUnimplementedMethod
-
removeUnimplementedMethod
-
setKey
-
setIsStatic
public boolean setIsStatic(boolean aIsStatic) -
addDisableAutogeneratedMethodList
public boolean addDisableAutogeneratedMethodList(java.lang.String aDisableAutogeneratedMethodList) -
removeDisableAutogeneratedMethodList
public boolean removeDisableAutogeneratedMethodList(java.lang.String aDisableAutogeneratedMethodList) -
setPropagateCounter
public boolean setPropagateCounter(int aPropagateCounter) -
addPortBindingInformation
-
removePortBindingInformation
-
setPortClass
public boolean setPortClass(boolean aPortClass) -
addEmitMethod
-
removeEmitMethod
-
setTemplateEmitStringMap
public boolean setTemplateEmitStringMap(java.util.Map<java.lang.String,TemplateAttributeParser> aTemplateEmitStringMap) -
setFilteredin
public boolean setFilteredin(boolean aFilteredin) -
getHasProxyPattern
public boolean getHasProxyPattern() -
getNeedsDefaultInterface
public boolean getNeedsDefaultInterface() -
getIsDistributed
public boolean getIsDistributed() -
getIsInternalSerializable
public boolean getIsInternalSerializable() -
getIsDefaultInterfaceRemoteRMI
public boolean getIsDefaultInterfaceRemoteRMI() -
getLevel
public int getLevel()dependency handling attributes -
getIsInitialized
public boolean getIsInitialized() -
getIsAbstract
public boolean getIsAbstract()Specifies whether or not the Umple class is an abstract class. -
getIsSingleton
public boolean getIsSingleton()Specifies whether or not the Umple class is a singleton. -
getAssociation
-
getAssociations
-
numberOfAssociations
public int numberOfAssociations() -
hasAssociations
public boolean hasAssociations() -
indexOfAssociation
-
getUnimplementedMethod
-
getUnimplementedMethods
-
numberOfUnimplementedMethods
public int numberOfUnimplementedMethods() -
hasUnimplementedMethods
public boolean hasUnimplementedMethods() -
indexOfUnimplementedMethod
-
getKey
-
getIsStatic
public boolean getIsStatic() -
getDisableAutogeneratedMethodList
public java.lang.String getDisableAutogeneratedMethodList(int index) -
getDisableAutogeneratedMethodList
public java.lang.String[] getDisableAutogeneratedMethodList() -
numberOfDisableAutogeneratedMethodList
public int numberOfDisableAutogeneratedMethodList() -
hasDisableAutogeneratedMethodList
public boolean hasDisableAutogeneratedMethodList() -
indexOfDisableAutogeneratedMethodList
public int indexOfDisableAutogeneratedMethodList(java.lang.String aDisableAutogeneratedMethodList) -
getPropagateCounter
public int getPropagateCounter()Arbitary Limit -
getPortBindingInformation
-
getPortBindingInformation
-
numberOfPortBindingInformation
public int numberOfPortBindingInformation() -
hasPortBindingInformation
public boolean hasPortBindingInformation() -
indexOfPortBindingInformation
-
getPortClass
public boolean getPortClass() -
getEmitMethod
-
getEmitMethods
-
numberOfEmitMethods
public int numberOfEmitMethods() -
hasEmitMethods
public boolean hasEmitMethods() -
indexOfEmitMethod
-
getTemplateEmitStringMap
-
getFilteredin
public boolean getFilteredin()Specifies whether or not in the filter -
isHasProxyPattern
public boolean isHasProxyPattern() -
isNeedsDefaultInterface
public boolean isNeedsDefaultInterface() -
isIsDistributed
public boolean isIsDistributed() -
isIsInternalSerializable
public boolean isIsInternalSerializable() -
isIsDefaultInterfaceRemoteRMI
public boolean isIsDefaultInterfaceRemoteRMI() -
isIsInitialized
public boolean isIsInitialized() -
isIsAbstract
public boolean isIsAbstract() -
isIsSingleton
public boolean isIsSingleton() -
isPortClass
public boolean isPortClass() -
isFilteredin
public boolean isFilteredin() -
getStateDependentMethod
-
getStateDependentMethods
-
numberOfStateDependentMethods
public int numberOfStateDependentMethods() -
hasStateDependentMethods
public boolean hasStateDependentMethods() -
indexOfStateDependentMethod
-
getCodeInjection
-
getCodeInjections
-
numberOfCodeInjections
public int numberOfCodeInjections() -
hasCodeInjections
public boolean hasCodeInjections() -
indexOfCodeInjection
-
getEnum
-
getEnums
Enumerations that belong to the Umple Class -
numberOfEnums
public int numberOfEnums() -
hasEnums
public boolean hasEnums() -
indexOfEnum
-
getPreCond
-
getPreConds
The possible Preconditions related to the Umple Class -
numberOfPreConds
public int numberOfPreConds() -
hasPreConds
public boolean hasPreConds() -
indexOfPreCond
-
getPostCond
-
getPostConds
The possible Preconditions related to the Umple Class -
numberOfPostConds
public int numberOfPostConds() -
hasPostConds
public boolean hasPostConds() -
indexOfPostCond
-
getUmpleTestCase
-
getUmpleTestCases
Umple Test Case at the class level -
numberOfUmpleTestCases
public int numberOfUmpleTestCases() -
hasUmpleTestCases
public boolean hasUmpleTestCases() -
indexOfUmpleTestCase
-
getTestSequence
-
getTestSequences
class test sequence for testcases -
numberOfTestSequences
public int numberOfTestSequences() -
hasTestSequences
public boolean hasTestSequences() -
indexOfTestSequence
-
getTestInit
-
getTestInits
class test initialization: inits at the top level -
numberOfTestInits
public int numberOfTestInits() -
hasTestInits
public boolean hasTestInits() -
indexOfTestInit
-
getConstraintTree
-
getConstraintTrees
The possible Constraints related to the Umple Class -
numberOfConstraintTrees
public int numberOfConstraintTrees() -
hasConstraintTrees
public boolean hasConstraintTrees() -
indexOfConstraintTree
-
getExtendsClass
-
hasExtendsClass
public boolean hasExtendsClass() -
getInnerClass
-
getInnerClasses
isStatic if the inner class is static The inner classes contained within the Umple class. -
numberOfInnerClasses
public int numberOfInnerClasses() -
hasInnerClasses
public boolean hasInnerClasses() -
indexOfInnerClass
-
getExtendsTrait
-
getExtendsTraits
-
numberOfExtendsTraits
public int numberOfExtendsTraits() -
hasExtendsTraits
public boolean hasExtendsTraits() -
indexOfExtendsTrait
-
getExtendsTemplate
-
getExtendsTemplates
-
numberOfExtendsTemplates
public int numberOfExtendsTemplates() -
hasExtendsTemplates
public boolean hasExtendsTemplates() -
indexOfExtendsTemplate
-
getParentInterface
-
getParentInterface
-
numberOfParentInterface
public int numberOfParentInterface() -
hasParentInterface
public boolean hasParentInterface() -
indexOfParentInterface
-
getUniqueIdentifier
-
hasUniqueIdentifier
public boolean hasUniqueIdentifier() -
getAttribute
-
getAttributes
The attributes contained within the Umple class. -
numberOfAttributes
public int numberOfAttributes() -
hasAttributes
public boolean hasAttributes() -
indexOfAttribute
-
getAssociationVariable
-
getAssociationVariables
The associations contained within the Umple class. -
numberOfAssociationVariables
public int numberOfAssociationVariables() -
hasAssociationVariables
public boolean hasAssociationVariables() -
indexOfAssociationVariable
-
getComment
-
getComments
The comments associated with the Umple Class (such as the Javadoc above it). -
numberOfComments
public int numberOfComments() -
hasComments
public boolean hasComments() -
indexOfComment
-
getRequirement
-
getRequirements
-
numberOfRequirements
public int numberOfRequirements() -
hasRequirements
public boolean hasRequirements() -
indexOfRequirement
-
getGeneralTPApplied
-
getGeneralTPApplieds
This is used to assign inheritance parameters. -
numberOfGeneralTPApplieds
public int numberOfGeneralTPApplieds() -
hasGeneralTPApplieds
public boolean hasGeneralTPApplieds() -
indexOfGeneralTPApplied
-
getTraceDirective
-
getTraceDirectives
-
numberOfTraceDirectives
public int numberOfTraceDirectives() -
hasTraceDirectives
public boolean hasTraceDirectives() -
indexOfTraceDirective
-
getTraceCase
-
getTraceCases
-
numberOfTraceCases
public int numberOfTraceCases() -
hasTraceCases
public boolean hasTraceCases() -
indexOfTraceCase
-
getPort
-
getPorts
-
numberOfPorts
public int numberOfPorts() -
hasPorts
public boolean hasPorts() -
indexOfPort
-
getActiveMethod
-
getActiveMethods
-
numberOfActiveMethods
public int numberOfActiveMethods() -
hasActiveMethods
public boolean hasActiveMethods() -
indexOfActiveMethod
-
getPortBinding
-
getPortBindings
-
numberOfPortBindings
public int numberOfPortBindings() -
hasPortBindings
public boolean hasPortBindings() -
indexOfPortBinding
-
getTemplateField
-
getTemplateFields
-
numberOfTemplateFields
public int numberOfTemplateFields() -
hasTemplateFields
public boolean hasTemplateFields() -
indexOfTemplateField
-
getClassDependencyNode
-
getClassDependencyNodes
-
numberOfClassDependencyNodes
public int numberOfClassDependencyNodes() -
hasClassDependencyNodes
public boolean hasClassDependencyNodes() -
indexOfClassDependencyNode
-
getStateMachine
-
getStateMachines
-
numberOfStateMachines
public int numberOfStateMachines() -
hasStateMachines
public boolean hasStateMachines() -
indexOfStateMachine
-
getSubclass
-
getSubclasses
-
numberOfSubclasses
public int numberOfSubclasses() -
hasSubclasses
public boolean hasSubclasses() -
indexOfSubclass
-
getOuterClass
-
hasOuterClass
public boolean hasOuterClass() -
getCompositeStructureTokenAnalyzer
-
hasCompositeStructureTokenAnalyzer
public boolean hasCompositeStructureTokenAnalyzer() -
getTemplateTokenAnalyzer
-
hasTemplateTokenAnalyzer
public boolean hasTemplateTokenAnalyzer() -
minimumNumberOfStateDependentMethods
public static int minimumNumberOfStateDependentMethods() -
addStateDependentMethod
-
removeStateDependentMethod
-
addStateDependentMethodAt
-
addOrMoveStateDependentMethodAt
-
minimumNumberOfCodeInjections
public static int minimumNumberOfCodeInjections() -
addCodeInjection
-
removeCodeInjection
-
addCodeInjectionAt
-
addOrMoveCodeInjectionAt
-
minimumNumberOfEnums
public static int minimumNumberOfEnums() -
addEnum
-
removeEnum
-
addEnumAt
-
addOrMoveEnumAt
-
minimumNumberOfPreConds
public static int minimumNumberOfPreConds() -
addPreCond
-
removePreCond
-
addPreCondAt
-
addOrMovePreCondAt
-
minimumNumberOfPostConds
public static int minimumNumberOfPostConds() -
addPostCond
-
removePostCond
-
addPostCondAt
-
addOrMovePostCondAt
-
minimumNumberOfUmpleTestCases
public static int minimumNumberOfUmpleTestCases() -
addUmpleTestCase
-
removeUmpleTestCase
-
addUmpleTestCaseAt
-
addOrMoveUmpleTestCaseAt
-
minimumNumberOfTestSequences
public static int minimumNumberOfTestSequences() -
addTestSequence
-
removeTestSequence
-
addTestSequenceAt
-
addOrMoveTestSequenceAt
-
minimumNumberOfTestInits
public static int minimumNumberOfTestInits() -
addTestInit
-
removeTestInit
-
addTestInitAt
-
addOrMoveTestInitAt
-
minimumNumberOfConstraintTrees
public static int minimumNumberOfConstraintTrees() -
addConstraintTree
-
removeConstraintTree
-
addConstraintTreeAt
-
addOrMoveConstraintTreeAt
-
setExtendsClass
-
minimumNumberOfInnerClasses
public static int minimumNumberOfInnerClasses() -
addInnerClass
-
removeInnerClass
-
addInnerClassAt
-
addOrMoveInnerClassAt
-
minimumNumberOfExtendsTraits
public static int minimumNumberOfExtendsTraits() -
addExtendsTrait
-
removeExtendsTrait
-
addExtendsTraitAt
-
addOrMoveExtendsTraitAt
-
minimumNumberOfExtendsTemplates
public static int minimumNumberOfExtendsTemplates() -
addExtendsTemplate
-
removeExtendsTemplate
-
addExtendsTemplateAt
-
addOrMoveExtendsTemplateAt
-
minimumNumberOfParentInterface
public static int minimumNumberOfParentInterface() -
addParentInterface
-
removeParentInterface
-
addParentInterfaceAt
-
addOrMoveParentInterfaceAt
-
setUniqueIdentifier
-
minimumNumberOfAttributes
public static int minimumNumberOfAttributes() -
addAttribute
public Attribute addAttribute(java.lang.String aName, java.lang.String aType, java.lang.String aModifier, java.lang.String aValue, boolean aIsAutounique) -
addAttribute
-
removeAttribute
-
addAttributeAt
-
addOrMoveAttributeAt
-
minimumNumberOfAssociationVariables
public static int minimumNumberOfAssociationVariables() -
addAssociationVariable
-
removeAssociationVariable
-
addAssociationVariableAt
-
addOrMoveAssociationVariableAt
-
minimumNumberOfComments
public static int minimumNumberOfComments() -
addComment
-
removeComment
-
addCommentAt
-
addOrMoveCommentAt
-
minimumNumberOfRequirements
public static int minimumNumberOfRequirements() -
addRequirement
-
removeRequirement
-
addRequirementAt
-
addOrMoveRequirementAt
-
minimumNumberOfGeneralTPApplieds
public static int minimumNumberOfGeneralTPApplieds() -
addGeneralTPApplied
-
removeGeneralTPApplied
-
addGeneralTPAppliedAt
-
addOrMoveGeneralTPAppliedAt
-
minimumNumberOfTraceDirectives
public static int minimumNumberOfTraceDirectives() -
addTraceDirective
-
removeTraceDirective
-
addTraceDirectiveAt
-
addOrMoveTraceDirectiveAt
-
minimumNumberOfTraceCases
public static int minimumNumberOfTraceCases() -
addTraceCase
-
removeTraceCase
-
addTraceCaseAt
-
addOrMoveTraceCaseAt
-
minimumNumberOfPorts
public static int minimumNumberOfPorts() -
addPort
-
removePort
-
addPortAt
-
addOrMovePortAt
-
minimumNumberOfActiveMethods
public static int minimumNumberOfActiveMethods() -
addActiveMethod
-
removeActiveMethod
-
addActiveMethodAt
-
addOrMoveActiveMethodAt
-
minimumNumberOfPortBindings
public static int minimumNumberOfPortBindings() -
addPortBinding
-
removePortBinding
-
addPortBindingAt
-
addOrMovePortBindingAt
-
minimumNumberOfTemplateFields
public static int minimumNumberOfTemplateFields() -
addTemplateField
-
removeTemplateField
-
addTemplateFieldAt
-
addOrMoveTemplateFieldAt
-
minimumNumberOfClassDependencyNodes
public static int minimumNumberOfClassDependencyNodes() -
addClassDependencyNode
-
removeClassDependencyNode
-
addClassDependencyNodeAt
-
addOrMoveClassDependencyNodeAt
-
minimumNumberOfStateMachines
public static int minimumNumberOfStateMachines() -
addStateMachine
-
removeStateMachine
-
addStateMachineAt
-
addOrMoveStateMachineAt
-
minimumNumberOfSubclasses
public static int minimumNumberOfSubclasses() -
addSubclass
-
removeSubclass
-
addSubclassAt
-
addOrMoveSubclassAt
-
setOuterClass
-
setCompositeStructureTokenAnalyzer
public boolean setCompositeStructureTokenAnalyzer(CompositeStructureTokenAnalyzer aCompositeStructureTokenAnalyzer) -
setTemplateTokenAnalyzer
-
delete
public void delete()- Overrides:
delete
in classUmpleClassifier
-
addStateDependentMethod
See issue #1351. Adds a state-dependent method mapping for the current Umple class. -
isUmpleClass
public boolean isUmpleClass()Description copied from class:UmpleElement
Methods to distinguish the subclass types- Overrides:
isUmpleClass
in classUmpleElement
-
getAutoGeneratedConstructor
-
hasMethodInTraits
-
getAllTraceDirectives
-
getMethodNames
public java.util.ArrayList<java.lang.String> getMethodNames() -
matchOperationMethod
public java.lang.Boolean matchOperationMethod(java.lang.String fullOperation, java.lang.String method) -
getApplicableCodeInjections
public java.util.List<CodeInjection> getApplicableCodeInjections(java.lang.String type, java.lang.String method)Gets applicable code injectiosn for generated methods -
getApplicableCodeInjectionsCustomMethod
public java.util.List<CodeInjection> getApplicableCodeInjectionsCustomMethod(java.lang.String type, java.lang.String method, java.util.List<MethodParameter> parameters)Gets applicable code injectiosn for custom defined methods -
addReferencedPackage
public void addReferencedPackage(java.lang.String aNamespace) -
getAssociationVariable
public AssociationVariable getAssociationVariable(java.lang.String className, java.lang.String roleName)It can happen that one class has multiple association variables with the same name -
getAssociationVariable
-
getAssociationVariableFor
-
hasImplementedMethodIncludingWithinParentClasses
-
hasSameType
Issue 771 -
getMethod
-
hasAllAttributes
public boolean hasAllAttributes() -
getAllAttributes
-
getAttribute
-
isRoot
public boolean isRoot() -
getGeneratedClass
-
createGeneratedClass
-
isAttributeClass
public boolean isAttributeClass() -
isImmutable
public boolean isImmutable()- Returns:
- true if this class is immutable, either because it has the "immutable" modifier or because an ancestor class is immutable; false if this class neither has the "immutable" modifier nor an immutable ancestor.
-
setImmutable
public boolean setImmutable() -
setAncestorIsImmutable
protected boolean setAncestorIsImmutable(boolean isImmutable) -
immutabilityAssociationRulesSatisfied
protected static boolean immutabilityAssociationRulesSatisfied(AssociationVariable myAV, UmpleClass myClass, boolean myClassImmutable, AssociationVariable yourAV, UmpleClass yourClass, boolean yourClassImmutable) -
immutabilityAssociationRulesSatisfied
protected boolean immutabilityAssociationRulesSatisfied(AssociationVariable myAV, boolean myClassImmutable) -
deleteAttribute
-
removeAllAutoGeneratedMethods
public void removeAllAutoGeneratedMethods() -
removeAutoGenerateMethodsForAttribute
-
removeAttributeFromAutogeneratedConstructor
-
hasEnum
public boolean hasEnum(java.lang.String enumName)Issue 1008 - Helper function to determine if the Umple Class has a particular enumeration -
getAllStateMachines
-
getStateMachines
-
getEvents
-
findOrCreateEvent
-
getStateMachine
-
getGeneralTPAppliedByName
-
getUmpleTestCase
return TestCase using name -
getPort
-
toString
public java.lang.String toString()- Overrides:
toString
in classUmpleClassifier
-
getStateDependentMethodBodyMap
-