Package cruise.umple.compiler
Class Attribute
java.lang.Object
cruise.umple.compiler.UmpleVariable
cruise.umple.compiler.Attribute
public class Attribute extends UmpleVariable
Represents an attribute.
An attribute is more abstract than an instance variable / property in that
it can be derived, and have various other modifiers such as being
initialized, lazy (does not appear in constructor and must be initialized
after construction), etc.
---------------------------------------------------------------------------------------------
------------------------------------class end------------------------------------------------
---------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------
------------------------------------class start----------------------------------------------
---------------------------------------------------------------------------------------------
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Attribute.Source
-
Constructor Summary
Constructors Constructor Description Attribute(Attribute another)
Attribute(java.lang.String aName, java.lang.String aType, java.lang.String aModifier, java.lang.String aValue, boolean aIsAutounique, UmpleClass aUmpleClass)
Attribute(java.lang.String aName, java.lang.String aType, java.lang.String aModifier, java.lang.String aValue, boolean aIsAutounique, UmpleTrait aUmpleTrait)
-
Method Summary
Modifier and Type Method Description boolean
addComment(Comment aComment)
boolean
addCommentAt(Comment aComment, int index)
boolean
addOrMoveCommentAt(Comment aComment, int index)
boolean
addOrMoveRequirementAt(Requirement aRequirement, int index)
boolean
addOrMoveTraceRecordAt(TraceRecord aTraceRecord, int index)
boolean
addRequirement(Requirement aRequirement)
boolean
addRequirementAt(Requirement aRequirement, int index)
boolean
addTraceRecord(TraceRecord aTraceRecord)
boolean
addTraceRecordAt(TraceRecord aTraceRecord, int index)
void
delete()
CodeBlock
getCodeblock()
Comment
getComment(int index)
java.util.List<Comment>
getComments()
The comments associated with the attribute (such as the Javadoc above it).Position
getEndPosition()
java.lang.String
getFullType()
boolean
getIsAutounique()
Specifies whether or not the method parameter is auto unique.boolean
getIsDerived()
Specifies whether or not the method parameter is derived.boolean
getIsInternalTransient()
Specifies whether or not the method parameter is internalTransient.boolean
getIsIvar()
Specifies whether or not the method parameter is ivar.boolean
getIsLazy()
Specifies whether or not the method parameter is lazy.boolean
getIsList()
Specifies whether or not the method parameter is a list.boolean
getIsRefinement()
boolean
getIsUnique()
Specifies whether or not the attribute is unique.java.util.ArrayList<java.lang.String>
getMethodNames()
Position
getPosition()
Requirement
getRequirement(int index)
java.util.List<Requirement>
getRequirements()
Attribute.Source
getSource()
java.lang.String
getSourceFullName()
TraceRecord
getTraceRecord(int index)
java.util.List<TraceRecord>
getTraceRecords()
UmpleClass
getUmpleClass()
UmpleTrait
getUmpleTrait()
java.lang.String
getValue()
The value of the Umple variable.boolean
hasComments()
boolean
hasEndPosition()
boolean
hasPosition()
boolean
hasRequirements()
boolean
hasTraceRecords()
boolean
hasUmpleTrait()
int
indexOfComment(Comment aComment)
int
indexOfRequirement(Requirement aRequirement)
int
indexOfTraceRecord(TraceRecord aTraceRecord)
boolean
isConstant()
boolean
isDefaulted()
boolean
isImmutable()
boolean
isInternal()
boolean
isIsAutounique()
boolean
isIsDerived()
boolean
isIsInternalTransient()
boolean
isIsIvar()
boolean
isIsLazy()
boolean
isIsList()
boolean
isIsRefinement()
boolean
isIsUnique()
boolean
isPrimitive()
boolean
isSettable()
static int
minimumNumberOfComments()
static int
minimumNumberOfRequirements()
static int
minimumNumberOfTraceRecords()
int
numberOfComments()
int
numberOfRequirements()
int
numberOfTraceRecords()
boolean
removeComment(Comment aComment)
boolean
removeRequirement(Requirement aRequirement)
boolean
removeTraceRecord(TraceRecord aTraceRecord)
boolean
setCodeblock(CodeBlock aCodeblock)
boolean
setEndPosition(Position aNewEndPosition)
boolean
setIsAutounique(boolean aIsAutounique)
boolean
setIsDerived(boolean aIsDerived)
boolean
setIsInternalTransient(boolean aIsInternalTransient)
boolean
setIsIvar(boolean aIsIvar)
boolean
setIsLazy(boolean aIsLazy)
boolean
setIsList(boolean aIsList)
boolean
setIsRefinement(boolean aIsRefinement)
boolean
setIsUnique(boolean aIsUnique)
boolean
setPosition(Position aNewPosition)
boolean
setSource(Attribute.Source aSource)
boolean
setType(java.lang.String aType)
boolean
setUmpleClass(UmpleClass aUmpleClass)
boolean
setUmpleTrait(UmpleTrait aUmpleTrait)
boolean
setValue(java.lang.String aValue)
boolean
setValue(java.lang.String lang, java.lang.String code)
java.lang.String
toString()
Methods inherited from class cruise.umple.compiler.UmpleVariable
getModifier, getName, getTraced, getType, getUpperCaseName, normalizeValue, setModifier, setName
-
Constructor Details
-
Attribute
public Attribute(java.lang.String aName, java.lang.String aType, java.lang.String aModifier, java.lang.String aValue, boolean aIsAutounique, UmpleClass aUmpleClass) -
Attribute
-
Attribute
public Attribute(java.lang.String aName, java.lang.String aType, java.lang.String aModifier, java.lang.String aValue, boolean aIsAutounique, UmpleTrait aUmpleTrait)
-
-
Method Details
-
setIsAutounique
public boolean setIsAutounique(boolean aIsAutounique) -
setIsUnique
public boolean setIsUnique(boolean aIsUnique) -
setIsList
public boolean setIsList(boolean aIsList) -
setIsDerived
public boolean setIsDerived(boolean aIsDerived) -
setIsInternalTransient
public boolean setIsInternalTransient(boolean aIsInternalTransient) -
setCodeblock
-
setIsLazy
public boolean setIsLazy(boolean aIsLazy) -
setIsRefinement
public boolean setIsRefinement(boolean aIsRefinement) -
setIsIvar
public boolean setIsIvar(boolean aIsIvar) -
setType
public boolean setType(java.lang.String aType)- Overrides:
setType
in classUmpleVariable
-
getIsAutounique
public boolean getIsAutounique()Specifies whether or not the method parameter is auto unique. TODO: should default to false, but constructors would need updating -
getIsUnique
public boolean getIsUnique()Specifies whether or not the attribute is unique. -
getIsList
public boolean getIsList()Specifies whether or not the method parameter is a list. -
getIsDerived
public boolean getIsDerived()Specifies whether or not the method parameter is derived. -
getIsInternalTransient
public boolean getIsInternalTransient()Specifies whether or not the method parameter is internalTransient. -
getCodeblock
-
getIsLazy
public boolean getIsLazy()Specifies whether or not the method parameter is lazy. -
getIsRefinement
public boolean getIsRefinement() -
getIsIvar
public boolean getIsIvar()Specifies whether or not the method parameter is ivar. -
isIsAutounique
public boolean isIsAutounique() -
isIsUnique
public boolean isIsUnique() -
isIsList
public boolean isIsList() -
isIsDerived
public boolean isIsDerived() -
isIsInternalTransient
public boolean isIsInternalTransient() -
isIsLazy
public boolean isIsLazy() -
isIsRefinement
public boolean isIsRefinement() -
isIsIvar
public boolean isIsIvar() -
getSourceFullName
public java.lang.String getSourceFullName() -
getSource
-
setSource
-
getComment
-
getComments
The comments associated with the attribute (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
-
getPosition
-
hasPosition
public boolean hasPosition() -
getEndPosition
-
hasEndPosition
public boolean hasEndPosition() -
getUmpleClass
-
getUmpleTrait
-
hasUmpleTrait
public boolean hasUmpleTrait() -
getTraceRecord
-
getTraceRecords
-
numberOfTraceRecords
public int numberOfTraceRecords() -
hasTraceRecords
public boolean hasTraceRecords() -
indexOfTraceRecord
-
minimumNumberOfComments
public static int minimumNumberOfComments() -
addComment
-
removeComment
-
addCommentAt
-
addOrMoveCommentAt
-
minimumNumberOfRequirements
public static int minimumNumberOfRequirements() -
addRequirement
-
removeRequirement
-
addRequirementAt
-
addOrMoveRequirementAt
-
setPosition
-
setEndPosition
-
setUmpleClass
-
setUmpleTrait
-
minimumNumberOfTraceRecords
public static int minimumNumberOfTraceRecords() -
addTraceRecord
-
removeTraceRecord
-
addTraceRecordAt
-
addOrMoveTraceRecordAt
-
delete
public void delete()- Overrides:
delete
in classUmpleVariable
-
isConstant
public boolean isConstant() -
isPrimitive
public boolean isPrimitive() -
isImmutable
public boolean isImmutable()- Overrides:
isImmutable
in classUmpleVariable
-
isInternal
public boolean isInternal() -
isSettable
public boolean isSettable() -
isDefaulted
public boolean isDefaulted() -
getValue
public java.lang.String getValue()Description copied from class:UmpleVariable
The value of the Umple variable.- Overrides:
getValue
in classUmpleVariable
-
setValue
public boolean setValue(java.lang.String aValue)- Overrides:
setValue
in classUmpleVariable
-
setValue
public boolean setValue(java.lang.String lang, java.lang.String code) -
getFullType
public java.lang.String getFullType() -
getMethodNames
public java.util.ArrayList<java.lang.String> getMethodNames() -
toString
public java.lang.String toString()- Overrides:
toString
in classUmpleVariable
-