org.andromda.core.translation
Class Expression

java.lang.Object
  extended byorg.andromda.core.translation.Expression

public class Expression
extends Object

Stores the translated expression,

Author:
Chad Brandon

Constructor Summary
Expression(String originalExpression)
          Creates a new instance of this Expression object
 
Method Summary
 void appendSpaceToTranslatedExpression()
          Appends a space charater to the current translated expression String Buffer.
 void appendToTranslatedExpression(Object object)
          Appends the value of the value of the object's toString result to the current translated expression String Buffer.
 String getContextElement()
          Returns the element which is the context of this expression.
 String getKind()
          Returns the Kind of this Expression (inv, post, or pre)
 String getName()
          Gets the name of the expression.
 String getOriginalExpression()
          Returns the expression before translation.
 String getTranslatedExpression()
          Returns the expression after translation.
 void insertInTranslatedExpression(int position, Object object)
          Performs replacement of the value of the object's toString result at the start and end positions of the buffer containing the Expression.
 void replaceInTranslatedExpression(String pattern, String replacement)
          Replaces the regular expressoin pattern with the replacement within the translated expression buffer.
 void setContextElement(String contextElement)
          Sets the context element (the element to which the expression applies --> the element declared after the context)
 void setKind(String kind)
          Sets the "kind" of the expression (i.e, "pre", "post", "inv", etc.)
 void setName(String name)
          Sets the name.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Expression

public Expression(String originalExpression)
Creates a new instance of this Expression object

Parameters:
originalExpression - the expression that will be translated.
Method Detail

appendToTranslatedExpression

public void appendToTranslatedExpression(Object object)
Appends the value of the value of the object's toString result to the current translated expression String Buffer.

Parameters:
object - the object to append.

appendSpaceToTranslatedExpression

public void appendSpaceToTranslatedExpression()
Appends a space charater to the current translated expression String Buffer.


replaceInTranslatedExpression

public void replaceInTranslatedExpression(String pattern,
                                          String replacement)
Replaces the regular expressoin pattern with the replacement within the translated expression buffer.

Parameters:
pattern - the regular expression pattern to replace
replacement - the replacement string.

insertInTranslatedExpression

public void insertInTranslatedExpression(int position,
                                         Object object)
Performs replacement of the value of the object's toString result at the start and end positions of the buffer containing the Expression.

Parameters:
position - the position at which to insert
object - the
See Also:
StringBuffer.insert(int,java.lang.String)

getTranslatedExpression

public String getTranslatedExpression()
Returns the expression after translation.

Returns:
String

getOriginalExpression

public String getOriginalExpression()
Returns the expression before translation.

Returns:
String

getContextElement

public String getContextElement()
Returns the element which is the context of this expression.

Returns:
String the context element element.

getKind

public String getKind()
Returns the Kind of this Expression (inv, post, or pre)

Returns:
String returns the Kind of this translation

getName

public String getName()
Gets the name of the expression.

Returns:
String

setName

public void setName(String name)
Sets the name.

Parameters:
name - the name to set.

setContextElement

public void setContextElement(String contextElement)
Sets the context element (the element to which the expression applies --> the element declared after the context)

Parameters:
contextElement - the name of the element which is the context element.

setKind

public void setKind(String kind)
Sets the "kind" of the expression (i.e, "pre", "post", "inv", etc.)

Parameters:
kind - the kind to set.

toString

public String toString()
See Also:
Object.toString()


Copyright © 2003-2006 The AndroMDA Team. All Rights Reserved.