private String getCurrentGenericType() { //If the last ExpressionPart is ExpressionText then we can't show any Fields or Methods from which to select if (expression.getParts().isEmpty()) { return null; } if (expression.getParts().get(expression.getParts().size() - 1) instanceof ExpressionText) { return DataType.TYPE_FINAL_OBJECT; } return expression.getGenericType(); }
private String getCurrentGenericType() { //If the last ExpressionPart is ExpressionText then we can't show any Fields or Methods from which to select if (expression.getParts().isEmpty()) { return null; } if (expression.getParts().get(expression.getParts().size() - 1) instanceof ExpressionText) { return DataType.TYPE_FINAL_OBJECT; } return expression.getGenericType(); }
private void setUpSingleFieldConstraintEBLeftSide(SingleFieldConstraintEBLeftSide sfexp) { this.factType = sfexp.getExpressionLeftSide().getPreviousClassType(); if (this.factType == null) { this.factType = sfexp.getExpressionLeftSide().getClassType(); } this.fieldName = sfexp.getExpressionLeftSide().getFieldName(); this.fieldType = sfexp.getExpressionLeftSide().getGenericType(); }
private void setUpSingleFieldConstraintEBLeftSide(SingleFieldConstraintEBLeftSide sfexp) { this.factType = sfexp.getExpressionLeftSide().getPreviousClassType(); if (this.factType == null) { this.factType = sfexp.getExpressionLeftSide().getClassType(); } this.fieldName = sfexp.getExpressionLeftSide().getFieldName(); this.fieldType = sfexp.getExpressionLeftSide().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()); } } } }
public 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; }
private void visitSingleFieldConstraint(final SingleFieldConstraintEBLeftSide sfexp) { final String genericType = sfexp.getExpressionLeftSide().getGenericType(); String factType = sfexp.getExpressionLeftSide().getPreviousClassType(); if (factType == null) {
/** * 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 ); } }
private void generateNormalFieldRestriction(final SingleFieldConstraint constr, final Map<String, String> parameters) { if (constr instanceof SingleFieldConstraintEBLeftSide) { SingleFieldConstraintEBLeftSide sfexp = (SingleFieldConstraintEBLeftSide) constr; addFieldRestriction(buf, sfexp.getConstraintValueType(), sfexp.getExpressionLeftSide().getGenericType(), sfexp.getOperator(), parameters, sfexp.getValue(), sfexp.getExpressionValue(), true); } else { addFieldRestriction(buf, constr.getConstraintValueType(), constr.getFieldType(), constr.getOperator(), parameters, constr.getValue(), constr.getExpressionValue(), true); } }
addConnectiveFieldRestriction(buf, sfexp.getConstraintValueType(), sfexp.getExpressionLeftSide().getGenericType(), sfexp.getOperator(), parameters,