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


Java ClassName.reflectionName方法代码示例

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


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

示例1: putType

import com.squareup.javapoet.ClassName; //导入方法依赖的package包/类
/**
 * Adds a {@link TypeSpec} to the set of files that will be generated at the end of the build pipeline.
 * The {@link TypeSpec} will be put into the file under the qualified name {@code pkgName}.
 * Will also add a service entry in each of the service classes listed in {@code providesServicesFor}
 * @param pkgName The fully qualified name of the type to be created.
 * @param newType the new type to be created at the end of the pipeline.
 * @param providesServicesFor A list of classes that the given type provides the service for.
 */
public void putType(String pkgName, TypeSpec newType, List<ClassName> providesServicesFor) {

    // This prevents us from opening the same file twice with the filer
    // as well as letting the user know that the generated two files with the same name
    addToMultiMap(outputClasses, pkgName, newType, "Attempted to generate 2 classes with the same name: ");

    if (!providesServicesFor.isEmpty()) {
        for (ClassName serviceInterface : providesServicesFor) {
            String interfaceQName = serviceInterface.reflectionName();
            // Here it is ok to have dups (but won't happen because of the same call above)
            addToMultiMap(serviceProviders, interfaceQName, pkgName + "." + newType.name, null);
        }
    }
}
 
开发者ID:c0d3d,项目名称:easy-plugins,代码行数:23,代码来源:ProcessorOutputCollection.java


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