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; }
/** * This adds a new connective. */ @Override public void addNewConnective() { String factType = getExpressionLeftSide().getPreviousGenericType(); if ( factType == null ) { factType = getExpressionLeftSide().getGenericType(); } String fieldName = getExpressionLeftSide().getFieldName(); String fieldType = getExpressionLeftSide().getGenericType(); if ( this.connectives == null ) { this.connectives = new ConnectiveConstraint[]{new ConnectiveConstraint( factType, fieldName, fieldType )}; } else { final ConnectiveConstraint[] newList = new ConnectiveConstraint[this.connectives.length + 1]; for ( int i = 0; i < this.connectives.length; i++ ) { newList[i] = this.connectives[i]; } newList[this.connectives.length] = new ConnectiveConstraint( factType, fieldName, fieldType ); this.connectives = newList; } }
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; }
/** * This adds a new connective. */ @Override public void addNewConnective() { String factType = getExpressionLeftSide().getPreviousGenericType(); if ( factType == null ) { factType = getExpressionLeftSide().getGenericType(); } String fieldName = getExpressionLeftSide().getFieldName(); String fieldType = getExpressionLeftSide().getGenericType(); if ( this.connectives == null ) { this.connectives = new ConnectiveConstraint[]{new ConnectiveConstraint( factType, fieldName, fieldType )}; } else { final ConnectiveConstraint[] newList = new ConnectiveConstraint[this.connectives.length + 1]; for ( int i = 0; i < this.connectives.length; i++ ) { newList[i] = this.connectives[i]; } newList[this.connectives.length] = new ConnectiveConstraint( factType, fieldName, fieldType ); this.connectives = newList; } }
private void visitSingleFieldConstraint(SingleFieldConstraintEBLeftSide sfexp) { String genericType = sfexp.getExpressionLeftSide().getGenericType(); String factType = sfexp.getExpressionLeftSide().getPreviousClassType(); if ( factType == null ) { factType = sfexp.getExpressionLeftSide().getClassType(); } InterpolationVariable var = new InterpolationVariable( sfexp.getValue(), genericType, factType, sfexp.getFieldName() ); if ( BaseSingleFieldConstraint.TYPE_TEMPLATE == sfexp.getConstraintValueType() && !vars.containsKey( var ) ) { vars.put( var, vars.size() ); } //Visit Connection constraints if ( sfexp.connectives != null ) { for ( int i = 0; i < sfexp.connectives.length; i++ ) { final ConnectiveConstraint cc = sfexp.connectives[i]; InterpolationVariable ccVar = new InterpolationVariable( cc.getValue(), genericType, factType, cc.getFieldName() ); if ( BaseSingleFieldConstraint.TYPE_TEMPLATE == cc.getConstraintValueType() && !vars.containsKey( ccVar ) ) { vars.put( ccVar, vars.size() ); } } } }
private void visitSingleFieldConstraint(SingleFieldConstraintEBLeftSide sfexp) { String genericType = sfexp.getExpressionLeftSide().getGenericType(); String factType = sfexp.getExpressionLeftSide().getPreviousClassType(); if ( factType == null ) { factType = sfexp.getExpressionLeftSide().getClassType(); } InterpolationVariable var = new InterpolationVariable( sfexp.getValue(), genericType, factType, sfexp.getFieldName() ); if ( BaseSingleFieldConstraint.TYPE_TEMPLATE == sfexp.getConstraintValueType() && !vars.containsKey( var ) ) { vars.put( var, vars.size() ); } //Visit Connection constraints if ( sfexp.connectives != null ) { for ( int i = 0; i < sfexp.connectives.length; i++ ) { final ConnectiveConstraint cc = sfexp.connectives[i]; InterpolationVariable ccVar = new InterpolationVariable( cc.getValue(), genericType, factType, cc.getFieldName() ); if ( BaseSingleFieldConstraint.TYPE_TEMPLATE == cc.getConstraintValueType() && !vars.containsKey( ccVar ) ) { vars.put( ccVar, vars.size() ); } } } }
addFieldRestriction( buf, sfexp.getConstraintValueType(), sfexp.getExpressionLeftSide().getGenericType(), sfexp.getOperator(), parameters,
addFieldRestriction( buf, sfexp.getConstraintValueType(), sfexp.getExpressionLeftSide().getGenericType(), sfexp.getOperator(), parameters,
assertEquals( eflhs0.getFieldName(), eflhs0Clone.getFieldName() ); assertEquals( eflhs0.getGenericType(), eflhs0Clone.getGenericType() ); assertEquals( eflhs0.getParametricType(), eflhs0Clone.getParametricType() ); assertEquals( efl0.getFieldName(), efl0Clone.getFieldName() ); assertEquals( efl0.getGenericType(), efl0Clone.getGenericType() ); assertEquals( efl0.getParametricType(), efl0Clone.getParametricType() );
assertEquals( efl0.getFieldName(), efl0Clone.getFieldName() ); assertEquals( efl0.getGenericType(), efl0Clone.getGenericType() ); assertEquals( efl0.getParametricType(), efl0Clone.getParametricType() );
assertEquals( efl0.getFieldName(), efl0Clone.getFieldName() ); assertEquals( efl0.getGenericType(), efl0Clone.getGenericType() ); assertEquals( efl0.getParametricType(), efl0Clone.getParametricType() );
assertEquals( efl0.getFieldName(), efl0Clone.getFieldName() ); assertEquals( efl0.getGenericType(), efl0Clone.getGenericType() ); assertEquals( efl0.getParametricType(), efl0Clone.getParametricType() );
assertEquals( efl0.getFieldName(), efl0Clone.getFieldName() ); assertEquals( efl0.getGenericType(), efl0Clone.getGenericType() ); assertEquals( efl0.getParametricType(), efl0Clone.getParametricType() );