当前位置: 首页>>代码示例>>Java>>正文


Java Validator.getProperty方法代码示例

本文整理汇总了Java中javax.xml.validation.Validator.getProperty方法的典型用法代码示例。如果您正苦于以下问题:Java Validator.getProperty方法的具体用法?Java Validator.getProperty怎么用?Java Validator.getProperty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javax.xml.validation.Validator的用法示例。


在下文中一共展示了Validator.getProperty方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testPropertyReset

import javax.xml.validation.Validator; //导入方法依赖的package包/类
@Test
public void testPropertyReset() throws Exception {
    SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
    Schema schema = makeSchema(factory, null);
    Validator validator = schema.newValidator();
    Object beforeReset = validator.getProperty(SECURITY_MANAGER);
    validator.setProperty(SECURITY_MANAGER, null);
    Object changed = validator.getProperty(SECURITY_MANAGER);
    //for JDK, this is changed since by default the security manager is set
    assertTrue("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);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:15,代码来源:FeaturePropagationTest.java

示例2: test01

import javax.xml.validation.Validator; //导入方法依赖的package包/类
@Test
public void test01() throws SAXException {
    Validator validator = schemaFactory.newSchema().newValidator();
    try {
        validator.getProperty(null);
        Assert.fail("exception expected");
    } catch (NullPointerException e) {
        ;
    }
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:11,代码来源:Bug4969693.java

示例3: testGetNullProperty

import javax.xml.validation.Validator; //导入方法依赖的package包/类
@Test(expectedExceptions = NullPointerException.class)
public void testGetNullProperty() throws SAXNotRecognizedException, SAXNotSupportedException {
    Validator validator = getValidator();
    assertNotNull(validator);
    validator.getProperty(null);

}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:8,代码来源:ValidatorTest.java

示例4: testGetUnrecognizedProperty

import javax.xml.validation.Validator; //导入方法依赖的package包/类
@Test(expectedExceptions = SAXNotRecognizedException.class)
public void testGetUnrecognizedProperty() throws SAXNotRecognizedException, SAXNotSupportedException {
    Validator validator = getValidator();
    validator.getProperty(UNRECOGNIZED_NAME);

}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:7,代码来源:ValidatorTest.java


注:本文中的javax.xml.validation.Validator.getProperty方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。