Package org.rhq.core.domain.configuration.definition.constraint

Examples of org.rhq.core.domain.configuration.definition.constraint.RegexConstraint


                    IntegerRangeConstraint ic = new IntegerRangeConstraint(longMin, longMax);
                    toConstraints.add(ic);
                } else if (constraint instanceof RegexConstraintType) {
                    RegexConstraintType regexDetails = (RegexConstraintType) constraint;

                    RegexConstraint rc = new RegexConstraint();
                    rc.setDetails(regexDetails.getExpression());

                    toConstraints.add(rc);
                } else {
                    // this will only occur if we change the .xsd schema and add a type but forget to add to the code above
                    throw new InvalidPluginDescriptorException("Unknown constraint type: " + fromC);
View Full Code Here


        pd.setSummary(true);
        pd.setOrder(0);
        pd.setAllowCustomEnumeratedValue(false);
        pd.setConfigurationDefinition(configDef);

        RegexConstraint constraint = new RegexConstraint();
        constraint.setDetails(PROP_NAME_REGEX_PATTERN);
        pd.addConstraints(constraint);

        return pd;
    }
View Full Code Here

        pd.setReadOnly(readOnly);
        pd.setSummary(true);
        pd.setOrder(1);
        pd.setAllowCustomEnumeratedValue(false);

        RegexConstraint constraint = new RegexConstraint();
        constraint.setDetails(PROP_BASEDIR_PATH_REGEX_PATTERN);
        pd.addConstraints(constraint);

        return pd;
    }
View Full Code Here

        pd.setSummary(true);
        pd.setOrder(0);
        pd.setAllowCustomEnumeratedValue(false);
        pd.setDefaultValue(".");

        RegexConstraint constraint = new RegexConstraint();
        constraint.setDetails(PROP_FILTER_PATH_REGEX_PATTERN);
        pd.addConstraints(constraint);

        return pd;
    }
View Full Code Here

        pd.setReadOnly(readOnly);
        pd.setSummary(true);
        pd.setOrder(1);
        pd.setAllowCustomEnumeratedValue(false);

        RegexConstraint constraint = new RegexConstraint();
        constraint.setDetails(PROP_FILTER_PATTERN_REGEX_PATTERN);
        pd.addConstraints(constraint);

        return pd;
    }
View Full Code Here

                doubleRangeValidator.setMaximum(maxValue);
            }

            validator = doubleRangeValidator;
        } else if (constraint instanceof RegexConstraint) {
            RegexConstraint regexConstraint = (RegexConstraint) constraint;
            validator = new RegexValidator(regexConstraint.getDetails());
        } else {
            throw new IllegalArgumentException("Unknown constraint type: " + constraint.getClass().getName());
        }

        return validator;
View Full Code Here

        PropertyDefinitionSimple alpha = def.getPropertyDefinitionSimple("alpha");
        assert alpha.getType() == PropertySimpleType.STRING;
        assert alpha.isRequired();
        assert alpha.getConstraints().size() == 1;
        RegexConstraint regexConstraint = (RegexConstraint) alpha.getConstraints().iterator().next();
        assert regexConstraint.getDetails().equals("^\\w+@[a-zA-Z_]+?\\.[a-zA-Z]{2,3}$");

        PropertyDefinitionSimple bravo = def.getPropertyDefinitionSimple("bravo");
        assert bravo.getType() == PropertySimpleType.STRING;
        assert bravo.getEnumeratedValues().size() == 4;
        assert bravo.getEnumeratedValues().get(0).getName().equals("First Option Name");
View Full Code Here

TOP

Related Classes of org.rhq.core.domain.configuration.definition.constraint.RegexConstraint

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.