org.eclipse.ocl.examples.codegen.common
Class NameQueries

java.lang.Object
  extended by org.eclipse.ocl.examples.codegen.common.NameQueries

public class NameQueries
extends java.lang.Object


Nested Class Summary
static class NameQueries.NameAllocation<T>
           
static class NameQueries.TuplePartAllocation
           
 
Constructor Summary
NameQueries()
           
 
Method Summary
protected static void appendJavaCharacters(java.lang.StringBuilder s, java.lang.String string)
           
protected static void appendJavaCharacters(java.lang.StringBuilder s, java.lang.String string, int iMax)
           
static java.lang.String defineSymbolName(java.lang.Object elem, java.lang.String symbol)
           
static java.lang.String encodeName(NamedElement element)
           
static java.lang.String getPrefixedSymbolName(java.lang.String prefix, java.lang.Object elem)
           
static java.lang.String getSymbolName(java.lang.Object elem)
          Return a symbol name for an eObject.
static java.lang.String getUniqueText(Element context, Constraint constraint)
          Return a valid Java identifier suffix encoding of string that is unique within the scope of element.
static java.lang.String getUniqueText(Element context, Operation operation)
          Return a valid Java identifier suffix encoding of an operation name that is unique within the scope of element.
static java.lang.String getUniqueText(Element context, Property property)
          Return a valid Java identifier suffix encoding of a property name that is unique within the scope of element.
static java.lang.String getUniqueText(Element context, java.lang.String string)
          Return a valid Java identifier suffix encoding of string that is unique within the scope of element.
static java.lang.String getUniqueText(Element context, TupleLiteralPart part)
          Return a valid Java identifier suffix encoding of a property name that is unique within the scope of element.
static java.lang.String getUniqueText(Element context, TupleType type)
          Return a valid Java identifier suffix encoding of a property name that is unique within the scope of element.
static java.lang.String getUniqueText(Element context, Type type)
          Return a valid Java identifier suffix encoding of a property name that is unique within the scope of element.
static java.lang.String getUniqueText(Element context, Variable variable)
          Return a valid Java identifier suffix encoding of a variable name that is unique within the scope of element.
static java.lang.String rawEncodeName(java.lang.String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NameQueries

public NameQueries()
Method Detail

appendJavaCharacters

protected static void appendJavaCharacters(java.lang.StringBuilder s,
                                           java.lang.String string)

appendJavaCharacters

protected static void appendJavaCharacters(java.lang.StringBuilder s,
                                           java.lang.String string,
                                           int iMax)

defineSymbolName

public static java.lang.String defineSymbolName(java.lang.Object elem,
                                                java.lang.String symbol)

encodeName

public static java.lang.String encodeName(NamedElement element)

getSymbolName

public static java.lang.String getSymbolName(java.lang.Object elem)
Return a symbol name for an eObject. This method is invoked from an Acceleo script and so there is only one call per distinct object. Acceleo maintains the cache that returns the symbol for old objects.

Parameters:
eObject - the object in question
Returns:
the symbol name

getPrefixedSymbolName

public static java.lang.String getPrefixedSymbolName(java.lang.String prefix,
                                                     java.lang.Object elem)

getUniqueText

public static java.lang.String getUniqueText(Element context,
                                             Constraint constraint)
Return a valid Java identifier suffix encoding of string that is unique within the scope of element.


getUniqueText

public static java.lang.String getUniqueText(Element context,
                                             Operation operation)
Return a valid Java identifier suffix encoding of an operation name that is unique within the scope of element.


getUniqueText

public static java.lang.String getUniqueText(Element context,
                                             Property property)
Return a valid Java identifier suffix encoding of a property name that is unique within the scope of element.


getUniqueText

public static java.lang.String getUniqueText(Element context,
                                             java.lang.String string)
Return a valid Java identifier suffix encoding of string that is unique within the scope of element.


getUniqueText

public static java.lang.String getUniqueText(Element context,
                                             TupleLiteralPart part)
Return a valid Java identifier suffix encoding of a property name that is unique within the scope of element.


getUniqueText

public static java.lang.String getUniqueText(Element context,
                                             TupleType type)
Return a valid Java identifier suffix encoding of a property name that is unique within the scope of element.


getUniqueText

public static java.lang.String getUniqueText(Element context,
                                             Type type)
Return a valid Java identifier suffix encoding of a property name that is unique within the scope of element.


getUniqueText

public static java.lang.String getUniqueText(Element context,
                                             Variable variable)
Return a valid Java identifier suffix encoding of a variable name that is unique within the scope of element.


rawEncodeName

public static java.lang.String rawEncodeName(java.lang.String name)