org.drools.ide.common.server.util
Class DRLConstraintValueBuilder

java.lang.Object
  extended by org.drools.ide.common.server.util.DRLConstraintValueBuilder

public class DRLConstraintValueBuilder
extends Object

A Helper class for building parts of DRL from higher-order representations (i.e. Guided Rule Editor, Guided Template Rule Editor and Guided Decision Table).


Constructor Summary
DRLConstraintValueBuilder()
           
 
Method Summary
static void buildLHSFieldValue(StringBuilder buf, int constraintType, String fieldType, String fieldValue)
          Concatenate a String to the provided buffer suitable for the fieldValue and fieldType.
static void buildRHSFieldValue(StringBuilder buf, String fieldType, String fieldValue)
          Concatenate a String to the provided buffer suitable for the fieldValue and fieldType.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DRLConstraintValueBuilder

public DRLConstraintValueBuilder()
Method Detail

buildLHSFieldValue

public static void buildLHSFieldValue(StringBuilder buf,
                                      int constraintType,
                                      String fieldType,
                                      String fieldValue)
Concatenate a String to the provided buffer suitable for the fieldValue and fieldType. Strings and Dates are escaped with double-quotes, whilst Numerics, Booleans, (Java 1.5+) enums and all other fieldTypes are not escaped at all. Guvnor-type enums are really a pick list of Strings and in these cases the underlying fieldType is a String.

Parameters:
buf -
constraintType -
fieldType -
fieldValue -

buildRHSFieldValue

public static void buildRHSFieldValue(StringBuilder buf,
                                      String fieldType,
                                      String fieldValue)
Concatenate a String to the provided buffer suitable for the fieldValue and fieldType. Strings are escaped with double-quotes, Dates are wrapped with a call to a pre-constructed SimpleDateFormatter, whilst Numerics, Booleans, (Java 1.5+) enums and all other fieldTypes are not escaped at all. Guvnor-type enums are really a pick list of Strings and in these cases the underlying fieldType is a String.

Parameters:
buf -
fieldType -
fieldValue -


Copyright © 2001-2011 JBoss by Red Hat. All Rights Reserved.