本文整理汇总了Java中org.apache.ivy.core.module.descriptor.DefaultModuleDescriptor.getNamespace方法的典型用法代码示例。如果您正苦于以下问题:Java DefaultModuleDescriptor.getNamespace方法的具体用法?Java DefaultModuleDescriptor.getNamespace怎么用?Java DefaultModuleDescriptor.getNamespace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.ivy.core.module.descriptor.DefaultModuleDescriptor
的用法示例。
在下文中一共展示了DefaultModuleDescriptor.getNamespace方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: mergeInfo
import org.apache.ivy.core.module.descriptor.DefaultModuleDescriptor; //导入方法依赖的package包/类
private void mergeInfo(ModuleDescriptor parent) {
ModuleRevisionId parentMrid = parent.getModuleRevisionId();
DefaultModuleDescriptor descriptor = getMd();
ModuleRevisionId currentMrid = descriptor.getModuleRevisionId();
ModuleRevisionId mergedMrid = createModuleRevisionId(
mergeValue(parentMrid.getOrganisation(), currentMrid.getOrganisation()),
currentMrid.getName(),
mergeValue(parentMrid.getBranch(), currentMrid.getBranch()),
mergeValue(parentMrid.getRevision(), currentMrid.getRevision()),
mergeValues(parentMrid.getQualifiedExtraAttributes(), currentMrid.getQualifiedExtraAttributes())
);
descriptor.setModuleRevisionId(mergedMrid);
descriptor.setResolvedModuleRevisionId(mergedMrid);
descriptor.setStatus(mergeValue(parent.getStatus(), descriptor.getStatus()));
if (descriptor.getNamespace() == null && parent instanceof DefaultModuleDescriptor) {
Namespace parentNamespace = ((DefaultModuleDescriptor) parent).getNamespace();
descriptor.setNamespace(parentNamespace);
}
}
示例2: mergeInfo
import org.apache.ivy.core.module.descriptor.DefaultModuleDescriptor; //导入方法依赖的package包/类
/**
* Explain how to inherit metadata related to info element
*
* @param parent
* a given parent module descriptor
*/
protected void mergeInfo(ModuleDescriptor parent) {
ModuleRevisionId parentMrid = parent.getModuleRevisionId();
DefaultModuleDescriptor descriptor = getMd();
ModuleRevisionId currentMrid = descriptor.getModuleRevisionId();
ModuleRevisionId mergedMrid = ModuleRevisionId.newInstance(
mergeValue(parentMrid.getOrganisation(), currentMrid.getOrganisation()),
currentMrid.getName(),
mergeValue(parentMrid.getBranch(), currentMrid.getBranch()),
mergeRevisionValue(parentMrid.getRevision(), currentMrid.getRevision()),
mergeValues(parentMrid.getQualifiedExtraAttributes(),
currentMrid.getQualifiedExtraAttributes()));
descriptor.setModuleRevisionId(mergedMrid);
descriptor.setResolvedModuleRevisionId(mergedMrid);
descriptor.setStatus(mergeValue(parent.getStatus(), descriptor.getStatus()));
if (descriptor.getNamespace() == null && parent instanceof DefaultModuleDescriptor) {
Namespace parentNamespace = ((DefaultModuleDescriptor) parent).getNamespace();
descriptor.setNamespace(parentNamespace);
}
descriptor.getExtraInfos().addAll(parent.getExtraInfos());
}
示例3: toIvyFile
import org.apache.ivy.core.module.descriptor.DefaultModuleDescriptor; //导入方法依赖的package包/类
public void toIvyFile(InputStream is, Resource res, File destFile, ModuleDescriptor md)
throws IOException, ParseException {
try {
Namespace ns = null;
if (md instanceof DefaultModuleDescriptor) {
DefaultModuleDescriptor dmd = (DefaultModuleDescriptor) md;
ns = dmd.getNamespace();
}
XmlModuleDescriptorUpdater.update(
is,
res,
destFile,
new UpdateOptions().setSettings(IvyContext.getContext().getSettings())
.setStatus(md.getStatus())
.setRevision(md.getResolvedModuleRevisionId().getRevision())
.setPubdate(md.getResolvedPublicationDate()).setUpdateBranch(false)
.setNamespace(ns));
} catch (SAXException e) {
ParseException pe = new ParseException("exception occurred while parsing " + res, 0);
pe.initCause(e);
throw pe;
} finally {
if (is != null) {
is.close();
}
}
}
示例4: printInfoTag
import org.apache.ivy.core.module.descriptor.DefaultModuleDescriptor; //导入方法依赖的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/>");
}
}