• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Annotator类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: getCustomAnnotator

import org.jsonschema2pojo.Annotator; //导入依赖的package包/类
@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;
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:14,代码来源:Jsonschema2PojoMojo.java


示例2: setCustomAnnotator

import org.jsonschema2pojo.Annotator; //导入依赖的package包/类
/**
 * 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;
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:19,代码来源:Jsonschema2PojoTask.java


示例3: classIsCreatedFromFullyQualifiedClassName

import org.jsonschema2pojo.Annotator; //导入依赖的package包/类
@Test
@SuppressWarnings("unchecked")
public void classIsCreatedFromFullyQualifiedClassName() {
    Class<Annotator> clazz = converter.convert(Annotator.class.getName());

    assertThat(clazz, is(equalTo(Annotator.class)));
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:8,代码来源:ClassConverterTest.java


示例4: getAnnotator

import org.jsonschema2pojo.Annotator; //导入依赖的package包/类
/**
 *
 * @param config
 * @return
 */
private static Annotator getAnnotator(GenerationConfig config) {
    Annotator coreAnnotator = new AnnotatorFactory().getAnnotator(config.getAnnotationStyle());
    if(config.getCustomAnnotator() != null){
        Annotator customAnnotator = new AnnotatorFactory().getAnnotator(config.getCustomAnnotator());
        return new CompositeAnnotator(coreAnnotator, customAnnotator);
    }
    return coreAnnotator;
}
 
开发者ID:OnPositive,项目名称:aml,代码行数:14,代码来源:Context.java


示例5: getAnnotator

import org.jsonschema2pojo.Annotator; //导入依赖的package包/类
private Annotator getAnnotator() {
	ArrayList<Annotator> annotators = new ArrayList<>();
	if (config.isGsonSupport()) {
		annotators.add(new GsonAnnotator());
	}
	if (config.isJacksonSupport()) {
		annotators.add(new Jackson2Annotator());
	}
	CompositeAnnotator ac = new CompositeAnnotator(annotators.toArray(new Annotator[annotators.size()]));
	return ac;
}
 
开发者ID:OnPositive,项目名称:aml,代码行数:12,代码来源:JavaWriter.java


示例6: generateModelSources

import org.jsonschema2pojo.Annotator; //导入依赖的package包/类
private void generateModelSources(JCodeModel codeModel, ApiBodyMetadata body, File rootDir, GenerationConfig config, Annotator annotator) {
    boolean build = false;
    if (codeModel == null) {
        this.getLog().info("Generating Model object for: " + body.getName());
        build = true;
        if (config == null && annotator == null) {
            codeModel = body.getCodeModel();
        } else {
            codeModel = body.getCodeModel(resolvedSchemaLocation, basePackage + NamingHelper.getDefaultModelPackage(), config, annotator);
        }
    }
    if (build && codeModel != null) {
        buildCodeModelToDisk(codeModel, body.getName(), rootDir);
    }
}
 
开发者ID:phoenixnap,项目名称:springmvc-raml-plugin,代码行数:16,代码来源:SpringMvcEndpointGeneratorMojo.java


示例7: getCustomAnnotator

import org.jsonschema2pojo.Annotator; //导入依赖的package包/类
@Override
public Class<? extends Annotator> getCustomAnnotator() {
    return customAnnotator;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:5,代码来源:Jsonschema2PojoTask.java


示例8: APXCustomRuleFactory

import org.jsonschema2pojo.Annotator; //导入依赖的package包/类
public APXCustomRuleFactory(GenerationConfig generationConfig, Annotator annotator, SchemaStore schemaStore) {
    super(generationConfig, annotator, schemaStore);
}
 
开发者ID:othreecodes,项目名称:APX,代码行数:4,代码来源:APXCustomRuleFactory.java


示例9: requireAnnotator

import org.jsonschema2pojo.Annotator; //导入依赖的package包/类
private static Annotator requireAnnotator(AnnotationStyle annotationStyle) {
    checkState(ANNOTATOR_SUPPLIER_INDEX.containsKey(annotationStyle), "Illegal annotation style: %s", annotationStyle);
    return ANNOTATOR_SUPPLIER_INDEX.get(annotationStyle).get();
}
 
开发者ID:hubrick,项目名称:raml-maven-plugin,代码行数:5,代码来源:AbstractSpringWebMojo.java


示例10: RuleFactory

import org.jsonschema2pojo.Annotator; //导入依赖的package包/类
/**
 * Create a new rule factory with the given generation config options.
 *
 * @param generationConfig
 *            The generation config options for type generation. These
 *            config options will influence the java code generated by rules
 *            created by this factory.
 * @param annotator
 *            the annotator used to mark up Java types with any annotations
 *            that are required to build JSON compatible types
 * @param schemaStore
 *            the object used by this factory to get and store schemas
 */
public RuleFactory(GenerationConfig generationConfig, Annotator annotator, SchemaStore schemaStore) {
    this.generationConfig = generationConfig;
    this.annotator = annotator;
    this.schemaStore = schemaStore;
    this.nameHelper = new NameHelper(generationConfig);
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:20,代码来源:RuleFactory.java


示例11: getCodeModel

import org.jsonschema2pojo.Annotator; //导入依赖的package包/类
/**
 * Builds a JCodeModel for this body
 *
 * @param basePackage The package we will be using for the domain objects
 * @param schemaLocation The location of this schema, will be used to create absolute URIs for $ref tags eg "classpath:/"
 * @param config JsonSchema2Pojo configuration. if null a default config will be used
 * @param annotator JsonSchema2Pojo annotator. if null a default annotator will be used
 * @return built JCodeModel
 */
public JCodeModel getCodeModel(String basePackage, String schemaLocation, GenerationConfig config, Annotator annotator) {
	if (type != null) {
		return codeModel;
	} else {
		return SchemaHelper.buildBodyJCodeModel(schemaLocation, basePackage, name, schema, config, annotator);
	}
}
 
开发者ID:phoenixnap,项目名称:springmvc-raml-plugin,代码行数:17,代码来源:ApiBodyMetadata.java


示例12: getAnnotator

import org.jsonschema2pojo.Annotator; //导入依赖的package包/类
/**
 * Gets the annotator that will in apply annotations to the generated code
 * to allow correct serialization and deserialization, according to the
 * chosen annotation style.
 *
 * @return an annotator that can annotate various code constructs for JSON
 *         support
 */
public Annotator getAnnotator() {
    return annotator;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:12,代码来源:RuleFactory.java


示例13: setAnnotator

import org.jsonschema2pojo.Annotator; //导入依赖的package包/类
/**
 * The annotator used to mark up Java types with any annotations that are
 * required to build JSON compatible types
 *
 * @param annotator
 *            the annotator
 */
public void setAnnotator(final Annotator annotator) {
    this.annotator = annotator;
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:11,代码来源:RuleFactory.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java HotRodServer类代码示例发布时间:2022-05-22
下一篇:
Java TripleSource类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap