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 PreparedModelElement

com.gentleware.poseidon.generator.PreparedElement
    inheritcom.gentleware.poseidon.uml.generator.PreparedModelElement
All known Subclassifier:
PreparedAssociationEnd , PreparedClassifier , PreparedComment , PreparedFeature , PreparedMultiplicity , PreparedPackage , PreparedParameter


public class PreparedModelElement


This class contains the prepared information for a model element. The information can directly be used in the code generation.

See also:
ModelElementPreparator


 Attribute Summary
protected static String  DOCUMENTATION_TAG_NAME
 
public static String  KEY_TYPE_ORDERED_MULTI
A general setting for the generation. 
public static String  KEY_TYPE_SORTED_MULTI
A general setting for the generation. 
public static String  KEY_TYPE_UNORDERED_MULTI
A general setting for the generation. 
arrow_up
 

 Constructor Summary
public   PreparedModelElement()
Creates a new instance of this type. 
arrow_up
 

 Method Summary
public static String   addLinePrefix(String plainDoc, String toInsert)
Adds the string toInsert after every '\n' and at the very beginning of the given text. 
public String   check()
Does a test on the validity of the element. 
protected String   checkName()
 
public String   checkVisibility()
Does nothing. 
public String   getDocs()
Get the comments of a ModelElement. 
public String   getNameOfElementAsString(Object element)
Returns a string with the element's name, ready for insertion into generated code. 
protected String   getNameOfElementAsString(Object element, boolean fullyQualified)
 
public int   getNamespaceHierarchyPosition()
Returns the distance of the model element from the the model itself in the namespace hierarchy of the model. 
public List   getNamespaceList(boolean includeModel, boolean includeSelf)
Returns a list of all the namespaces needed to navigate from the top-level element down to the related model element. 
public String   getNamespaceListAsString(boolean includeModel, boolean includeSelf, String delimiter)
Returns a string reflecting the names of all the namespaces needed to navigate from the top-level element down to the related model element. 
public List   getParentNamespaces(ModelElement element)
Returns a list of all namespaces beginning with the namespace of the related model element up to the top-most namespace of the model. 
public String   getParsedDocs()
Get the comments of a ModelElement as HTML-enriched string. 
public String   getPath(boolean includeModel, boolean includeSelf, String fileSeparator)
Builds and returns the file system path to a file representing the element related to this prepared element. 
public String   getPathAsString(boolean includeModel, boolean includeSelf)
Builds and returns the file system path to a file representing the element related to this prepared element. 
public String   getPlainDocs()
Get the comments of a ModelElement as plain string with stripped asteriks. 
public PreparedElement   getPreparedParent()
Returns the Prepared element of the object's name space. 
public UmlProject   getProject()
 
public String   getRelativePathToModel(boolean includeModel, boolean includeSelf, String fileSeparator)
Returns the string reflecting the path from the top-level model to the related model element. 
public String   getTaggedValue(String name)
Returns the tagged value with the given key as a string. 
public String   getVisibilityAsString()
Returns a string reflecting the visibility of the related model element. 
public void   init(Object element, ElementPreparator preparator)
Initializes this instance. 
public final boolean   isAssociationEnd()
Returns true if the element is an association end  
public final boolean   isAttribute()
Returns true if the element is an attribute  
public final boolean   isClassifier()
Returns true if the element is a classifier  
public final boolean   isComment()
Returns true if the element is a comment  
public final boolean   isOperation()
Returns true if the element is an operation  
public List   parseNamespace(String namespaceName)
Returns a list of namespace names contained in the given namespace name. 
arrow_up
 

Tagged Values
static false
gentleware-imported-line-number 30
gentleware-imported-package-statement-line-number 6
 

 Attribute Detail

DOCUMENTATION_TAG_NAME

protected static String DOCUMENTATION_TAG_NAME

arrow_up


KEY_TYPE_ORDERED_MULTI

public static String KEY_TYPE_ORDERED_MULTI

A general setting for the generation.  
arrow_up


KEY_TYPE_SORTED_MULTI

public static String KEY_TYPE_SORTED_MULTI

A general setting for the generation.  
arrow_up


KEY_TYPE_UNORDERED_MULTI

public static String KEY_TYPE_UNORDERED_MULTI

A general setting for the generation.  
arrow_up
 Constructor Detail

PreparedModelElement

public com.gentleware.poseidon.uml.generator.PreparedModelElement PreparedModelElement()


Creates a new instance of this type.  
Returns:
arrow_up
 Method Detail

addLinePrefix

public static String addLinePrefix(String plainDoc, String toInsert)


Adds the string toInsert after every '\n' and at the very beginning of the given text.  
Parameters:
plainDoc - The source documentation.
toInsert - How to prefix every line.
Returns:
The same doc, with every line prefixed by toInsert.
Since:
2.1
Exceptions:
NullPointerException if the plainDoc is null.
arrow_up


check

public String check()


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


checkName

protected String checkName()

Returns:
arrow_up


checkVisibility

public String checkVisibility()


Does nothing. We allow any visibility.  
Returns:
A String of size 0.
arrow_up


getDocs

public String getDocs()


Get the comments of a ModelElement. If the objects have no sensible type or no comment, default comments are returned.  
Returns:
Comment of the element.
arrow_up


getNameOfElementAsString

public String getNameOfElementAsString(Object element)


