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


Java ModuleDescriptor类代码示例

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


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

示例1: getDependencies

import org.jboss.shrinkwrap.descriptor.api.jbossmodule13.ModuleDescriptor; //导入依赖的package包/类
public List<ArtifactSpec> getDependencies() {
    if (this.module == null) {
        return Collections.emptyList();
    }

    List<ArtifactType<ResourcesType<ModuleDescriptor>>> artifacts = this.module.getOrCreateResources().getAllArtifact();

    List<ArtifactSpec> dependencies = new ArrayList<>();

    String localRepo = System.getProperty("maven.repo.local", DEFAULT_LOCAL_REPO);

    for (ArtifactType<ResourcesType<ModuleDescriptor>> artifact : artifacts) {
        ArtifactSpec dep = ArtifactSpec.fromMscGav(artifact.getName());

        File file = Paths.get(localRepo, dep.jarRepoPath()).toFile();
        if (!file.exists()) {
            dep.shouldGather = true;
        } else {
            dep.file = file;
            dep.shouldGather = false;
        }
        dependencies.add(dep);
    }

    return dependencies;
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:27,代码来源:ModuleAnalyzer.java

示例2: rewrite

import org.jboss.shrinkwrap.descriptor.api.jbossmodule13.ModuleDescriptor; //导入依赖的package包/类
@Override
public void rewrite(ModuleDescriptor desc) {
    List<ModuleDependencyType<DependenciesType<ModuleDescriptor>>> deps = desc.getOrCreateDependencies().getAllModule();
    for (ModuleDependencyType<DependenciesType<ModuleDescriptor>> each : deps) {
        String depName = each.getName();
        String depSlot = each.getSlot();

        if (depSlot == null) {
            depSlot = "main";
        }

        if (depName.equals(this.name) && depSlot.equals(this.slot)) {
            each.optional(true);
        }
    }
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm-fraction-plugin,代码行数:17,代码来源:ModuleRewriteRules.java

示例3: getDependencies

import org.jboss.shrinkwrap.descriptor.api.jbossmodule13.ModuleDescriptor; //导入依赖的package包/类
public List<DependencyMetadata> getDependencies() {
    if (this.module == null) {
        return Collections.emptyList();
    }

    List<ArtifactType<ResourcesType<ModuleDescriptor>>> artifacts = this.module.getOrCreateResources().getAllArtifact();

    List<DependencyMetadata> dependencies = new ArrayList<>();

    for (ArtifactType<ResourcesType<ModuleDescriptor>> artifact : artifacts) {
        String name = artifact.getName();
        if (!name.contains("$")) {
            DependencyMetadata dep = DependencyMetadata.fromMscGav(artifact.getName());
            dependencies.add(dep);
        }
    }

    return dependencies;
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm-fraction-plugin,代码行数:20,代码来源:ModuleAnalyzer.java

示例4: rewrite

import org.jboss.shrinkwrap.descriptor.api.jbossmodule13.ModuleDescriptor; //导入依赖的package包/类
ModuleDescriptor rewrite(ModuleDescriptor desc) {
    String descName = desc.getName();
    String descSlot = desc.getSlot();

    if (descSlot == null) {
        descSlot = MAIN;
    }

    ModuleRewriteRules rules = this.rules.get(descName + ":" + descSlot);
    if (rules != null) {
        desc = rules.rewrite(desc);
    }

    ModuleRewriteRules all = this.rules.get("ALL:ALL");

    if (all != null) {
        desc = all.rewrite(desc);
    }

    return desc;


}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm-fraction-plugin,代码行数:24,代码来源:ModuleRewriteConf.java

示例5: getDependencies

import org.jboss.shrinkwrap.descriptor.api.jbossmodule13.ModuleDescriptor; //导入依赖的package包/类
public List<ArtifactSpec> getDependencies() {
    if (this.module == null) {
        return Collections.emptyList();
    }

    List<ArtifactType<ResourcesType<ModuleDescriptor>>> artifacts = this.module.getOrCreateResources().getAllArtifact();

    List<ArtifactSpec> dependencies = new ArrayList<>();

    for (ArtifactType<ResourcesType<ModuleDescriptor>> artifact : artifacts) {
        ArtifactSpec dep = ArtifactSpec.fromMscGav(artifact.getName());
        dep.shouldGather = true;
        dependencies.add(dep);
    }

    return dependencies;
}
 
开发者ID:wildfly-swarm-archive,项目名称:ARCHIVE-wildfly-swarm,代码行数:18,代码来源:ModuleAnalyzer.java


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