Poseidon for UMLTM
  UMLdoc
 PREV  CLASSIFIER    NEXT  CLASSIFIER     FRAMES    NO FRAMES      
SUMMARY:   INNER | ATTR | ASSOC | CONSTR | METHOD     DETAIL:   INNER | ATTR | ASSOC | CONSTR | METHOD     DIAGRAMS:   COLLAB | SEQ | STATE | ACTIV

com.gentleware.poseidon.uml.generator

Class PreparedAttribute

com.gentleware.poseidon.generator.PreparedElement
    inheritcom.gentleware.poseidon.uml.generator.PreparedModelElement
        inheritcom.gentleware.poseidon.uml.generator.PreparedFeature
            inheritcom.gentleware.poseidon.uml.generator.PreparedAttribute

public class PreparedAttribute


This class contains the prepared information for an attribute. The information can directly be used in the code generation.
Authors:
Thorsten Sturm
See also:
ModelElementPreparator


 Attribute Summary
private static String  ARRAY_TYPE_SUFFIX
 
private List  _accessorMethods
 
private String  _elementType
The type of the element as String. 
private String  _methodName
The name of a setter or getter method, without that prefix. 
private PreparedMultiplicity  _multi
 
private String  _orriginalType
 
arrow_up
 

 Method Summary
private void   addJavadocTagCorrectType(String typeAsString)
insert tag @gentleware-collectionType and set value typeAsString  
public String   check()
Does a test on the validity of the element. 
protected String   checkMultiplicity()
 
protected String   checkType()
 
private List   generateAccessorMethods()
Prepares the list of operations of this class that are dependent on the attribute through a dependency with the stereotype 'accessor'. 
private String   generateMethodName()
Uppercases the first character of the name and cuts away leading and trailing underscores. 
private String   generateType()
Returns a vector/array if multiplicity set, otherwise the type. 
public List   getAccessorMethods()
Returns a list of operations of this class that are dependent on the attribute through a dependency with the stereotype 'accessor'. 
public String   getAddAccessMethod()
Returns the name of the adding method for the attribute. 
private String   getArrayInitialValue()
 
public String   getArrayInitialValueExpression()
Returns a string representing the initial value expression for an attribute, that will be represented as an array. 
public String   getArrayTypeAsString()
Returns the true type of the attribute as string, but with trailing [] removed, so that you can determine of which elements the array consists of. 
protected ChangeableKind   getChangeability()
 
public String   getChangeabilityAsString()
Returns the changeability of the related attribute as string. 
public String   getDefaultValue()
Returns a string reflecting the default value for the related attribute. 
public String   getDocs()
 
public String   getElementName()
Returns the name of the related element. 
public String   getElementType()
Returns the effective type of the element, that is, with regard to the multiplicity. 
public String   getGetAccessMethod()
Returns the name of the getter method for the attribute. 
private String   getInitialValue()
 
public String   getInitialValueExpression()
Returns a string reflecting the initial value expression for related attribute. 
public String   getParameterNameForAccessMethod()
Returns a string used as the name of a parameter reflecting the related association end in access methods. 
public PreparedMultiplicity   getPreparedMultiplicity()
Returns the prepared element related to the multiplicity of the related attribute. 
public PreparedClassifier   getPreparedType()
 
public String   getRemoveAccessMethod()
Returns the name of the removing method for the attribute. 
public String   getSetAccessMethod()
Returns the name of the setter method for the attribute. 
public String   getSingleGetAccessMethod()
For collection types, returns the name of the getter method for an element of the attribute. 
private ScopeKind   getTargetScope()
 
public String   getTransientAsString()
Returns the value of the tagged value "transient" of the related attribute as string. 
public String   getTypeAsString()
Returns the true type of the attribute as string, that is, the type without regarding multiplicity. 
public String   getVolatileAsString()
Returns the value of the tagged value "volatile" of the related attribute as string. 
public void   init(Attribute element, ModelElementPreparator preparator)
Initializes this instance. 
public boolean   isArray()
Tests if the multiplicity of the related association end would give an array. 
public boolean   isCollection()
Tests if the multiplicity of the related association end would give a collection. 
public boolean   isOrdered()
 