Returns a string with the element's name, ready for insertion into generated code.  
Parameters:
element - The element that is to be printed into the code.
Returns:
The insertion-ready name of the element.
arrow_up


getNameOfElementAsString

protected String getNameOfElementAsString(Object element, boolean fullyQualified)

Parameters:
element -
fullyQualified -
Returns:
arrow_up


getNamespaceHierarchyPosition

public int getNamespaceHierarchyPosition()


Returns the distance of the model element from the the model itself in the namespace hierarchy of the model.  
Returns:
the position of the model element in the hierarchy. A modelElement with the model as direct namespace will return 1
arrow_up


getNamespaceList

public List getNamespaceList(boolean includeModel, boolean includeSelf)


Returns a list of all the namespaces needed to navigate from the top-level element down to the related model element.  
Parameters:
includeModel - Declares whether the top-level model should be included.
includeSelf - Declares whether the element itself should be included.
Returns:
A List of namespace names.
arrow_up


getNamespaceListAsString

public String getNamespaceListAsString(boolean includeModel, boolean includeSelf, String delimiter)


Returns a string reflecting the names of all the namespaces needed to navigate from the top-level element down to the related model element. The namespace names are separated by the given delimiter.  
Parameters:
includeModel - Declares whether the top-level model should be included.
includeSelf - Declares whether the element itself should be included.
delimiter - String to be used for separating the namespace names.
Returns:
A string containing all namespace names separated by the given delimiter.
arrow_up


getParentNamespaces

public List getParentNamespaces(ModelElement element)


Returns a list of all namespaces beginning with the namespace of the related model element up to the top-most namespace of the model.  
Parameters:
element - The model element, this list should be created for.
Returns:
A List of all namespaces from the related model element to the top-level model.
arrow_up


getParsedDocs

public String getParsedDocs()


Get the comments of a ModelElement as HTML-enriched string. If the objects have no sensible type or no comment, default comments are returned.  
Returns:
Comment of the element enriched with HTML tags.
arrow_up


getPath

public String getPath(boolean includeModel, boolean includeSelf, String fileSeparator)


Builds and returns the file system path to a file representing the element related to this prepared element. The resulting string gives a file system compatible representation of the namespace structure.  
Parameters:
includeModel - Should the name of the model itself be part of this path.
includeSelf - Should the name of the element itself be part of this path.
fileSeparator - The string that should be used as separator for this path.
Returns:
The complete path to the file.
arrow_up


getPathAsString

public String getPathAsString(boolean includeModel, boolean includeSelf)


Builds and returns the file system path to a file representing the element related to this prepared element. The os-dependent default setting for the file separator is used. The resulting string gives a file system compatible representation of the namespace structure.  
Parameters:
includeModel - Should the name of the model itself be part of this path.
includeSelf - Should the name of the element itself be part of this path.
Returns:
The complete path to the file.
arrow_up


getPlainDocs

public String getPlainDocs()


Get the comments of a ModelElement as plain string with stripped asteriks.  
Returns:
Comment of the element with removed asteriks
arrow_up


getPreparedParent

public PreparedElement getPreparedParent()


Returns the Prepared element of the object's name space.  
Returns:
Null or the Prep element of the owning namespace.
arrow_up


getProject

public UmlProject getProject()

Returns:
arrow_up


getRelativePathToModel

public String getRelativePathToModel(boolean includeModel, boolean includeSelf, String fileSeparator)


Returns the string reflecting the path from the top-level model to the related model element.  
Parameters:
includeModel - Declares whether the top-level model should be part of the path.
includeSelf - Declared whether the model element itself should be part of the path.
fileSeparator - The string used to separate the namespace names.
Returns:
The path from the model to the related model element.
arrow_up


getTaggedValue

public String getTaggedValue(String name)


Returns the tagged value with the given key as a string.  
Parameters:
name - The key of the tagged value.
Returns:
The string representation of the tagged value.
arrow_up


getVisibilityAsString

public String getVisibilityAsString()


Returns a string reflecting the visibility of the related model element.  
Returns:
A String with the java visibility plus a space, or an empty string.
arrow_up


init

public void init(Object element, ElementPreparator preparator)


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


isAssociationEnd

public final boolean isAssociationEnd()


Returns true if the element is an association end  
Returns:
true iff. getElement instanceof AssociationEnd
arrow_up


isAttribute

public final boolean isAttribute()


Returns true if the element is an attribute  
Returns:
true iff. getElement instanceof Attribute
arrow_up


isClassifier

public final boolean isClassifier()


Returns true if the element is a classifier  
Returns:
true iff. getElement instanceof Classifier
arrow_up


isComment

public final boolean isComment()


Returns true if the element is a comment  
Returns:
true iff. getElement instanceof Comment
arrow_up


isOperation

public final boolean isOperation()


Returns true if the element is an operation  
Returns:
true iff. getElement instanceof Operation
arrow_up


parseNamespace

public List parseNamespace(String namespaceName)


Returns a list of namespace names contained in the given namespace name. Anamespace name can contain a number of subnames, that should be reflected as individual namespaces in the ode generation (e.g. "com.gentleware" should be treated as "com" and "gentleware" in order to get the file paths right).  
Parameters:
namespaceName - The namespace name that should be parsed for subnames.
Returns:
A List of namespace names.
arrow_up
Created  2004 - 12 - 1

    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.