Examples of RangeConstraint


Examples of org.apache.stanbol.entityhub.servicesapi.query.RangeConstraint

            message.append(" At least one of the two MUST BE parsed for a valid RangeConstraint.\n");
            message.append("Parsed Constraint: \n");
            message.append(jConstraint.toString(4));
            throw new IllegalArgumentException(message.toString());
        } else {
            constraint = new RangeConstraint(lowerBound, upperBound, inclusive);
        }
        return constraint;
    }
View Full Code Here

Examples of org.apache.stanbol.entityhub.servicesapi.query.RangeConstraint

                if(textConstraint.isCaseSensitive()){
                    jConstraint.put("caseSensitive", true);
                } //else default is false
                break;
            case range:
                RangeConstraint rangeConstraint = (RangeConstraint) constraint;
                Set<DataTypeEnum> dataTypes = EnumSet.noneOf(DataTypeEnum.class);
                if (rangeConstraint.getLowerBound() != null) {
                    jConstraint.put("lowerBound", rangeConstraint.getLowerBound());
                    dataTypes.addAll(DataTypeEnum.getPrimaryDataTypes(
                        rangeConstraint.getLowerBound().getClass()));
                }
                if (rangeConstraint.getUpperBound() != null) {
                    jConstraint.put("upperBound", rangeConstraint.getUpperBound());
                    dataTypes.addAll(DataTypeEnum.getPrimaryDataTypes(
                        rangeConstraint.getUpperBound().getClass()));
                }
                jConstraint.put("inclusive", rangeConstraint.isInclusive());
                if(!dataTypes.isEmpty()){
                    jConstraint.put("datatype", dataTypes.iterator().next().getShortName());
                }
            default:
                //unknown constraint type
View Full Code Here

Examples of org.araneaframework.uilib.form.constraint.RangeConstraint

   
    request.addParameter("testForm.__present", "true");
    request.addParameter("testForm.date.myDateLo.date", sdf.format(new java.sql.Date(System.currentTimeMillis()-1000*60*60*24)));
    request.addParameter("testForm.date.myDateHi.date", sdf.format(new java.util.Date()));
   
    testForm.getElement("date").setConstraint(new RangeConstraint((FormElement)testForm.getGenericElementByFullName("date.myDateLo"),
                                                                  (FormElement)testForm.getGenericElementByFullName("date.myDateHi"),
                                                                  true)
                                              );

    StandardServletInputData input = new StandardServletInputData(request);
View Full Code Here

Examples of org.drools.factconstraints.server.predefined.RangeConstraint

    if (NotNullConstraint.NAME.equals(config.getConstraintName())) {
      return new NotNullConstraint();
    } else if (IntegerConstraint.NAME.equals(config.getConstraintName())) {
      return new IntegerConstraint();
    } else if (RangeConstraint.NAME.equals(config.getConstraintName())) {
      return new RangeConstraint();
    } else if (NotMatchesConstraint.NAME.equals(config.getConstraintName())) {
      return new NotMatchesConstraint();
    }else if (MatchesConstraint.NAME.equals(config.getConstraintName())) {
      return new MatchesConstraint();
    }else if (InvalidFieldConstraint.NAME.equals(config.getConstraintName())) {
View Full Code Here

Examples of org.drools.ide.common.server.factconstraints.predefined.RangeConstraint

        if (NotNullConstraint.NAME.equals(config.getConstraintName())) {
            return new NotNullConstraint();
        } else if (IntegerConstraint.NAME.equals(config.getConstraintName())) {
            return new IntegerConstraint();
        } else if (RangeConstraint.NAME.equals(config.getConstraintName())) {
            return new RangeConstraint();
        } else if (NotMatchesConstraint.NAME.equals(config.getConstraintName())) {
            return new NotMatchesConstraint();
        }else if (MatchesConstraint.NAME.equals(config.getConstraintName())) {
            return new MatchesConstraint();
        }else if (InvalidFieldConstraint.NAME.equals(config.getConstraintName())) {
View Full Code Here

Examples of org.drools.ide.common.server.factconstraints.predefined.RangeConstraint

    private Constraint cons;
    private ConstraintConfiguration conf;

    @Before
    public void setup() {
        cons = new RangeConstraint();
        conf = new SimpleConstraintConfigurationImpl();
        conf.setFactType("Person");
        conf.setFieldName("age");

        conf.setArgumentValue(RangeConstraint.RANGE_CONSTRAINT_MIN, "0");
View Full Code Here

Examples of org.drools.ide.common.server.factconstraints.predefined.RangeConstraint

    private Constraint cons;
    private ConstraintConfiguration conf;

    @Before
    public void setup() {
        cons = new RangeConstraint();
        conf = new SimpleConstraintConfigurationImpl();
        conf.setFactType("Person");
        conf.setFieldName("age");
    }
View Full Code Here

Examples of org.drools.ide.common.server.factconstraints.predefined.RangeConstraint

    private Constraint cons;
    private ConstraintConfiguration conf;

    @Before
    public void setup() {
        cons = new RangeConstraint();
        conf = new SimpleConstraintConfigurationImpl();
        conf.setFactType("Person");
        conf.setFieldName("age");

        conf.setArgumentValue(RangeConstraint.RANGE_CONSTRAINT_MIN, "0");
View Full Code Here

Examples of org.drools.ide.common.server.factconstraints.predefined.RangeConstraint

        if (NotNullConstraint.NAME.equals(config.getConstraintName())) {
            return new NotNullConstraint();
        } else if (IntegerConstraint.NAME.equals(config.getConstraintName())) {
            return new IntegerConstraint();
        } else if (RangeConstraint.NAME.equals(config.getConstraintName())) {
            return new RangeConstraint();
        } else if (NotMatchesConstraint.NAME.equals(config.getConstraintName())) {
            return new NotMatchesConstraint();
        }else if (MatchesConstraint.NAME.equals(config.getConstraintName())) {
            return new MatchesConstraint();
        }else if (InvalidFieldConstraint.NAME.equals(config.getConstraintName())) {
View Full Code Here

Examples of org.grails.validation.RangeConstraint

    @SuppressWarnings({ "unchecked", "rawtypes" })
    public Comparable getMax() {
        Comparable maxValue = null;

        MaxConstraint maxConstraint = (MaxConstraint)appliedConstraints.get(MAX_CONSTRAINT);
        RangeConstraint rangeConstraint = (RangeConstraint)appliedConstraints.get(RANGE_CONSTRAINT);

        if (maxConstraint != null || rangeConstraint != null) {
            Comparable maxConstraintValue = maxConstraint == null ? null : maxConstraint.getMaxValue();
            Comparable rangeConstraintHighValue = rangeConstraint == null ? null : rangeConstraint.getRange().getTo();

            if (maxConstraintValue != null && rangeConstraintHighValue != null) {
                maxValue = (maxConstraintValue.compareTo(rangeConstraintHighValue) < 0) ? maxConstraintValue : rangeConstraintHighValue;
            }
            else if (maxConstraintValue == null && rangeConstraintHighValue != null) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.