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


Java ModuleRevisionId.getBranch方法代码示例

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


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

示例1: printDependency

import org.apache.ivy.core.module.id.ModuleRevisionId; //导入方法依赖的package包/类
protected void printDependency(ModuleDescriptor md, DependencyDescriptor dep,
                                      SimpleXmlWriter writer) throws IOException {
    writer.startElement("dependency");

    ModuleRevisionId dependencyRevisionId = dep.getDependencyRevisionId();
    writer.attribute("org", dependencyRevisionId.getOrganisation());
    writer.attribute("name", dependencyRevisionId.getName());
    if (dependencyRevisionId.getBranch() != null) {
        writer.attribute("branch", dependencyRevisionId.getBranch());
    }
    writer.attribute("rev", dependencyRevisionId.getRevision());
    if (!dep.getDynamicConstraintDependencyRevisionId().equals(dependencyRevisionId)) {
        if (dep.getDynamicConstraintDependencyRevisionId().getBranch() != null) {
            writer.attribute("branchConstraint", dep.getDynamicConstraintDependencyRevisionId().getBranch());
        }
        writer.attribute("revConstraint", dep.getDynamicConstraintDependencyRevisionId().getRevision());
    }
    if (dep.isForce()) {
        writer.attribute("force", "true");
    }
    if (dep.isChanging()) {
        writer.attribute("changing", "true");
    }
    if (!dep.isTransitive()) {
        writer.attribute("transitive", "false");
    }
    writer.attribute("conf", getConfMapping(dep));

    printExtraAttributes(dep, writer);

    DependencyArtifactDescriptor[] depArtifacts = dep.getAllDependencyArtifacts();
    printDependencyArtefacts(md, writer, depArtifacts);

    IncludeRule[] includes = dep.getAllIncludeRules();
    printDependencyIncludeRules(md, writer, includes);

    ExcludeRule[] excludes = dep.getAllExcludeRules();
    printDependencyExcludeRules(md, writer, excludes);

    writer.endElement();
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:42,代码来源:IvyXmlModuleDescriptorWriter.java

示例2: printInfoTag

import org.apache.ivy.core.module.id.ModuleRevisionId; //导入方法依赖的package包/类
private static void printInfoTag(ModuleDescriptor md, SimpleXmlWriter writer) throws IOException {
    ModuleRevisionId moduleRevisionId = md.getModuleRevisionId();
    writer.startElement("info");

    writer.attribute("organisation", moduleRevisionId.getOrganisation());
    writer.attribute("module", moduleRevisionId.getName());

    ModuleRevisionId resolvedModuleRevisionId = md.getResolvedModuleRevisionId();
    String branch = resolvedModuleRevisionId.getBranch();
    if (branch != null) {
        writer.attribute("branch", branch);
    }
    String revision = resolvedModuleRevisionId.getRevision();
    if (revision != null) {
        writer.attribute("revision", revision);
    }
    writer.attribute("status", md.getStatus());

    SimpleDateFormat ivyDateFormat = new SimpleDateFormat(IVY_DATE_PATTERN);
    writer.attribute("publication", ivyDateFormat.format(md.getResolvedPublicationDate()));
    if (md.isDefault()) {
        writer.attribute("default", "true");
    }
    if (md instanceof DefaultModuleDescriptor) {
        DefaultModuleDescriptor dmd = (DefaultModuleDescriptor) md;
        if (dmd.getNamespace() != null && !dmd.getNamespace().getName().equals("system")) {
            writer.attribute("namespace", dmd.getNamespace().getName());
        }
    }
    if (!md.getExtraAttributes().isEmpty()) {
        printExtraAttributes(md, writer);
    }

    ExtendsDescriptor[] parents = md.getInheritedDescriptors();
    if (parents.length != 0) {
        throw new UnsupportedOperationException("Extends descriptors not supported.");
    }

    License[] licenses = md.getLicenses();
    for (int i = 0; i < licenses.length; i++) {
        License license = licenses[i];
        writer.startElement("license");
        if (license.getName() != null) {
            writer.attribute("name", license.getName());
        }
        if (license.getUrl() != null) {
            writer.attribute("url", license.getUrl());
        }
        writer.endElement();
    }

    if (md.getHomePage() != null || md.getDescription() != null) {
        writer.startElement("description");
        if (md.getHomePage() != null) {
            writer.attribute("homepage", md.getHomePage());
        }
        if (md.getDescription() != null && md.getDescription().trim().length() > 0) {
            writer.characters(md.getDescription());
        }
        writer.endElement();
    }

    for (Iterator it = md.getExtraInfo().entrySet().iterator(); it.hasNext();) {
        Map.Entry extraDescr = (Map.Entry) it.next();
        if (extraDescr.getValue() == null || ((String) extraDescr.getValue()).length() == 0) {
            continue;
        }
        writer.startElement(extraDescr.getKey().toString());
        writer.characters(extraDescr.getValue().toString());
        writer.endElement();
    }

    writer.endElement();
}
 
开发者ID:Pushjet,项目名称:Pushjet-Android,代码行数:75,代码来源:IvyXmlModuleDescriptorWriter.java


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