Dresden OCL Toolkit

tudresden.ocl.gui
Interface EditingUtilities

All Known Implementing Classes:
OCLEditor

public interface EditingUtilities

Utility interface for parsing and splitting raw constraints.

Author:
sz9

Method Summary
 boolean getDoAutoSplit()
          Return whether auto split mode is on.
 boolean isValidConstraintName(String sName)
          Checks the specified name and returns true if it is a valid OCL name.
 OclTree parseAndCheckConstraint(String sConstraint, ModelFacade mfFacade)
          Check the specified constraint using the specified model facade for model information.
 List splitConstraint(OclTree ocltConstraint)
          Split the specified constraint into its constituting constraints.
 

Method Detail

isValidConstraintName

public boolean isValidConstraintName(String sName)
Checks the specified name and returns true if it is a valid OCL name.


parseAndCheckConstraint

public OclTree parseAndCheckConstraint(String sConstraint,
                                       ModelFacade mfFacade)
                                throws OclParserException,
                                       IOException,
                                       OclTypeException
Check the specified constraint using the specified model facade for model information. Return the parse tree for the constraint.

Throws:
OclParserException - if a syntax error occurred.
IOException - if an I/O operation failed.
OclTypeException - if a type checking error occurred.

getDoAutoSplit

public boolean getDoAutoSplit()
Return whether auto split mode is on. If this returns true, constraint representations should call splitConstraint(tudresden.ocl.OclTree) and create one constraint representation per actual constraint.


splitConstraint

public List splitConstraint(OclTree ocltConstraint)
Split the specified constraint into its constituting constraints. E.g.
 context Test
 inv: a > 0
 inv: a < 10
 inv: a * 100 = 900
 
would be split into three constraints:
 context Test
 inv: a > 0

 context Test
 inv: a < 10

 context Test
 inv: a * 100 = 900
 

Returns:
a list of abstract syntax trees, one per sub-constraint.

Dresden OCL Toolkit

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