private FieldConstraint makeSingleFieldConstraint ( ConditionCol52 c , String cell ) { SingleFieldConstraint sfc = new SingleFieldConstraint ( c . getFactField ( ) ) ; //Condition columns can be defined as having no operator, in which case the operator //is taken from the cell's value. Pretty yucky really if we're to be able to perform //expansion and contraction of decision table columns.... this might have to go. if ( no ( c . getOperator ( ) ) ) { String [ ] a = cell . split ( "\\s" ) ; if ( a . length > 1 ) { //Operator might be 1 part (e.g. "==") or two parts (e.g. "not in") StringBuilder operator = new StringBuilder ( a [ 0 ] ) ; for ( int i = 1 ; i < a . length - 1 ; i ++ ) { operator . append ( a [ i ] ) ; } sfc . setOperator ( operator . toString ( ) ) ; sfc . setValue ( a [ a . length - 1 ] ) ; } else { sfc . setValue ( cell ) ; } } else { sfc . setOperator ( c . getOperator ( ) ) ; if ( OperatorsOracle . operatorRequiresList ( c . getOperator ( ) ) ) { sfc . setValue ( makeInList ( cell ) ) ; } else { if ( ! c . getOperator ( ) . equals ( "== null" ) && ! c . getOperator ( ) . equals ( "!= null" ) ) { sfc . setValue ( cell ) ; } } } final int constraintValueType = c . getConstraintValueType ( ) ; if ( ( constraintValueType == BaseSingleFieldConstraint . TYPE_LITERAL || constraintValueType == BaseSingleFieldConstraint . TYPE_RET_VALUE ) && c . isBound ( ) ) { sfc . setFieldBinding ( c . getBinding ( ) ) ; } sfc . setParameters ( c . getParameters ( ) ) ; sfc . setConstraintValueType ( c . getConstraintValueType ( ) ) ; sfc . setFieldType ( c . getFieldType ( ) ) ; return sfc ; }
Build a normal SingleFieldConstraint for a non - otherwise cell value