public boolean   isTypePreparedModelElement()
Tests if the type of the attribute is already available as a prepared information. 
public boolean   isWritable()
Tests if the related attribute is changeable. 
arrow_up
 

Tagged Values
static false
 

 Attribute Detail

ARRAY_TYPE_SUFFIX

private static String ARRAY_TYPE_SUFFIX

arrow_up


_accessorMethods

private List _accessorMethods

arrow_up


_elementType

private String _elementType

The type of the element as String.  
arrow_up


_methodName

private String _methodName

The name of a setter or getter method, without that prefix.  
arrow_up


_multi

private PreparedMultiplicity _multi

arrow_up


_orriginalType

private String _orriginalType

arrow_up
 Method Detail

addJavadocTagCorrectType

private void addJavadocTagCorrectType(String typeAsString)


insert tag @gentleware-collectionType and set value typeAsString  
Parameters:
typeAsString -
arrow_up


check

public String check()


Does a test on the validity of the element. The test for name, visibility, type and multiplicity are called subsequently.  
Returns:
Concatenation of messages occuring while testing this prepared element.
arrow_up


checkMultiplicity

protected String checkMultiplicity()

Returns:
arrow_up


checkType

protected String checkType()

Returns:
arrow_up


generateAccessorMethods

private List generateAccessorMethods()


Prepares the list of operations of this class that are dependent on the attribute through a dependency with the stereotype 'accessor'.  
Returns:
Null or a list of PreparedOperations.
arrow_up


generateMethodName

private String generateMethodName()


Uppercases the first character of the name and cuts away leading and trailing underscores.  
Returns:
arrow_up


generateType

private String generateType()


Returns a vector/array if multiplicity set, otherwise the type.  
Returns:
arrow_up


getAccessorMethods

public List getAccessorMethods()


Returns a list of operations of this class that are dependent on the attribute through a dependency with the stereotype 'accessor'.  
Returns:
Null or a list of PreparedOperations.
arrow_up


getAddAccessMethod

public String getAddAccessMethod()


Returns the name of the adding method for the attribute. An adding method is created only if the attribute has no single multiplicity.  
Returns:
The name of the adding method. setFoo if limited set, addFoo otherwise.
arrow_up


getArrayInitialValue

private String getArrayInitialValue()

Returns:
arrow_up


getArrayInitialValueExpression

public String getArrayInitialValueExpression()


Returns a string representing the initial value expression for an attribute, that will be represented as an array.  
Returns:
The initial value expression
arrow_up


getArrayTypeAsString

public String getArrayTypeAsString()


Returns the true type of the attribute as string, but with trailing [] removed, so that you can determine of which elements the array consists of.  
Returns:
A string representing the type of single elements of the attribute (if it is an array). In case it is no array, it behaves just as {@link #getTypeAsString()}.
arrow_up


getChangeability

protected ChangeableKind getChangeability()

Returns:
arrow_up


getChangeabilityAsString

public String getChangeabilityAsString()


Returns the changeability of the related attribute as string.  
Returns:
A string representing the changeability.
arrow_up


getDefaultValue

public String getDefaultValue()


Returns a string reflecting the default value for the related attribute.  
Returns:
The default value.
arrow_up


getDocs

public String getDocs()

Returns:
arrow_up


getElementName

public String getElementName()


Returns the name of the related element.  
Returns:
The name of the related element.
arrow_up


getElementType

public String getElementType()


Returns the effective type of the element, that is, with regard to the multiplicity. Therefore, this method may return 'Collection' even if the type is 'String' or something.  
Returns:
arrow_up


getGetAccessMethod

public String getGetAccessMethod()


Returns the name of the getter method for the attribute. A "s" is added to the attribute name if the attribute has no single multiplicity. If the attribute is boolean, the prefix is 'is'.  
Returns:
The name of the getter method. isFoo if single boolean, getFoo if single, getFoos if multiple.
arrow_up


getInitialValue

private String getInitialValue()

Returns:
arrow_up


getInitialValueExpression

public String getInitialValueExpression()


Returns a string reflecting the initial value expression for related attribute.

return The initial value expression.  

Returns:
arrow_up


getParameterNameForAccessMethod

public String getParameterNameForAccessMethod()


Returns a string used as the name of a parameter reflecting the related association end in access methods.  
Returns:
The name of the parameter.
arrow_up


getPreparedMultiplicity

public PreparedMultiplicity getPreparedMultiplicity()


Returns the prepared element related to the multiplicity of the related attribute.  
Returns:
The prepared multiplicity.
arrow_up


getPreparedType

public PreparedClassifier getPreparedType()

Returns:
arrow_up


getRemoveAccessMethod

public String getRemoveAccessMethod()


Returns the name of the removing method for the attribute. A removing method is created only if the attribute is of a collection type.  
Returns:
The name (removeFoo) of the removing method if unlimited multiple, or ''.
arrow_up


getSetAccessMethod

public String getSetAccessMethod()


Returns the name of the setter method for the attribute. A "s" is added to the attribute name, if the attribute has no single multiplicity.  
Returns:
The name of the setter method. setFoo if single, setFoos if multiple.
arrow_up


getSingleGetAccessMethod

public String getSingleGetAccessMethod()


For collection types, returns the name of the getter method for an element of the attribute. If the attribute is boolean, the prefix is 'is'.  
Returns:
The name (getFoo) of the getter method if multiple, or an empty String if single multiplicity.
arrow_up


getTargetScope

private ScopeKind getTargetScope()

Returns:
arrow_up


getTransientAsString

public String getTransientAsString()


Returns the value of the tagged value "transient" of the related attribute as string.  
Returns:
"transient ", if the tagged value equals to "true", otherwise "".
arrow_up


getTypeAsString

public String getTypeAsString()


Returns the true type of the attribute as string, that is, the type without regarding multiplicity. If the type contains [], they are retained. So this is the 'original' type.  
Returns:
A string representing the type of the related attribute.
arrow_up


getVolatileAsString

public String getVolatileAsString()


Returns the value of the tagged value "volatile" of the related attribute as string.  
Returns:
"volatile ", if the tagged value equals to "true", otherwise "".
arrow_up


init

public void init(Attribute element, ModelElementPreparator preparator)


Initializes this instance. It will be related to the given model element and handled by the given preparator. The information of the given object will be prepared here.  
Parameters:
element - The model element this instance should be related to.
preparator - The preparator handling this instance.
arrow_up


isArray

public boolean isArray()


Tests if the multiplicity of the related association end would give an array.  
Returns:
True if the upper multiplicity is>1 and a number, otherwise false.
arrow_up


isCollection

public boolean isCollection()


Tests if the multiplicity of the related association end would give a collection.  
Returns:
True if the upper multiplicity equals 'N', otherwise false.
arrow_up


isOrdered

public boolean isOrdered()

Returns:
arrow_up


isTypePreparedModelElement

public boolean isTypePreparedModelElement()


Tests if the type of the attribute is already available as a prepared information.  
Returns:
True, if calling getTypeAsString() would return the type of the related attribute, otherwise false.
arrow_up


isWritable

public boolean isWritable()


Tests if the related attribute is changeable.  
Returns:
True if the changeability equals to frozen, otherwise false.
arrow_up
Created  2004 - 10 - 21

    Poseidon for UMLTM
  UMLdoc
 PREV  CLASSIFIER    NEXT  CLASSIFIER     FRAMES    NO FRAMES      
SUMMARY:   INNER | ATTR | ASSOC | CONSTR | METHOD     DETAIL:   INNER | ATTR | ASSOC | CONSTR | METHOD     DIAGRAMS:   COLLAB | SEQ | STATE | ACTIV

Generated with Poseidon for UMLTM.
Poseidon is a registered trademark of Gentleware AG in Germany, USA and other countries. Copyright 2003-2004 Gentleware AG, Schanzenstr. 70, 20357 Hamburg, Germany. All Rights Reserved.

UML is a trademark or registered trademark of Object Management Group, Inc. in the U.S. and other countries.