Package org.apache.turbine.services.intake.xmlmodel

Examples of org.apache.turbine.services.intake.xmlmodel.Rule


                        + "InitableByConstraintMap");
            }
        }

        // field may have been declared as always required in the xml spec
        Rule reqRule = (Rule) field.getRuleMap().get("required");
        if (reqRule != null)
        {
            alwaysRequired = Boolean.valueOf(reqRule.getValue()).booleanValue();
            ifRequiredMessage = reqRule.getMessage();
        }

        Rule maxLengthRule = (Rule) field.getRuleMap().get("maxLength");
        if (maxLengthRule != null)
        {
            maxSize = maxLengthRule.getValue();
        }

        // map the getter and setter methods
        mapToObject = field.getMapToObject();
        String propName = field.getMapToProperty();
View Full Code Here


            validator = (Validator)Class.forName(className).newInstance();
            validator.init(field.getRuleMap());
        }

        // field may have been declared as always required in the xml spec
        Rule reqRule = (Rule)field.getRuleMap().get("required");
        if ( reqRule != null )
        {
            alwaysRequired = new Boolean(reqRule.getValue()).booleanValue();
        }

        mapToObject = field.getMapToObject();
        String propName = field.getMapToProperty();
        Method tmpGetter = null;
View Full Code Here

                        + "InitableByConstraintMap");
            }
        }

        // field may have been declared as always required in the xml spec
        Rule reqRule = (Rule) field.getRuleMap().get("required");
        if (reqRule != null)
        {
            alwaysRequired = new Boolean(reqRule.getValue()).booleanValue();
            ifRequiredMessage = reqRule.getMessage();
        }

        Rule maxLengthRule = (Rule) field.getRuleMap().get("maxLength");
        if (maxLengthRule != null)
        {
            maxSize = maxLengthRule.getValue();
        }

        // map the getter and setter methods
        mapToObject = field.getMapToObject();
        String propName = field.getMapToProperty();
View Full Code Here

                        + "InitableByConstraintMap");
            }
        }

        // field may have been declared as always required in the xml spec
        Rule reqRule = (Rule) field.getRuleMap().get("required");
        if (reqRule != null)
        {
            alwaysRequired = Boolean.valueOf(reqRule.getValue()).booleanValue();
            ifRequiredMessage = reqRule.getMessage();
        }

        Rule maxLengthRule = (Rule) field.getRuleMap().get("maxLength");
        if (maxLengthRule != null)
        {
            maxSize = maxLengthRule.getValue();
        }

        // map the getter and setter methods
        mapToObject = field.getMapToObject();
        String propName = field.getMapToProperty();
View Full Code Here

        BigDecimal tmpMaxValue = null;
        String tmpMaxValueMessage = null;
        boolean tmpMaxValueForce = false;
        for (int i=0; i<field.getRules().size(); i++)
        {
            Rule rule = (Rule)field.getRules().get(i);

            if ( rule.getMinValue() != null )
            {
                tmpMinValue = new BigDecimal(rule.getMinValue());
                tmpMinValueMessage = rule.getMessage();
                tmpMinValueForce = "force".equals(rule.getAction());
            }

            if ( rule.getMaxValue() != null )
            {
                tmpMaxValue = new BigDecimal(rule.getMaxValue());
                tmpMaxValueMessage = rule.getMessage();
                tmpMaxValueForce = "force".equals(rule.getAction());
            }
        } 
        minValue = tmpMinValue;
        minValueMessage  = tmpMinValueMessage;
        minValueForce  = tmpMinValueForce;
View Full Code Here

        ComboKey tmpMaxValue = null;
        String tmpMaxValueMessage = null;
        boolean tmpMaxValueForce = false;
        for (int i=0; i<field.getRules().size(); i++)
        {
            Rule rule = (Rule)field.getRules().get(i);

            if ( rule.getMinValue() != null )
            {
                tmpMinValue = new ComboKey(rule.getMinValue());
                tmpMinValueMessage = rule.getMessage();
                tmpMinValueForce = "force".equals(rule.getAction());
            }

            if ( rule.getMaxValue() != null )
            {
                tmpMaxValue = new ComboKey(rule.getMaxValue());
                tmpMaxValueMessage = rule.getMessage();
                tmpMaxValueForce = "force".equals(rule.getAction());
            }
        } 
        minValue = tmpMinValue;
        minValueMessage  = tmpMinValueMessage;
        minValueForce  = tmpMinValueForce;
