Package com.sun.enterprise.tools.common.validation.constraints

Examples of com.sun.enterprise.tools.common.validation.constraints.ConstraintFailure


                Object[] arguments = new Object[]{set};

                String genericFailureMessage =
                    MessageFormat.format(format, arguments);

                failed_constrained_list.add(new ConstraintFailure(toString(),
                    value, name, failureMessage, genericFailureMessage));
            }
        }
        return failed_constrained_list;
    }
View Full Code Here


                Object[] arguments = new Object[]{"True", "False"};     //NOI18N

                String genericFailureMessage =
                    MessageFormat.format(format, arguments);

                failed_constrained_list.add(new ConstraintFailure(toString(),
                    value, name, failureMessage, genericFailureMessage));
            }
        }
        return failed_constrained_list;
    }
View Full Code Here

                return failed_constrained_list;
            } catch(NumberFormatException e) {
                String failureMessage = formatFailureMessage(toString(), value,
                    name);

                failed_constrained_list.add(new ConstraintFailure(toString(),
                    value, name, failureMessage, BundleReader.getValue(
                        "MSG_NumberConstraint_Failure")));              //NOI18N
            }
        }
        return failed_constrained_list;
View Full Code Here

        Collection failed_constrained_list = new ArrayList();
        if((value != null) && (value.length() != 0)) {
            value = value.trim();
            if(value.length() == 0){
                String failureMessage = formatFailureMessage(toString(), name);
                failed_constrained_list.add(new ConstraintFailure(toString(),
                    value, name, failureMessage, BundleReader.getValue(
                        "MSG_NonBlankConstraint_Failure")));            //NOI18N
            }
        }
        return failed_constrained_list;
View Full Code Here

                   "Error_expects_argument_one_to_be_an_array_of_Objects"));//NOI18N
            }

            if((null == values) || (values.length  <  1)){
                String failureMessage = formatFailureMessage(toString(), name);
                failed_constrained_list.add(new ConstraintFailure(toString(),
                    null, name, failureMessage, BundleReader.getValue(
                        "MSG_CardinalConstraint_Failure")));            //NOI18N
            }
        } else {
            if(Constants.MANDATORY_ELEMENT == cardinal){
                if (null == value){
                    String failureMessage =
                        formatFailureMessage(toString(), name);
                    failed_constrained_list.add(
                        new ConstraintFailure(toString(), null, name,
                            failureMessage, BundleReader.getValue(
                                "MSG_CardinalConstraint_Failure")));    //NOI18N
                }
            }
        }
View Full Code Here

    public void testText() {
        CustomDisplay display = new CustomDisplay();

       
        ArrayList failureMessages = new ArrayList();
        ConstraintFailure failure_abc =
            new ConstraintFailure("abc failed", "value_abc",            //NOI18N
                 "name_abc", "failureMessage_abc",                      //NOI18N
                    "genericFailureMessage_abc");                       //NOI18N
        ConstraintFailure failure_xyz =
            new ConstraintFailure("constraint_xyz", "value_xyz",        //NOI18N
                "name_xyz", "failureMessage_xyz",                       //NOI18N
                    "genericFailureMessage_xyz");                       //NOI18N
        failureMessages.add(failure_abc);
        failureMessages.add(failure_xyz);
        display.text(failureMessages);
View Full Code Here

            try {
                int intValue = Integer.parseInt(value);
                if((intValue < 0) || (intValue > Integer.MAX_VALUE)){
                    String failureMessage = formatFailureMessage(toString(),
                        value, name);
                    failed_constrained_list.add(new ConstraintFailure(toString(),
                        value, name, failureMessage, BundleReader.getValue(
                           "MSG_ZeroToMaxIntegerConstraint_Failure"))); //NOI18N
                }
                return failed_constrained_list;
            } catch(NumberFormatException e) {
                String failureMessage = formatFailureMessage(toString(), value,
                    name);
                failed_constrained_list.add(new ConstraintFailure(toString(),
                    value, name, failureMessage, BundleReader.getValue(
                        "MSG_NumberConstraint_Failure")));              //NOI18N
            }
        }
        return failed_constrained_list;
View Full Code Here

     */
    public java.util.Collection match(Object value, String name) {
        Collection failed_constrained_list = new ArrayList();
        if (null == value){
            String failureMessage = formatFailureMessage(toString(), name);
            failed_constrained_list.add(new ConstraintFailure(toString(), value,
                name, failureMessage, BundleReader.getValue(
                    "MSG_MandatoryConstraint_Failure")));               //NOI18N
        }
        return failed_constrained_list;
    }
View Full Code Here

        String range = startValue + " - " + endValue;
        Object[] arguments = new Object[]{range};
        String genericFailureMessage =
            MessageFormat.format(format, arguments);

        failed_constrained_list.add(new ConstraintFailure(toString(),
            value, name, failureMessage, genericFailureMessage));
    }
View Full Code Here

            "MSG_IntegerGreaterThanConstraint_Failure");                //NOI18N
        Object[] arguments =
            new Object[]{String.valueOf(value)};
        String genericFailureMessage = MessageFormat.format(format, arguments);

        failed_constrained_list.add(new ConstraintFailure(toString(),
            inputValue, name, failureMessage, genericFailureMessage));
    }
View Full Code Here

TOP

Related Classes of com.sun.enterprise.tools.common.validation.constraints.ConstraintFailure

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.