Java 类org.jsonschema2pojo.NoopAnnotator 实例源码
项目:GitHub
文件:Jsonschema2PojoMojo.java
@Override
@SuppressWarnings("unchecked")
public Class<? extends Annotator> getCustomAnnotator() {
if (isNotBlank(customAnnotator)) {
try {
return (Class<? extends Annotator>) Class.forName(customAnnotator);
} catch (ClassNotFoundException e) {
throw new IllegalArgumentException(e);
}
} else {
return NoopAnnotator.class;
}
}
项目:GitHub
文件:Jsonschema2PojoTask.java
/**
* Sets the 'customAnnotator' property of this class
*
* @param customAnnotator
* A custom annotator to use to annotate the generated types
*/
@SuppressWarnings("unchecked")
public void setCustomAnnotator(String customAnnotator) {
if (isNotBlank(customAnnotator)) {
try {
this.customAnnotator = (Class<? extends Annotator>) Class.forName(customAnnotator);
} catch (ClassNotFoundException e) {
throw new IllegalArgumentException(e);
}
} else {
this.customAnnotator = NoopAnnotator.class;
}
}
项目:GitHub
文件:RuleFactoryImplTest.java
@Test
public void generationConfigIsReturned() {
GenerationConfig mockGenerationConfig = mock(GenerationConfig.class);
RuleFactory ruleFactory = new RuleFactory(mockGenerationConfig, new NoopAnnotator(), new SchemaStore());
assertThat(ruleFactory.getGenerationConfig(), is(sameInstance(mockGenerationConfig)));
}
项目:GitHub
文件:RuleFactoryImplTest.java
@Test
public void schemaStoreIsReturned() {
SchemaStore mockSchemaStore = mock(SchemaStore.class);
RuleFactory ruleFactory = new RuleFactory(new DefaultGenerationConfig(), new NoopAnnotator(), mockSchemaStore);
assertThat(ruleFactory.getSchemaStore(), is(sameInstance(mockSchemaStore)));
}