private String getCurrentGenericType() { return expression.getGenericType(); }
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.getConnectives() != null ) { for ( int i = 0; i < sfexp.getConnectives().length; i++ ) { final ConnectiveConstraint cc = sfexp.getConnectives()[ 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() ); } } } }
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.getConstraints() != null ) { for ( FieldConstraint ss : s.getConstraints() ) { 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.getConnectives() == null ) { this.setConnectives( new ConnectiveConstraint[]{ new ConnectiveConstraint( factType, fieldName, fieldType ) } ); } else { final ConnectiveConstraint[] newList = new ConnectiveConstraint[ this.getConnectives().length + 1 ]; for ( int i = 0; i < this.getConnectives().length; i++ ) { newList[ i ] = this.getConnectives()[ i ]; } newList[ this.getConnectives().length ] = new ConnectiveConstraint( factType, fieldName, fieldType ); this.setConnectives( newList ); } }
addFieldRestriction( buf, sfexp.getConstraintValueType(), sfexp.getExpressionLeftSide().getGenericType(), sfexp.getOperator(), parameters,
this.factType = sfexp.getExpressionLeftSide().getPreviousGenericType(); if ( this.factType == null ) { this.factType = sfexp.getExpressionLeftSide().getGenericType(); this.fieldType = sfexp.getExpressionLeftSide().getGenericType();
this.factType = sfexp.getExpressionLeftSide().getPreviousGenericType(); if ( this.factType == null ) { this.factType = sfexp.getExpressionLeftSide().getGenericType(); this.fieldType = sfexp.getExpressionLeftSide().getGenericType();
factType = sfexp.getExpressionLeftSide().getPreviousGenericType(); if ( factType == null ) { factType = sfexp.getExpressionLeftSide().getGenericType();