/** * Returns true of there is a field binding. */ public boolean isBound() { return this.getFieldBinding() != null && this.getFieldBinding().length() > 0; }
/** * Returns true of there is a field binding. */ public boolean isBound() { return this.getFieldBinding() != null && this.getFieldBinding().length() > 0; }
result.add( c.getFieldBinding() );
result.add( c.getFieldBinding() );
protected String getFieldBinding(FieldConstraint fc, String var) { String fieldType = null; if ( fc instanceof SingleFieldConstraint ) { SingleFieldConstraint s = (SingleFieldConstraint) fc; if ( s.isBound() && var.equals( s.getFieldBinding() ) ) { fieldType = s.getFieldType(); } } if ( fc instanceof SingleFieldConstraintEBLeftSide ) { SingleFieldConstraintEBLeftSide s = (SingleFieldConstraintEBLeftSide) fc; if ( s.isBound() && var.equals( s.getFieldBinding() ) ) { fieldType = s.getExpressionLeftSide().getGenericType(); } } if ( fc instanceof CompositeFieldConstraint ) { CompositeFieldConstraint s = (CompositeFieldConstraint) fc; if ( s.constraints != null ) { for ( FieldConstraint ss : s.constraints ) { fieldType = getFieldBinding( ss, var ); } } } return fieldType; }
protected String getFieldBinding(FieldConstraint fc, String var) { String fieldType = null; if ( fc instanceof SingleFieldConstraint ) { SingleFieldConstraint s = (SingleFieldConstraint) fc; if ( s.isBound() && var.equals( s.getFieldBinding() ) ) { fieldType = s.getFieldType(); } } if ( fc instanceof SingleFieldConstraintEBLeftSide ) { SingleFieldConstraintEBLeftSide s = (SingleFieldConstraintEBLeftSide) fc; if ( s.isBound() && var.equals( s.getFieldBinding() ) ) { fieldType = s.getExpressionLeftSide().getGenericType(); } } if ( fc instanceof CompositeFieldConstraint ) { CompositeFieldConstraint s = (CompositeFieldConstraint) fc; if ( s.constraints != null ) { for ( FieldConstraint ss : s.constraints ) { fieldType = getFieldBinding( ss, var ); } } } return fieldType; }
protected List<String> getFieldBinding(FieldConstraint f) { List<String> result = new ArrayList<String>(); if ( f instanceof SingleFieldConstraint ) { SingleFieldConstraint con = (SingleFieldConstraint) f; if ( con.isBound() ) { result.add( con.getFieldBinding() ); } if ( con.getExpressionValue() != null && con.getExpressionValue().isBound() ) { result.add( con.getExpressionValue().getBinding() ); } if ( con instanceof SingleFieldConstraintEBLeftSide ) { SingleFieldConstraintEBLeftSide exp = (SingleFieldConstraintEBLeftSide) con; if ( exp.getExpressionLeftSide() != null && exp.getExpressionLeftSide().isBound() ) { result.add( exp.getExpressionLeftSide().getBinding() ); } } } else if ( f instanceof CompositeFieldConstraint ) { CompositeFieldConstraint cfc = (CompositeFieldConstraint) f; if ( cfc.constraints != null ) { for ( FieldConstraint ss : cfc.constraints ) { List<String> t = getFieldBinding( ss ); result.addAll( t ); } } } return result; }
protected List<String> getFieldBinding(FieldConstraint f) { List<String> result = new ArrayList<String>(); if ( f instanceof SingleFieldConstraint ) { SingleFieldConstraint con = (SingleFieldConstraint) f; if ( con.isBound() ) { result.add( con.getFieldBinding() ); } if ( con.getExpressionValue() != null && con.getExpressionValue().isBound() ) { result.add( con.getExpressionValue().getBinding() ); } if ( con instanceof SingleFieldConstraintEBLeftSide ) { SingleFieldConstraintEBLeftSide exp = (SingleFieldConstraintEBLeftSide) con; if ( exp.getExpressionLeftSide() != null && exp.getExpressionLeftSide().isBound() ) { result.add( exp.getExpressionLeftSide().getBinding() ); } } } else if ( f instanceof CompositeFieldConstraint ) { CompositeFieldConstraint cfc = (CompositeFieldConstraint) f; if ( cfc.constraints != null ) { for ( FieldConstraint ss : cfc.constraints ) { List<String> t = getFieldBinding( ss ); result.addAll( t ); } } } return result; }
SingleFieldConstraint sfc = (SingleFieldConstraint) fc; if ( sfc.isBound() ) { variables.add( sfc.getFieldBinding() );
SingleFieldConstraint con = (SingleFieldConstraint) fc; if ( con.isBound() ) { result.add( con.getFieldBinding() );
SingleFieldConstraint con = (SingleFieldConstraint) fc; if ( con.isBound() ) { result.add( con.getFieldBinding() );
SingleFieldConstraint sfc = (SingleFieldConstraint) fc; if ( sfc.isBound() ) { variables.add( sfc.getFieldBinding() );
} else { if ( constr.isBound() ) { bindingsFields.put( constr.getFieldBinding(), constr ); buf.append( constr.getFieldBinding() ); buf.append( " : " ); || constr.getOperator().equals( "== null" ) || constr.getOperator().equals( "!= null" ) ) ) || constr.getFieldBinding() != null || constr.getConstraintValueType() == BaseSingleFieldConstraint.TYPE_EXPR_BUILDER_VALUE || constr instanceof SingleFieldConstraintEBLeftSide ) {
} else { if ( constr.isBound() ) { bindingsFields.put( constr.getFieldBinding(), constr ); buf.append( constr.getFieldBinding() ); buf.append( " : " ); || constr.getOperator().equals( "== null" ) || constr.getOperator().equals( "!= null" ) ) ) || constr.getFieldBinding() != null || constr.getConstraintValueType() == BaseSingleFieldConstraint.TYPE_EXPR_BUILDER_VALUE || constr instanceof SingleFieldConstraintEBLeftSide ) {
private SingleFieldConstraint visitSingleFieldConstraint(SingleFieldConstraint sfc) { SingleFieldConstraint clone = new SingleFieldConstraint(); clone.setConstraintValueType( sfc.getConstraintValueType() ); clone.setExpressionValue( (ExpressionFormLine) visit( sfc.getExpressionValue() ) ); clone.setFieldBinding( sfc.getFieldBinding() ); clone.setFactType( sfc.getFactType() ); clone.setFieldName( sfc.getFieldName() ); clone.setFieldType( sfc.getFieldType() ); clone.setOperator( sfc.getOperator() ); for ( Map.Entry<String, String> entry : sfc.getParameters().entrySet() ) { clone.setParameter( entry.getKey(), entry.getValue() ); } clone.setValue( sfc.getValue() ); if ( sfc.connectives != null ) { clone.connectives = new ConnectiveConstraint[sfc.connectives.length]; for ( int i = 0; i < sfc.connectives.length; i++ ) { clone.connectives[i] = (ConnectiveConstraint) visit( sfc.connectives[i] ); } } return clone; }
private SingleFieldConstraint visitSingleFieldConstraint(SingleFieldConstraint sfc) { SingleFieldConstraint clone = new SingleFieldConstraint(); clone.setConstraintValueType( sfc.getConstraintValueType() ); clone.setExpressionValue( (ExpressionFormLine) visit( sfc.getExpressionValue() ) ); clone.setFieldBinding( sfc.getFieldBinding() ); clone.setFactType( sfc.getFactType() ); clone.setFieldName( sfc.getFieldName() ); clone.setFieldType( sfc.getFieldType() ); clone.setOperator( sfc.getOperator() ); for ( Map.Entry<String, String> entry : sfc.getParameters().entrySet() ) { clone.setParameter( entry.getKey(), entry.getValue() ); } clone.setValue( sfc.getValue() ); if ( sfc.connectives != null ) { clone.connectives = new ConnectiveConstraint[sfc.connectives.length]; for ( int i = 0; i < sfc.connectives.length; i++ ) { clone.connectives[i] = (ConnectiveConstraint) visit( sfc.connectives[i] ); } } return clone; }
cons.getValue() ); assertEquals( "$name", cons.getFieldBinding() ); assertEquals( "33 + 1", cons.getValue() ); assertNull( cons.getFieldBinding() ); assertEquals( "age > 6", cons.getValue() ); assertNull( cons.getFieldBinding() );
assertEquals( sfc0.getConstraintValueType(), sfc0Clone.getConstraintValueType() ); assertEquals( sfc0.getFieldBinding(), sfc0Clone.getFieldBinding() ); assertEquals( sfc0.getFactType(), sfc0Clone.getFactType() ); assertEquals( sfc1.getConstraintValueType(), sfc1Clone.getConstraintValueType() ); assertEquals( sfc1.getFieldBinding(), sfc1Clone.getFieldBinding() ); assertEquals( sfc1.getFactType(), sfc1Clone.getFactType() );
assertTrue( cfc0Clone.constraints[0] instanceof SingleFieldConstraint ); SingleFieldConstraint sfc0Clone = (SingleFieldConstraint) cfc0Clone.constraints[0]; assertEquals( sfc0.getFieldBinding(), sfc0Clone.getFieldBinding() ); assertEquals( sfc0.getFactType(), sfc0Clone.getFactType() ); assertEquals( sfc1.getConstraintValueType(), sfc1Clone.getConstraintValueType() ); assertEquals( sfc1.getFieldBinding(), sfc1Clone.getFieldBinding() ); assertEquals( sfc1.getFactType(), sfc1Clone.getFactType() );
assertEquals( sfc0.getConstraintValueType(), sfc0Clone.getConstraintValueType() ); assertEquals( sfc0.getFieldBinding(), sfc0Clone.getFieldBinding() ); assertEquals( sfc0.getFactType(), sfc0Clone.getFactType() );