Package org.switchyard.validate

Examples of org.switchyard.validate.Validator


            Assert.fail("Somehow found DTD that we should not have.");
        }
    }

    protected Validator getValidator(String config) throws IOException {
        Validator validator = super.getValidator(config);

        if(!(validator instanceof XmlValidator)) {
            Assert.fail("Not an instance of XmlValidator.");
        }
View Full Code Here


                }
            }
        }

        if (validatorObject instanceof Validator) {
            Validator validator = (Validator) validatorObject;
            QName vldName = validator.getName();

            if (vldName.equals(OBJECT_TYPE)) {
                // Type info not specified on validator, so assuming it's a generic/multi-type validator...
                validators.add(validator);
            } else if ((nameIsWild || vldName.equals(name))) {
                // Matching (specific) or wildcard type info specified...
                validators.add(validator);
            } else if (isAssignableFrom(vldName, name)) {
                // Compatible Java types...
                validators.add(validator);
            }

            if (!nameIsWild) {
                validator.setName(name);
            }
        }

        if (validators.isEmpty()) {
            throw ValidateMessages.MESSAGES.errorConstructingValidatorClassNotSupported(validatorObject.getClass().getName(),
View Full Code Here

        if (!ValidationResult.class.isAssignableFrom(publicMethod.getReturnType())) {
            throw ValidateMessages.MESSAGES.invalidMethodSignatureMustReturnValidationResult(publicMethod.getName(),
                    publicMethod.getDeclaringClass().getName());
        }
       
        Validator validator = new BaseValidator(name) {
            @Override
            public ValidationResult validate(Object subject) {
                try {
                    return ValidationResult.class.cast(publicMethod.invoke(validatorObject, subject));
                } catch (InvocationTargetException e) {
View Full Code Here

TOP

Related Classes of org.switchyard.validate.Validator

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.