本文整理汇总了Java中org.apache.ivy.core.module.descriptor.ModuleDescriptor.getHomePage方法的典型用法代码示例。如果您正苦于以下问题:Java ModuleDescriptor.getHomePage方法的具体用法?Java ModuleDescriptor.getHomePage怎么用?Java ModuleDescriptor.getHomePage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.ivy.core.module.descriptor.ModuleDescriptor
的用法示例。
在下文中一共展示了ModuleDescriptor.getHomePage方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setModuleVariables
import org.apache.ivy.core.module.descriptor.ModuleDescriptor; //导入方法依赖的package包/类
private static void setModuleVariables(ModuleDescriptor md, IvyVariableContainer variables,
PomWriterOptions options) {
ModuleRevisionId mrid = md.getModuleRevisionId();
variables.setVariable("ivy.pom.groupId", mrid.getOrganisation(), true);
String artifactId = options.getArtifactName();
if (artifactId == null) {
artifactId = mrid.getName();
}
String packaging = options.getArtifactPackaging();
if (packaging == null) {
// find artifact to determine the packaging
Artifact artifact = findArtifact(md, artifactId);
if (artifact == null) {
// no suitable artifact found, default to 'pom'
packaging = "pom";
} else {
packaging = artifact.getType();
}
}
variables.setVariable("ivy.pom.artifactId", artifactId, true);
variables.setVariable("ivy.pom.packaging", packaging, true);
if (mrid.getRevision() != null) {
variables.setVariable("ivy.pom.version", mrid.getRevision(), true);
}
if (options.getDescription() != null) {
variables.setVariable("ivy.pom.description", options.getDescription(), true);
} else if (!isNullOrEmpty(md.getDescription())) {
variables.setVariable("ivy.pom.description", md.getDescription(), true);
}
if (md.getHomePage() != null) {
variables.setVariable("ivy.pom.url", md.getHomePage(), true);
}
}
示例2: printInfoTag
import org.apache.ivy.core.module.descriptor.ModuleDescriptor; //导入方法依赖的package包/类
private static void printInfoTag(ModuleDescriptor md, PrintWriter out) {
out.println("\t<info organisation=\""
+ XMLHelper.escape(md.getModuleRevisionId().getOrganisation()) + "\"");
out.println("\t\tmodule=\"" + XMLHelper.escape(md.getModuleRevisionId().getName()) + "\"");
String branch = md.getResolvedModuleRevisionId().getBranch();
if (branch != null) {
out.println("\t\tbranch=\"" + XMLHelper.escape(branch) + "\"");
}
String revision = md.getResolvedModuleRevisionId().getRevision();
if (revision != null) {
out.println("\t\trevision=\"" + XMLHelper.escape(revision) + "\"");
}
out.println("\t\tstatus=\"" + XMLHelper.escape(md.getStatus()) + "\"");
out.println("\t\tpublication=\"" + DateUtil.format(md.getResolvedPublicationDate()) + "\"");
if (md.isDefault()) {
out.println("\t\tdefault=\"true\"");
}
if (md instanceof DefaultModuleDescriptor) {
DefaultModuleDescriptor dmd = (DefaultModuleDescriptor) md;
if (dmd.getNamespace() != null && !dmd.getNamespace().getName().equals("system")) {
out.println("\t\tnamespace=\"" + XMLHelper.escape(dmd.getNamespace().getName())
+ "\"");
}
}
if (!md.getExtraAttributes().isEmpty()) {
printExtraAttributes(md, out, "\t\t");
out.println();
}
if (requireInnerInfoElement(md)) {
out.println("\t>");
for (ExtendsDescriptor parent : md.getInheritedDescriptors()) {
ModuleRevisionId mrid = parent.getParentRevisionId();
out.print(String.format("\t\t<extends organisation=\"%s\" module=\"%s\" revision=\"%s\"",
XMLHelper.escape(mrid.getOrganisation()),
XMLHelper.escape(mrid.getName()),
XMLHelper.escape(mrid.getRevision())));
String location = parent.getLocation();
if (location != null) {
out.print(" location=\"" + XMLHelper.escape(location) + "\"");
}
out.print(" extendType=\"" + joinArray(parent.getExtendsTypes(), ",") + "\"");
out.println("/>");
}
License[] licenses = md.getLicenses();
for (License license : licenses) {
out.print("\t\t<license ");
if (license.getName() != null) {
out.print("name=\"" + XMLHelper.escape(license.getName()) + "\" ");
}
if (license.getUrl() != null) {
out.print("url=\"" + XMLHelper.escape(license.getUrl()) + "\" ");
}
out.println("/>");
}
if (md.getHomePage() != null || md.getDescription() != null) {
out.print("\t\t<description");
if (md.getHomePage() != null) {
out.print(" homepage=\"" + XMLHelper.escape(md.getHomePage()) + "\"");
}
if (isNullOrEmpty(md.getDescription())) {
out.println(" />");
} else {
out.println(">");
out.println("\t\t" + XMLHelper.escape(md.getDescription()));
out.println("\t\t</description>");
}
}
for (ExtraInfoHolder extraInfo : md.getExtraInfos()) {
printExtraInfoElement(out, extraInfo, 2);
}
out.println("\t</info>");
} else {
out.println("\t/>");
}
}
示例3: requireInnerInfoElement
import org.apache.ivy.core.module.descriptor.ModuleDescriptor; //导入方法依赖的package包/类
private static boolean requireInnerInfoElement(ModuleDescriptor md) {
return md.getExtraInfos().size() > 0 || md.getHomePage() != null
|| !isNullOrEmpty(md.getDescription())
|| md.getLicenses().length > 0 || md.getInheritedDescriptors().length > 0;
}
示例4: outputRevision
import org.apache.ivy.core.module.descriptor.ModuleDescriptor; //导入方法依赖的package包/类
private void outputRevision(ConfigurationResolveReport report, PrintWriter out,
List<ModuleRevisionId> dependencies, IvyNode dep) {
Map<String, String> extraAttributes;
ModuleDescriptor md = null;
if (dep.getModuleRevision() != null) {
md = dep.getModuleRevision().getDescriptor();
}
StringBuilder details = new StringBuilder();
if (dep.isLoaded()) {
details.append(" status=\"");
details.append(XMLHelper.escape(dep.getDescriptor().getStatus()));
details.append("\" pubdate=\"");
details.append(DateUtil.format(new Date(dep.getPublication())));
details.append("\" resolver=\"");
details.append(XMLHelper.escape(dep.getModuleRevision().getResolver().getName()));
details.append("\" artresolver=\"");
details.append(XMLHelper
.escape(dep.getModuleRevision().getArtifactResolver().getName()));
details.append("\"");
}
if (dep.isEvicted(report.getConfiguration())) {
EvictionData ed = dep.getEvictedData(report.getConfiguration());
if (ed.getConflictManager() != null) {
details.append(" evicted=\"")
.append(XMLHelper.escape(ed.getConflictManager().toString())).append("\"");
} else {
details.append(" evicted=\"transitive\"");
}
details.append(" evicted-reason=\"")
.append(XMLHelper.escape(ed.getDetail() == null ? "" : ed.getDetail()))
.append("\"");
}
if (dep.hasProblem()) {
details.append(" error=\"").append(XMLHelper.escape(dep.getProblem().getMessage()))
.append("\"");
}
if (md != null && md.getHomePage() != null) {
details.append(" homepage=\"").append(XMLHelper.escape(md.getHomePage())).append("\"");
}
extraAttributes = (md != null) ? md.getExtraAttributes() : dep.getResolvedId()
.getExtraAttributes();
details.append(extraToString(extraAttributes, SEPARATOR));
out.println(String.format("\t\t\t<revision name=\"%s\"%s%s downloaded=\"%s\" searched=\"%s\"%s conf=\"%s\" position=\"%d\">",
XMLHelper.escape(dep.getResolvedId().getRevision()),
(dep.getResolvedId().getBranch() == null) ? "" : " branch=\""
+ XMLHelper.escape(dep.getResolvedId().getBranch()) + "\"",
details, dep.isDownloaded(), dep.isSearched(),
(dep.getDescriptor() == null) ? "" : " default=\""
+ dep.getDescriptor().isDefault() + "\"",
XMLHelper.escape(joinArray(dep.getConfigurations(report.getConfiguration()), ", ")),
dependencies.indexOf(dep.getResolvedId())));
if (md != null) {
License[] licenses = md.getLicenses();
for (License license : licenses) {
out.println(String.format("\t\t\t\t<license name=\"%s\"%s/>",
XMLHelper.escape(license.getName()),
license.getUrl() == null ? "" : " url=\"" + XMLHelper.escape(license.getUrl()) + "\""));
}
}
outputMetadataArtifact(out, dep);
outputEvictionInformation(report, out, dep);
outputCallers(report, out, dep);
outputArtifacts(report, out, dep);
out.println("\t\t\t</revision>");
}
示例5: ouputRevision
import org.apache.ivy.core.module.descriptor.ModuleDescriptor; //导入方法依赖的package包/类
private void ouputRevision(ConfigurationResolveReport report, PrintWriter out, List<?> dependencies, IvyNode dep) {
Map<?, ?> extraAttributes;
ModuleDescriptor md = null;
if (dep.getModuleRevision() != null) {
md = dep.getModuleRevision().getDescriptor();
}
StringBuilder details = new StringBuilder();
if (dep.isLoaded()) {
details.append(" status=\"");
details.append(XMLHelper.escape(dep.getDescriptor().getStatus()));
details.append("\" pubdate=\"");
details.append(DateUtil.format(new Date(dep.getPublication())));
details.append("\" resolver=\"");
details.append(XMLHelper.escape(dep.getModuleRevision().getResolver().getName()));
details.append("\" artresolver=\"");
details.append(XMLHelper.escape(dep.getModuleRevision().getArtifactResolver().getName()));
details.append("\"");
}
if (dep.isEvicted(report.getConfiguration())) {
EvictionData ed = dep.getEvictedData(report.getConfiguration());
if (ed.getConflictManager() != null) {
details.append(" evicted=\"").append(XMLHelper.escape(ed.getConflictManager().toString())).append("\"");
} else {
details.append(" evicted=\"transitive\"");
}
details.append(" evicted-reason=\"").append(XMLHelper.escape(ed.getDetail() == null ? "" : ed.getDetail()))
.append("\"");
}
if (dep.hasProblem()) {
details.append(" error=\"").append(XMLHelper.escape(dep.getProblem().getMessage())).append("\"");
}
if (md != null && md.getHomePage() != null) {
details.append(" homepage=\"").append(XMLHelper.escape(md.getHomePage())).append("\"");
}
extraAttributes = md != null ? md.getExtraAttributes() : dep.getResolvedId().getExtraAttributes();
for (Entry<?, ?> entry1 : extraAttributes.entrySet()) {
Entry<String, Object> entry = (Entry<String, Object>) entry1;
details.append(" extra-").append(entry.getKey()).append("=\"")
.append(XMLHelper.escape(entry.getValue().toString())).append("\"");
}
String defaultValue = dep.getDescriptor() != null ? " default=\"" + dep.getDescriptor().isDefault() + "\"" : "";
int position = dependencies.indexOf(dep.getResolvedId());
out.println("\t\t\t<revision name=\""
+ XMLHelper.escape(dep.getResolvedId().getRevision())
+ "\""
+ (dep.getResolvedId().getBranch() == null ? "" : " branch=\""
+ XMLHelper.escape(dep.getResolvedId().getBranch()) + "\"") + details + " downloaded=\""
+ dep.isDownloaded() + "\"" + " searched=\"" + dep.isSearched() + "\"" + defaultValue + " conf=\""
+ toString(dep.getConfigurations(report.getConfiguration())) + "\"" + " position=\"" + position + "\">");
if (md != null) {
License[] licenses = md.getLicenses();
for (License license : licenses) {
String lurl;
if (license.getUrl() != null) {
lurl = " url=\"" + XMLHelper.escape(license.getUrl()) + "\"";
} else {
lurl = "";
}
out.println("\t\t\t\t<license name=\"" + XMLHelper.escape(license.getName()) + "\"" + lurl + "/>");
}
}
outputMetadataArtifact(out, dep);
outputEvictionInformation(report, out, dep);
outputCallers(report, out, dep);
outputArtifacts(report, out, dep);
out.println("\t\t\t</revision>");
}