View Full Code Here

        int tmpMaxValue = Integer.MAX_VALUE;
        String tmpMaxValueMessage = null;
        boolean tmpMaxValueForce = false;
        for (int i=0; i<field.getRules().size(); i++)
        {
            Rule rule = (Rule)field.getRules().get(i);

            if ( rule.getMinValue() != null )
            {
                tmpMinValue = Integer.parseInt(rule.getMinValue());
                tmpMinValueMessage = rule.getMessage();
                tmpMinValueForce = "force".equals(rule.getAction());
            }

            if ( rule.getMaxValue() != null )
            {
                tmpMaxValue = Integer.parseInt(rule.getMaxValue());
                tmpMaxValueMessage = rule.getMessage();
                tmpMaxValueForce = "force".equals(rule.getAction());
            }
        } 
        minValue = tmpMinValue;
        minValueMessage  = tmpMinValueMessage;
        minValueForce  = tmpMinValueForce;
View Full Code Here

        NumberKey tmpMaxValue = null;
        String tmpMaxValueMessage = null;
        boolean tmpMaxValueForce = false;
        for (int i=0; i<field.getRules().size(); i++)
        {
            Rule rule = (Rule)field.getRules().get(i);

            if ( rule.getMinValue() != null )
            {
                tmpMinValue = new NumberKey(rule.getMinValue());
                tmpMinValueMessage = rule.getMessage();
                tmpMinValueForce = "force".equals(rule.getAction());
            }

            if ( rule.getMaxValue() != null )
            {
                tmpMaxValue = new NumberKey(rule.getMaxValue());
                tmpMaxValueMessage = rule.getMessage();
                tmpMaxValueForce = "force".equals(rule.getAction());
            }
        } 
        minValue = tmpMinValue;
        minValueMessage  = tmpMinValueMessage;
        minValueForce  = tmpMinValueForce;
View Full Code Here

        isMultiValued  = field.isMultiValued();

        int requires_index = 0;
        for (int i=0; i<field.getRules().size(); i++)
        {
            Rule rule = (Rule)field.getRules().get(i);
            if ( rule.getRequiresProp()!=null )
            {
                requires_index++;
            }
        }
        requires = new String[requires_index];
        requiresMessage  = new String[requires_index];
       
        requires_index = 0;
        RE tmpRE = null;
        String tmpREMessage = null;
        int tmpMinLength = 0;
        String tmpMinLengthMessage = null;           
        int tmpMaxLength = 0;
        String tmpMaxLengthMessage = null;
        boolean tmpMaxLengthForce = false;
        for (int i=0; i<field.getRules().size(); i++)
        {
            Rule rule = (Rule)field.getRules().get(i);
           
            if ( rule.getMask() != null )
            {
                tmpRE = new RE(rule.getMask());           
                tmpREMessage = rule.getMessage();
            }

            if ( rule.getMinLength() != null )
            {
                tmpMinLength = Integer.parseInt(rule.getMinLength());
                tmpMinLengthMessage = rule.getMessage();
            }

            if ( rule.getMaxLength() != null )
            {
                tmpMaxLength = Integer.parseInt(rule.getMaxLength());
                tmpMaxLengthMessage = rule.getMessage();
                tmpMaxLengthForce = "force".equals(rule.getAction());
            }

            if ( field.getGroup()!=null && rule.getRequiresProp()!=null )
            {
                requires[requires_index] = rule.getRequiresProp();
                requiresMessage[requires_index] = rule.getMessage();
                requires_index++;
            }
        }
        regexp = tmpRE;
        regexpMessage  = tmpREMessage;
View Full Code Here

            }

        }

        // field may have been declared as always required in the xml spec
        Rule reqRule = (Rule)field.getRuleMap().get("required");
        if ( reqRule != null )
        {
            alwaysRequired = new Boolean(reqRule.getValue()).booleanValue();
        }

        mapToObject = field.getMapToObject();
        String propName = field.getMapToProperty();
        Method tmpGetter = null;
View Full Code Here

TOP

Related Classes of org.apache.turbine.services.intake.xmlmodel.Rule

Copyright © 2018 www.massapicom. 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.