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 PreparedAssociationEnd

com.gentleware.poseidon.generator.PreparedElement
    inheritcom.gentleware.poseidon.uml.generator.PreparedModelElement
        inheritcom.gentleware.poseidon.uml.generator.PreparedAssociationEnd
All known Subclassifier:
PreparedAssociationClass.PreparedConnection


public class PreparedAssociationEnd


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


 Attribute Summary
private String  _elementName
The name of the element as seen in the template; may be generated from the type. 
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  _multiplicity
 
private PreparedAssociationEnd  _oppositeEnd
 
private String  _originalType
 
private int  _runningNumber
The numeral index of items with the same name. 
arrow_up
 

 Constructor Summary
public   PreparedAssociationEnd()
 
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 this instance. 
protected String   checkInterfaceVariables()
 
protected String   checkMultiplicity()
 
protected String   checkName()
 
protected String   checkType()
 
protected String   generateMethodName()
Uppercases the first character of the name. 
private String   generateName()
 
private String   generateType()
Returns a vector/array if multiplicity set, otherwise the type. 
public String   getAddAccessMethod()
Returns the name of the adding method for the attribute created for reflecting the related association end. 
public ChangeableKind   getChangeability()
Returns the changeability of the related association end. 
public String   getChangeabilityAsString()
Returns the changeability of the related association end as string. 
public String   getContext()
Returns the context for the attribute representing this association end. 
public String   getDefaultValue()
Returns a string reflecting the default value for the attribute reflecting the related association end. 
public String   getDocs()
 
public String   getElementName()
Returns the name of the related element. 
public String   getElementType()
Returns the effective type of the related element as string, that is, after regarding the multiplicity. 
public String   getGetAccessMethod()
Returns the name of the getter method for the attribute created for reflecting the related association end. 
public String   getInitialValueExpression()
Returns a string reflecting the initial value expression for the attribute reflecting the related association end. 
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 association end. 
public PreparedAssociationEnd   getPreparedOppositeEnd()
Returns the prepared opposite association end. 
public PreparedClassifier   getPreparedType()
Returns the prepared element representing the type of the related association end. 
public String   getRemoveAccessMethod()
Returns the name of the removing method for the attribute created for reflecting the related association end. 
public String   getSetAccessMethod()
Returns the name of the setter method for the attribute created for reflecting the related association end. 
public ScopeKind   getTargetScope()
Returns the target scope of the related association end. 
public String   getTargetScopeAsString()
Returns the changeability of the related association end as string. 
public String   getTransientAsString()
Returns the value of the tagged value "transient" of the related attribute as string. 
public String   getTypeAsString()
Returns the type of the association end as string, without regard to the multiplicity. 
protected String   getTypeAsStringInternal(Classifier type, AssociationEnd end)
 
protected Classifier   getTypeFor(AssociationEnd end)
This is a hook to allow code generation for association classes. 
public void   init(AssociationEnd element, ModelElementPreparator preparator, int id)
Initializes this instance. 
public boolean   isArray()
Tests if the multiplicity of the related association end would give an array. 
public boolean   isAssociationClassConnection()
 
public boolean   isCollection()
Tests if the multiplicity of the related association end would give a collection. 
public boolean   isNavigable()
Tests, if the related association end is navigable. 
public boolean   isStatic()
Tests if the related association end is static. 
public boolean   isTypePreparedModelElement()
Tests, if the types of the ends match. 
public boolean   isWritable()
Tests if the related association end is changeable. 
protected void   setPreparedOppositeEnd(PreparedAssociationEnd oppositeEnd)
Sets the prepared opposite association end. 
arrow_up
 

Tagged Values
static false
 

 Attribute Detail

_elementName

private String _elementName

The name of the element as seen in the template; may be generated from the type.  
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


_multiplicity

private PreparedMultiplicity _multiplicity

arrow_up


_oppositeEnd

private PreparedAssociationEnd _oppositeEnd

arrow_up


_originalType

private String _originalType

arrow_up


_runningNumber

private int _runningNumber

The numeral index of items with the same name.  
arrow_up
 Constructor Detail

PreparedAssociationEnd

public PreparedAssociationEnd PreparedAssociationEnd()

Returns:
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 this instance. The tests for name, type and multiplicity are called subsequently.  
Returns:
Concatenation of messages occuring while testing this prepared element.
arrow_up


checkInterfaceVariables

protected String checkInterfaceVariables()

Returns:
arrow_up


checkMultiplicity

protected String checkMultiplicity()

Returns:
arrow_up


checkName

protected String checkName()

Returns:
arrow_up


checkType

protected String checkType()

Returns:
arrow_up


generateMethodName

protected String generateMethodName()


Uppercases the first character of the name.  
Returns:
arrow_up


