Dresden OCL Toolkit

tudresden.ocl.lib
Class PrefixNameAdapter

java.lang.Object
  extended bytudresden.ocl.lib.PrefixNameAdapter
All Implemented Interfaces:
NameAdapter
Direct Known Subclasses:
ArgoNameAdapter

public class PrefixNameAdapter
extends Object
implements NameAdapter

A implementation of NameAdapter, which handles prefixes on association roles. A special subclass is provided for Argo/UML.

Author:
Frank Finger
See Also:
NameAdapter, ArgoNameAdapter

Field Summary
private  String prefix
           
private  int prefix_length
           
 
Constructor Summary
PrefixNameAdapter(String prefix)
          Constructs a PrefixNameAdapter with the given prefix.
 
Method Summary
 String[] getNames(String name)
          This operation takes a name as found in an OCL expression ("person" in the example above) and returns an array of possible representation names, propably including the OCL name itself, sorted for priority.
 String[] getPossibleAssociationNames(String n)
          This method is used to reconvert implementation names into possible names of the corresponding association ends.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

prefix

private String prefix

prefix_length

private int prefix_length
Constructor Detail

PrefixNameAdapter

public PrefixNameAdapter(String prefix)
Constructs a PrefixNameAdapter with the given prefix.

Method Detail

getNames

public String[] getNames(String name)
Description copied from interface: NameAdapter
This operation takes a name as found in an OCL expression ("person" in the example above) and returns an array of possible representation names, propably including the OCL name itself, sorted for priority.

Specified by:
getNames in interface NameAdapter
Returns:
an array containing the parameter and >prefix<+the parameter with first letter capitalized, e.g. "person" and "myPerson" for "person"

getPossibleAssociationNames

public String[] getPossibleAssociationNames(String n)
Description copied from interface: NameAdapter
This method is used to reconvert implementation names into possible names of the corresponding association ends.

Specified by:
getPossibleAssociationNames in interface NameAdapter
Returns:
if the given Strings begins with >prefix<, return an array containing the String, the String without >prefix< and this String with first letter in lower case; else, return an array containing only the given String

toString

public String toString()

Dresden OCL Toolkit

Submit a bug
Developed at the Dresden University of Technology.
This software is published under the GNU Lesser General Public License.