Package org.apache.camel.processor.validation

Examples of org.apache.camel.processor.validation.ValidatingProcessor


    private ValidatingProcessor validating;

    @Override
    protected void setUp() throws Exception {
        validating = new ValidatingProcessor();
        validating.setSchemaFile(new File("src/test/resources/org/apache/camel/processor/ValidatingProcessor.xsd").getAbsoluteFile());

        super.setUp();
    }
View Full Code Here


    protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
        final String resourceUri = remaining;
        InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(getCamelContext().getClassResolver(), resourceUri);
        StreamSource source = new StreamSource(is);

        ValidatingProcessor validator = new ValidatingProcessor();
        validator.setSchemaSource(source);
        LOG.debug("{} using schema resource: {}", this, resourceUri);
        configureValidator(validator, uri, remaining, parameters);

        // force loading of schema at create time otherwise concurrent
        // processing could cause thread safe issues for the javax.xml.validation.SchemaFactory
        validator.loadSchema();
        // and make sure to close the input stream after the schema has been loaded
        IOHelper.close(is);

        return new ProcessorEndpoint(uri, this, validator);
    }
View Full Code Here

    protected ValidatingProcessor validating;

    @Override
    protected void setUp() throws Exception {
        validating = new ValidatingProcessor();
        validating.setSchemaFile(new File("src/test/resources/org/apache/camel/processor/ValidatingProcessor.xsd").getAbsoluteFile());

        super.setUp();
    }
View Full Code Here

    @Override
    protected void setUp() throws Exception {
        super.setUp();

        validating = new ValidatingProcessor();
        URL url = ObjectHelper.loadResourceAsURL("org/apache/camel/processor/ValidatingProcessor.xsd");
        validating.setSchemaUrl(url);

        // loading scheme can be forced so lets try it
        validating.loadSchema();
View Full Code Here

        super.setUp();

        File file = new File("src/test/resources/org/apache/camel/processor/ValidatingProcessor.xsd").getAbsoluteFile();
        String body = context.getTypeConverter().convertTo(String.class, file);

        validating = new ValidatingProcessor();
        validating.setSchemaSource(new StringSource(body));

        // loading scheme can be forced so lets try it
        validating.loadSchema();
    }
View Full Code Here

        } finally {
            // and make sure to close the input stream after the schema has been loaded
            IOHelper.close(is);
        }

        ValidatingProcessor validator = new ValidatingProcessor();
        validator.setSchemaAsByteArray(bytes);
        LOG.debug("{} using schema resource: {}", this, resourceUri);
        configureValidator(validator, uri, remaining, parameters);

        // force loading of schema at create time otherwise concurrent
        // processing could cause thread safe issues for the javax.xml.validation.SchemaFactory
        validator.loadSchema();

        return new ProcessorEndpoint(uri, this, validator);
    }
View Full Code Here

        super.setUp();

        File file = new File("src/test/resources/org/apache/camel/processor/ValidatingProcessor.xsd").getAbsoluteFile();
        String body = context.getTypeConverter().convertTo(String.class, file);

        validating = new ValidatingProcessor();
        validating.setSchemaSource(new StringSource(body));

        // loading scheme can be forced so lets try it
        validating.loadSchema();
    }
View Full Code Here

    protected ValidatingProcessor validating;

    @Override
    protected void setUp() throws Exception {
        validating = new ValidatingProcessor();
        validating.setSchemaFile(new File("src/test/resources/org/apache/camel/processor/ValidatingProcessor.xsd").getAbsoluteFile());
        validating.setUseSharedSchema(false);

        super.setUp();
    }
View Full Code Here

    private ValidatingProcessor validating;

    @Override
    protected void setUp() throws Exception {
        validating = new ValidatingProcessor();
        validating.setSchemaFile(new File("src/test/resources/org/apache/camel/processor/ValidatingProcessor.xsd").getAbsoluteFile());

        super.setUp();
    }
View Full Code Here

    protected ValidatingProcessor validating;

    @Override
    protected void setUp() throws Exception {
        validating = new ValidatingProcessor();
        validating.setSchemaFile(new File("src/test/resources/org/apache/camel/processor/ValidatingProcessor.xsd").getAbsoluteFile());

        super.setUp();
    }
View Full Code Here

TOP

Related Classes of org.apache.camel.processor.validation.ValidatingProcessor

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.