Examples of FieldConstraint


Examples of com.abiquo.hypervisor.plugin.enumerator.FieldConstraint

    }

    private Map<ConstraintKey, String> loadConnectionConstraints(
        final HostConnectionMetadata metadata)
    {
        FieldConstraint ip = FieldConstraint.NO_APPLICABLE;
        FieldConstraint port = FieldConstraint.NO_APPLICABLE;
        FieldConstraint credentials = FieldConstraint.NO_APPLICABLE;

        if (metadata != null)
        {
            ip = metadata.ip();
            port = metadata.port();
            credentials = metadata.credentials();
        }

        return ImmutableMap.<ConstraintKey, String> builder().put(ConstraintKey.HOST_IP, ip.name())
            .put(ConstraintKey.HOST_PORT, port.name())
            .put(ConstraintKey.HOST_CREDENTIALS, credentials.name()).build();
    }
View Full Code Here

Examples of es.internna.framework.annotations.FieldConstraint

        return result;
    }
   
    protected void validateRequiredField(Field field, Object object, Errors errors)
    {
        FieldConstraint req = field.getAnnotation(FieldConstraint.class);
        if (req.required() && validateNull(field, object))
            errors.rejectValue(field.getName(), errorCodes[0]);
    }
View Full Code Here

Examples of es.internna.spring.annotations.validation.FieldConstraint

        return result;
    }
   
    protected void validateRequiredField(Field field, Object object, Errors errors)
    {
        FieldConstraint req = field.getAnnotation(FieldConstraint.class);
        if (req.required() && validateNull(field, object))
            errors.rejectValue(field.getName(), errorCodes[0]);
    }
View Full Code Here

Examples of org.drools.brms.client.modeldriven.brl.FieldConstraint

    String typeField = (String) dataEnumLookupFields.get(pat.factType + "." + field );

    if (pat.constraintList != null && pat.constraintList.constraints != null) {
      FieldConstraint[] cons = pat.constraintList.constraints;
      for (int i = 0; i < cons.length; i++) {
        FieldConstraint con = cons[i];
        if (con instanceof SingleFieldConstraint) {
          SingleFieldConstraint sfc = (SingleFieldConstraint) con;
          if ( sfc.fieldName.equals(typeField)) {
            String key = pat.factType + "." + field + "[" + typeField + "=" + sfc.value + "]";
            return (String[]) this.dataEnumLists.get(key);
View Full Code Here

Examples of org.drools.guvnor.client.modeldriven.brl.FieldConstraint

            Object _typeField = dataEnumLookupFields.get( pat.factType + "." + field );
            if ( _typeField instanceof String ) {
                String typeField = (String) _typeField;
                FieldConstraint[] cons = pat.constraintList.constraints;
                for ( int i = 0; i < cons.length; i++ ) {
                    FieldConstraint con = cons[i];
                    if ( con instanceof SingleFieldConstraint ) {
                        SingleFieldConstraint sfc = (SingleFieldConstraint) con;
                        if ( sfc.fieldName.equals( typeField ) ) {
                            String key = pat.factType + "." + field + "[" + typeField + "=" + sfc.value + "]";
                            return DropDownData.create( (String[]) this.dataEnumLists.get( key ) );
                        }
                    }
                }
            } else if ( _typeField != null ) {
                // these enums are calculated on demand, server side...
                String[] fieldsNeeded = (String[]) _typeField;
                String queryString = getQueryString( pat.factType,
                                                     field,
                                                     this.dataEnumLists );

                String[] valuePairs = new String[fieldsNeeded.length];

                // collect all the values of the fields needed, then return it
                // as a string...
                for ( int i = 0; i < fieldsNeeded.length; i++ ) {
                    for ( int j = 0; j < pat.constraintList.constraints.length; j++ ) {
                        FieldConstraint con = pat.constraintList.constraints[j];
                        if ( con instanceof SingleFieldConstraint ) {
                            SingleFieldConstraint sfc = (SingleFieldConstraint) con;
                            if ( sfc.fieldName.equals( fieldsNeeded[i] ) ) {
                                valuePairs[i] = fieldsNeeded[i] + "=" + sfc.value;
                            }
View Full Code Here

Examples of org.drools.guvnor.models.commons.shared.rule.FieldConstraint

                //Add the constraint from this cell
                switch ( c.getConstraintValueType() ) {
                    case BaseSingleFieldConstraint.TYPE_LITERAL:
                    case BaseSingleFieldConstraint.TYPE_RET_VALUE:
                        if ( !isOtherwise ) {
                            FieldConstraint fc = makeSingleFieldConstraint( c,
                                                                            cell );
                            fp.addConstraint( fc );
                        } else {
                            FieldConstraint fc = makeSingleFieldConstraint( c,
                                                                            allColumns,
                                                                            data );
                            fp.addConstraint( fc );
                        }
                        break;
View Full Code Here

Examples of org.drools.ide.common.client.modeldriven.brl.FieldConstraint

                    applicableBindingsInScope.add( v );
                }
            }

            //LHS FieldConstraint
            FieldConstraint fc = model.getLHSBoundField( v );
            if ( fc != null ) {
                if ( isLHSFieldTypeEquivalent( v ) ) {
                    applicableBindingsInScope.add( v );
                }
            }
View Full Code Here

Examples of org.drools.ide.common.client.modeldriven.brl.FieldConstraint

        //If the fieldTypes are SuggestionCompletionEngine.TYPE_COMPARABLE check the enums are equivalent
        if ( boundFieldType.equals( SuggestionCompletionEngine.TYPE_COMPARABLE ) ) {
            if ( !this.fieldType.equals( SuggestionCompletionEngine.TYPE_COMPARABLE ) ) {
                return false;
            }
            FieldConstraint fc = this.model.getLHSBoundField( boundVariable );
            if ( fc instanceof SingleFieldConstraint ) {
                String fieldName = ((SingleFieldConstraint) fc).getFieldName();
                String parentFactTypeForBinding = this.model.getLHSParentFactPatternForBinding( boundVariable ).getFactType();
                String[] dd = this.sce.getEnumValues( parentFactTypeForBinding,
                                                      fieldName );
View Full Code Here

Examples of org.drools.ide.common.client.modeldriven.brl.FieldConstraint

        ins.setType( SuggestionCompletionEngine.TYPE_STRING );
        dt.getActionCols().add( ins );

        BRLRuleModel model = new BRLRuleModel( dt );

        FieldConstraint fcr1 = model.getLHSBoundField( "$sfc1" );
        assertNotNull( fcr1 );
        assertTrue( fcr1 instanceof SingleFieldConstraint );
        SingleFieldConstraint fcr1sfc = (SingleFieldConstraint) fcr1;
        assertEquals( "name",
                      fcr1sfc.getFieldName() );
View Full Code Here

Examples of org.drools.ide.common.client.modeldriven.brl.FieldConstraint

    private void traverseSingleFieldConstraints(List<FieldConstraint> sortedConst,
                                                final DirtyableFlexTable table,
                                                List<FieldConstraint> parents,
                                                int i) {
        int tabs = -1;
        FieldConstraint current = sortedConst.get( i );
        if ( current instanceof SingleFieldConstraint ) {
            SingleFieldConstraint single = (SingleFieldConstraint) current;
            FieldConstraint parent = single.getParent();

            for ( int j = 0; j < parents.size(); j++ ) {
                FieldConstraint storedParent = parents.get( j );
                if ( storedParent != null && storedParent.equals( parent ) ) {
                    tabs = j + 1;
                    traverseForRemoval( parents,
                                        j );
                    parents.add( current );
                    break;
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.