Package javax.xml.validation

Examples of javax.xml.validation.Validator.reset()


        Validator validator = schema.newValidator();
        Object beforeReset = validator.getProperty(SECURITY_MANAGER);
        validator.setProperty(SECURITY_MANAGER, null);
        Object changed = validator.getProperty(SECURITY_MANAGER);
        assertFalse("Property value should have changed after calling setProperty().", beforeReset != changed);
        validator.reset();
        Object afterReset = validator.getProperty(SECURITY_MANAGER);
        assertTrue("Property value should be the same after calling reset()", beforeReset == afterReset);
    }
   
    public void testFeatureReset() throws Exception {
View Full Code Here


        SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
        Schema schema = makeSchema(factory, null);
        Validator validator = schema.newValidator();
        validator.setFeature(FEATURE_STRING_DEFAULT_TRUE, false);
        validator.setFeature(FEATURE_STRING_DEFAULT_FALSE, true);
        validator.reset();
        boolean value = validator.getFeature(FEATURE_STRING_DEFAULT_TRUE);
        assertTrue("After reset, value of feature on Validator should be true.", value);
        value = validator.getFeature(FEATURE_STRING_DEFAULT_FALSE);
        assertFalse("After reset, value of feature on Validator should be false.", value);       
    }
View Full Code Here

        value = validator.getFeature(XMLConstants.FEATURE_SECURE_PROCESSING);
        assertTrue("Value of feature on Validator should have been true.", value);
        validator.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, false);
        value = validator.getFeature(XMLConstants.FEATURE_SECURE_PROCESSING);
        assertFalse("Value of feature on Validator should have been false.", value);
        validator.reset();
        value = validator.getFeature(XMLConstants.FEATURE_SECURE_PROCESSING);
        assertTrue("After reset, value of feature on Validator should be true.", value);
    }
   
    /*
 
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.