generateName

private String generateName()

Returns:
arrow_up


generateType

private String generateType()


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


getAddAccessMethod

public String getAddAccessMethod()


Returns the name of the adding method for the attribute created for reflecting the related association end. An adding method is created only if the association end has no single multiplicity.  
Returns:
The name of the adding method.
arrow_up


getChangeability

public ChangeableKind getChangeability()


Returns the changeability of the related association end.  
Returns:
The model element representing the changeability.
arrow_up


getChangeabilityAsString

public String getChangeabilityAsString()


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


getContext

public String getContext()


Returns the context for the attribute representing this association end.  
Returns:
"this" if the attribute is non static, otherwise the class name containing the attribute as static field
arrow_up


getDefaultValue

public String getDefaultValue()


Returns a string reflecting the default value for the attribute reflecting the related association end.  
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 related element as string, that is, after regarding the multiplicity.  
Returns:
The type of the related element.
arrow_up


getGetAccessMethod

public String getGetAccessMethod()


Returns the name of the getter method for the attribute created for reflecting the related association end. A "s" is added to the attribute name if the association end has no single multiplicity.  
Returns:
The name of the getter method.
arrow_up


getInitialValueExpression

public String getInitialValueExpression()


Returns a string reflecting the initial value expression for the attribute reflecting the related association end. For non-single multiplicities, this expression is a call to the collection type's constructor (currently, Vector is the only possible collection type).

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 association end.  
Returns:
The prepared multiplicity.
arrow_up


getPreparedOppositeEnd

public PreparedAssociationEnd getPreparedOppositeEnd()


Returns the prepared opposite association end.  
Returns:
A PreparedAssociationEnd related to the opposite association end.
arrow_up


getPreparedType

public PreparedClassifier getPreparedType()


Returns the prepared element representing the type of the related association end.  
Returns:
A prepared classifier representing the type of the association end.
arrow_up


getRemoveAccessMethod

public String getRemoveAccessMethod()


Returns the name of the removing method for the attribute created for reflecting the related association end. A removing method is created only if the association end has no single multiplicity.  
Returns:
The name of the removing method.
arrow_up


getSetAccessMethod

public String getSetAccessMethod()


Returns the name of the setter method for the attribute created for reflecting the related association end. A "s" is added to the attribute name, if the association end has no single multiplicity.  
Returns:
The name of the setter method.
arrow_up


getTargetScope

public ScopeKind getTargetScope()


Returns the target scope of the related association end.  
Returns:
The model element representing the target scope.
arrow_up


getTargetScopeAsString

public String getTargetScopeAsString()


Returns the changeability of the related association end as string.  
Returns:
A string representing the changeability.
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 "".
Since:
2.4
arrow_up


getTypeAsString

public String getTypeAsString()


Returns the type of the association end as string, without regard to the multiplicity.  
Returns:
A string representing the type of the related association end.
arrow_up


getTypeAsStringInternal

protected String getTypeAsStringInternal(Classifier type, AssociationEnd end)

Parameters:
type -
end -
Returns:
arrow_up


getTypeFor

protected Classifier getTypeFor(AssociationEnd end)


This is a hook to allow code generation for association classes.  
Parameters:
end -
Returns:
arrow_up


init

public void init(AssociationEnd element, ModelElementPreparator preparator, int id)


Initializes this instance. It will be related to the given association end and handled by the given preparator. The information of the given association end will be prepared here.  
Parameters:
element - The association end this instance should be related to.
preparator - The preparator handling this instance.
id - The number, if there are many association ends with the same name.
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


isAssociationClassConnection

public boolean isAssociationClassConnection()

Returns:
arrow_up


isCollection

public boolean isCollection()


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


isNavigable

public boolean isNavigable()


Tests, if the related association end is navigable.  
Returns:
True, if the association end is navigable, otherwise false.
arrow_up


isStatic

public boolean isStatic()


Tests if the related association end is static.  
Returns:
True if the target scope equals to static, otherwise false.
arrow_up


isTypePreparedModelElement

public boolean isTypePreparedModelElement()


Tests, if the types of the ends match. This seems to be the case whenever the upper bound of the multiplicity is 1. Otherwise, the generateType() method will set another type (a collection type thing or an array).  
Returns:
True, if the prepared type equals to the model element type, otherwise false.
arrow_up


isWritable

public boolean isWritable()


Tests if the related association end is changeable.  
Returns:
True if the changeability equals to frozen, otherwise false.
arrow_up


setPreparedOppositeEnd

protected void setPreparedOppositeEnd(PreparedAssociationEnd oppositeEnd)


Sets the prepared opposite association end.  
Parameters:
oppositeEnd - The prepared association end related to the opposite association end.
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.