本文整理汇总了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;
}
示例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);
}
}
}
示例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;
}
示例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;
}
示例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;
}