• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java NoStaticExceptFinalRule类的典型用法和代码示例

java 3次浏览

本文整理汇总了Java中com.openpojo.validation.rule.impl.NoStaticExceptFinalRule的典型用法代码示例。如果您正苦于以下问题:Java NoStaticExceptFinalRule类的具体用法?Java NoStaticExceptFinalRule怎么用?Java NoStaticExceptFinalRule使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

NoStaticExceptFinalRule类属于com.openpojo.validation.rule.impl包,在下文中一共展示了NoStaticExceptFinalRule类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: setUp

点赞 3

import com.openpojo.validation.rule.impl.NoStaticExceptFinalRule; //导入依赖的package包/类
@Before
public void setUp() {
	AttributeHelper.registerFieldPrefix("_");

	_validator = ValidatorBuilder.create(
	).with(
		new GetterMustExistRule()
	).with(
		new NoStaticExceptFinalRule()
	).with(
		new NoFieldShadowingRule()
	).with(
		new NoPublicFieldsRule()
	).with(
		new GetterTester()
	).with(
		new DefaultValuesNullTester()
	).build();
}
 

开发者ID:liferay,
项目名称:com-liferay-apio-architect,
代码行数:20,
代码来源:POJOTest.java

示例2: testPojoStructureAndBehavior

点赞 3

import com.openpojo.validation.rule.impl.NoStaticExceptFinalRule; //导入依赖的package包/类
@Test
@Category(UnitTest.class)
@SuppressWarnings("unchecked")
public void testPojoStructureAndBehavior() {
    if (this.getClass() == PojoTest.class) {
        return;
    }
    Class<T> typeParameterClass = (Class<T>) ((ParameterizedType) getClass().getGenericSuperclass()).getActualTypeArguments()[0];
    
    PojoValidator pojoValidator = new PojoValidator();

    // Create Rules to validate structure for POJO_PACKAGE
    pojoValidator.addRule(new NoPublicFieldsRule());
    pojoValidator.addRule(new NoPrimitivesRule());
    pojoValidator.addRule(new NoStaticExceptFinalRule());
    pojoValidator.addRule(new GetterMustExistRule());
    pojoValidator.addRule(new SetterMustExistRule());
    pojoValidator.addRule(new NoNestedClassRule());

    // Create Testers to validate behaviour for POJO_PACKAGE
    pojoValidator.addTester(new SetterTester());
    pojoValidator.addTester(new GetterTester());
    
    PojoClass pojoClass = PojoClassFactory.getPojoClass(typeParameterClass);
    pojoValidator.runValidation(pojoClass);
}
 

开发者ID:Livefyre,
项目名称:livefyre-java-utils,
代码行数:27,
代码来源:PojoTest.java

示例3: testPojo

点赞 3

import com.openpojo.validation.rule.impl.NoStaticExceptFinalRule; //导入依赖的package包/类
@Test
public void testPojo() {
	PojoValidator pojoValidator = new PojoValidator();

	// Create Rules to validate structure for POJO_PACKAGE
	pojoValidator.addRule(new NoPublicFieldsRule());
	pojoValidator.addRule(new NoPrimitivesRule());
	pojoValidator.addRule(new NoStaticExceptFinalRule());
	pojoValidator.addRule(new GetterMustExistRule());
	pojoValidator.addRule(new SetterMustExistRule());
	pojoValidator.addRule(new NoNestedClassRule());
	pojoValidator.addRule(new NoPublicFieldsExceptStaticFinalRule());
	pojoValidator.addRule(new NoStaticExceptFinalRule());
	pojoValidator.addRule(new SerializableMustHaveSerialVersionUIDRule());

	// Create Testers to validate behaviour for POJO_PACKAGE
	pojoValidator.addTester(new SetterTester());
	pojoValidator.addTester(new GetterTester());
	PojoClass pojoClass = PojoClassFactory.getPojoClass(getPojoClass());
	pojoValidator.runValidation(pojoClass);
}
 

开发者ID:aracrown,
项目名称:ara-commons,
代码行数:22,
代码来源:AbstractSinglePojoClassTest.java

示例4: setUp

点赞 2

import com.openpojo.validation.rule.impl.NoStaticExceptFinalRule; //导入依赖的package包/类
@Before
public void setUp() {
	AttributeHelper.registerFieldPrefix("_");

	_validator = ValidatorBuilder.create(
	).with(
		new NoStaticExceptFinalRule()
	).with(
		new NoFieldShadowingRule()
	).with(
		new NoPublicFieldsRule()
	).with(
		new DefaultValuesNullTester()
	).build();
}
 

开发者ID:liferay,
项目名称:com-liferay-apio-architect,
代码行数:16,
代码来源:ThrowableTest.java

示例5: init

点赞 2

import com.openpojo.validation.rule.impl.NoStaticExceptFinalRule; //导入依赖的package包/类
@Before
public void init() {
	pojoValidator = new PojoValidator();
	pojoValidator.addRule(new NoPublicFieldsRule());
	pojoValidator.addRule(new NoStaticExceptFinalRule());
	pojoValidator.addRule(new NoFieldShadowingRule());
	pojoValidator.addRule(new GetterMustExistRule());
	pojoValidator.addRule(new SetterMustExistRule());

	pojoValidator.addTester(new SetterTester());
	pojoValidator.addTester(new GetterTester());
	pojoValidator.addTester(new Tester() {

		@Override
		public void run(PojoClass pojoClass) {
			List<PojoMethod> list = pojoClass.getPojoConstructors();
			for (PojoMethod method : list) {
				Class<?>[] types = method.getParameterTypes();
				int count = types.length;
				Object[] values = new Object[count];
				for (int i = 0; i < count; i++) {
					values[i] = RandomFactory.getRandomValue(types[i]);
				}
				method.invoke(null, values);
			}
		}
	});

}
 

开发者ID:ttwd80,
项目名称:qir,
代码行数:30,
代码来源:AbstractPojoTest.java

示例6: testPojoStructureAndBehavior

点赞 2

import com.openpojo.validation.rule.impl.NoStaticExceptFinalRule; //导入依赖的package包/类
@Test
public void testPojoStructureAndBehavior() {
    Validator validator = ValidatorBuilder.create()
            .with(new GetterMustExistRule())
            .with(new SetterMustExistRule())
            .with(new NoStaticExceptFinalRule())
            .with(new NoNestedClassRule())
            .with(new SetterTester())
            .with(new GetterTester())
            .build();
    validator.validate(DOMAIN_PACKAGE, new FilterPackageInfo());
}
 

开发者ID:hortonworks,
项目名称:cloudbreak,
代码行数:13,
代码来源:ModelTest.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)