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.generator

Class PreparedElement

com.gentleware.poseidon.generator.PreparedElement
All known Subclassifier:
PreparedModelElement


public abstract class PreparedElement


Represents the object that prepares the template code generation.


 Attribute Summary
protected static String  ANONYMOUS_NAME
 
public static String  ILLEGAL_CHARACTERS_LEVEL1

Characters which are replaced in addition to those of #ILLEGAL_CHARACTERS_LEVEL2

public static String  ILLEGAL_CHARACTERS_LEVEL2

Characters in this list will be replaced by #ILLEGAL_CHARACTER_REPLACEMENT for convenience with (most) programming languages. 

public static char  ILLEGAL_CHARACTER_REPLACEMENT

Character by which illegal characters will be replaced. 

private Object  element
The element that we are preparing for. 
arrow_up
 

 Association Summary
private ElementPreparator  preparator
The preparator that will fill 'this'. 
arrow_up
 

 Method Summary
public Map   callElementMethod(String method, Map parameters)
Calls a method on the content element. 
public String   check()
Does a test on the validity of the element. 
protected String   checkName()
Does a test on the validity of the element's name. 
public String   getDocs()
Returns the documentation for the prepared element. 
public Object   getElement()
Returns the element related to this prepared element. 
public String   getNameAsString(String prefix, String postfix)
Returns the customized name of the related element. 
public static String   getNameAsString(String name)
Returns the name of the related element. 
public String   getNameAsString()

Returns the name of the related element. 

public String   getNameOfElementAsString(Object element)
Returns a string with the element's name, ready for insertion into generated code. 
public String   getNameWithUpperCaseBegin()
Returns the name of the related element with the first character converted to upper case. 
public String   getParsedDocs()
Returns the documentation for the prepared element. 
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. 
protected ElementPreparator   getPreparator()
Returns the preparator used to handle this prepared element. 
public PreparedElement   getPreparedParent()
Returns the parent element of this. 
public String   getUniqueFileName()
Returns a unique name for this PreparedElement. 
public String   getUniqueFileName(String fileExtension)
Returns a unique name for this PreparedElement. 
public static String   replaceIllegalChars(String s)
Replacing illegal characters by underscores. 
public void   setElement(Object element)
Sets the element related to this prepared element. 
protected void   setPreparator(ElementPreparator preparator)
Sets the preparator used to handle this prepared element. 
arrow_up
 

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

 Attribute Detail

ANONYMOUS_NAME

protected static String ANONYMOUS_NAME

arrow_up


ILLEGAL_CHARACTERS_LEVEL1

public static String ILLEGAL_CHARACTERS_LEVEL1

Characters which are replaced in addition to those of #ILLEGAL_CHARACTERS_LEVEL2. They are especially used when generating filenames for elements with characters which (might) confuse the underlying operating system.

 
arrow_up


ILLEGAL_CHARACTERS_LEVEL2

public static String ILLEGAL_CHARACTERS_LEVEL2

Characters in this list will be replaced by #ILLEGAL_CHARACTER_REPLACEMENT for convenience with (most) programming languages. Characters in this list should in general confuse every programming-language when used in naming of operations and attributes. Other characters, e. g. if a programming-language does not allow umlauts in class-names, have to be replaced in the derived prepared elements.

 
arrow_up


ILLEGAL_CHARACTER_REPLACEMENT

public static char ILLEGAL_CHARACTER_REPLACEMENT

Character by which illegal characters will be replaced. Take care that replacing several different characters with only one character might lead to collisions. Especially code-generation-plugins need to take care of this.

 
See also:
#getUniqueFileName(String)
arrow_up


element

private Object element

The element that we are preparing for.  
arrow_up
 Association Detail

preparator

private ElementPreparator preparator

The preparator that will fill 'this'.  
arrow_up
 Method Detail

callElementMethod

public Map callElementMethod(String method, Map parameters)


Calls a method on the content element. Used for passing on getter methods from the context.  
Parameters:
method - The name of the method to call on the content object.
parameters - The parameters of the method call, mapping from parameter classes to values.
Returns:
A Map with 0 or 1 entry mapping the type of the return value to the return value.
arrow_up


check

public String check()


Does a test on the validity of the element.  
Returns:
Concatenation of messages occuring while testing this prepared element.
arrow_up


checkName

protected String checkName()


Does a test on the validity of the element's name.  
Returns:
Concatenation of message occuring while testing the element's name.
arrow_up


getDocs

public String getDocs()


Returns the documentation for the prepared element.  
Returns:
The complete documentation for the related element as one string.
arrow_up


getElement

public Object getElement()


Returns the element related to this prepared element.  
Returns:
The element, this prepared element is related to.
arrow_up


getNameAsString

public String getNameAsString(String prefix, String postfix)


Returns the customized name of the related element.  
Parameters:
prefix - A string to be used as prefix to the element's name.
postfix - A string to be used as postfix to the element's name.
Returns:
The customized name of the element with prefix+getNameofElementAsString+postfix.
arrow_up


getNameAsString

public static String getNameAsString(String name)


Returns the name of the related element. Appearances of characters in " /\" will be replaced by underscores. Mind that you might generate duplicate names with this behavior, e. g. a/b and a\b will both be mapped to a_b.  
Parameters:
name - a string that you would like to have formatted.
Returns:
cleaned name without any character of " /\"
arrow_up


getNameAsString

public String getNameAsString()


Returns the name of the related element.

 
Returns:
The name 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, the name should be returned for.
Returns:
The insertion ready name of the element.
arrow_up


getNameWithUpperCaseBegin

public String getNameWithUpperCaseBegin()


Returns the name of the related element with the first character converted to upper case.  
Returns:
The name of the related element beginning with an upper case character.
arrow_up


getParsedDocs

public String getParsedDocs()


Returns the documentation for the prepared element.  
Returns:
The complete documentation for the related element as one string.
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.  
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.  
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


getPreparator

protected ElementPreparator getPreparator()


Returns the preparator used to handle this prepared element.  
Returns:
The preparator handling this prepared element.
arrow_up


getPreparedParent

public PreparedElement getPreparedParent()


Returns the parent element of this.  
Returns:
The prepared element representing the parent.
arrow_up


getUniqueFileName

public String getUniqueFileName()


Returns a unique name for this PreparedElement. The name and the path are considered. If there are more than one element with the same name, numbers are appended to the pure name.  
Returns:
the name of this PreparedElement or the name plus a number. The name is unique for the path of the PreparedElement.
arrow_up


getUniqueFileName

public String getUniqueFileName(String fileExtension)


Returns a unique name for this PreparedElement. The name, the path and a file extension are considered. If there are more than one element with the same name, numbers are appended to the pure name.  
Parameters:
fileExtension -
Returns:
the name of this PreparedElement or the name plus a number. The name is unique for the path of the PreparedElement. The extension is NOT part of the return value!
arrow_up


replaceIllegalChars

public static String replaceIllegalChars(String s)


Replacing illegal characters by underscores. Used for generation of names used in html or filesystem. Mind that you might generate duplicate names with this behavior, e. g. a:b and a;b will both be mapped to a_b.  
Parameters:
s - string to replace characters in
Returns:
string with replacements made
arrow_up


setElement

public void setElement(Object element)


Sets the element related to this prepared element.  
Parameters:
element - The element, this prepared element should be related to.
arrow_up


setPreparator

protected void setPreparator(ElementPreparator preparator)


Sets the preparator used to handle this prepared element.  
Parameters:
preparator - The preparator handling this prepared element.
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.