本文整理了Java中aQute.bnd.osgi.Analyzer.cleanupVersion()
方法的一些代码示例,展示了Analyzer.cleanupVersion()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Analyzer.cleanupVersion()
方法的具体详情如下:
包路径:aQute.bnd.osgi.Analyzer
类名称:Analyzer
方法名:cleanupVersion
暂无
代码示例来源:origin: biz.aQute/bndlib
private Object toBsn(NodeList set) throws XPathExpressionException {
XPath xpath = xpathf.newXPath();
StringBuilder sb = new StringBuilder();
String del = "";
for (int i = 0; i < set.getLength(); i++) {
Node child = set.item(i);
String version = xpath.evaluate("version", child);
sb.append(del);
sb.append(xpath.evaluate("groupId", child));
sb.append(".");
sb.append(xpath.evaluate("artifactId", child));
if (version != null && version.trim().length() != 0) {
sb.append(";version=");
sb.append(Analyzer.cleanupVersion(version));
}
del = ", ";
}
return sb.toString();
}
代码示例来源:origin: biz.aQute.bnd/bnd
private Object toBsn(NodeList set) throws XPathExpressionException {
XPath xpath = xpathf.newXPath();
StringBuilder sb = new StringBuilder();
String del = "";
for (int i = 0; i < set.getLength(); i++) {
Node child = set.item(i);
String version = xpath.evaluate("version", child);
sb.append(del);
sb.append(xpath.evaluate("groupId", child));
sb.append(".");
sb.append(xpath.evaluate("artifactId", child));
if (version != null && version.trim().length() != 0) {
sb.append(";version=");
sb.append(Analyzer.cleanupVersion(version));
}
del = ", ";
}
return sb.toString();
}
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib
private Object toBsn(NodeList set) throws XPathExpressionException {
XPath xpath = xpathf.newXPath();
StringBuilder sb = new StringBuilder();
String del = "";
for (int i = 0; i < set.getLength(); i++) {
Node child = set.item(i);
String version = xpath.evaluate("version", child);
sb.append(del);
sb.append(xpath.evaluate("groupId", child));
sb.append(".");
sb.append(xpath.evaluate("artifactId", child));
if (version != null && version.trim()
.length() != 0) {
sb.append(";version=");
sb.append(Analyzer.cleanupVersion(version));
}
del = ", ";
}
return sb.toString();
}
代码示例来源:origin: biz.aQute.bnd/bndlib
private Object toBsn(NodeList set) throws XPathExpressionException {
XPath xpath = xpathf.newXPath();
StringBuilder sb = new StringBuilder();
String del = "";
for (int i = 0; i < set.getLength(); i++) {
Node child = set.item(i);
String version = xpath.evaluate("version", child);
sb.append(del);
sb.append(xpath.evaluate("groupId", child));
sb.append(".");
sb.append(xpath.evaluate("artifactId", child));
if (version != null && version.trim().length() != 0) {
sb.append(";version=");
sb.append(Analyzer.cleanupVersion(version));
}
del = ", ";
}
return sb.toString();
}
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd
private Object toBsn(NodeList set) throws XPathExpressionException {
XPath xpath = xpathf.newXPath();
StringBuilder sb = new StringBuilder();
String del = "";
for (int i = 0; i < set.getLength(); i++) {
Node child = set.item(i);
String version = xpath.evaluate("version", child);
sb.append(del);
sb.append(xpath.evaluate("groupId", child));
sb.append(".");
sb.append(xpath.evaluate("artifactId", child));
if (version != null && version.trim()
.length() != 0) {
sb.append(";version=");
sb.append(Analyzer.cleanupVersion(version));
}
del = ", ";
}
return sb.toString();
}
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib
@Override
public SortedSet<Version> versions(String bsn) throws Exception {
File files[] = get(bsn, null);
List<Version> versions = new ArrayList<>();
for (File f : files) {
String version = f.getParentFile()
.getName();
version = Analyzer.cleanupVersion(version);
Version v = new Version(version);
versions.add(v);
}
if (versions.isEmpty())
return SortedList.empty();
return new SortedList<>(versions);
}
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd
@Override
public SortedSet<Version> versions(String bsn) throws Exception {
File files[] = get(bsn, null);
List<Version> versions = new ArrayList<>();
for (File f : files) {
String version = f.getParentFile()
.getName();
version = Analyzer.cleanupVersion(version);
Version v = new Version(version);
versions.add(v);
}
if (versions.isEmpty())
return SortedList.empty();
return new SortedList<>(versions);
}
代码示例来源:origin: biz.aQute.bnd/bnd
public Map<String, Version> getVersions() throws Exception {
synchronized (versionMap) {
if (versionMap.isEmpty()) {
for (Builder builder : getSubBuilders()) {
String v = builder.getVersion();
if (v == null)
v = "0";
else {
v = Analyzer.cleanupVersion(v);
if (!Verifier.isVersion(v))
continue; // skip
}
Version version = new Version(v);
versionMap.put(builder.getBsn(), version);
}
}
return new LinkedHashMap<String, Version>(versionMap);
}
}
代码示例来源:origin: biz.aQute.bnd/bndlib
public Map<String, Version> getVersions() throws Exception {
synchronized (versionMap) {
if (versionMap.isEmpty()) {
for (Builder builder : getSubBuilders()) {
String v = builder.getVersion();
if (v == null)
v = "0";
else {
v = Analyzer.cleanupVersion(v);
if (!Verifier.isVersion(v))
continue; // skip
}
Version version = new Version(v);
versionMap.put(builder.getBsn(), version);
}
}
return new LinkedHashMap<String, Version>(versionMap);
}
}
代码示例来源:origin: biz.aQute/bndlib
File[] find(String groupId, String artifactId, VersionRange range) {
String path = groupId.replace(".", "/");
File vsdir = Processor.getFile(root, path);
if (!vsdir.isDirectory())
return null;
vsdir = Processor.getFile(vsdir, artifactId);
List<File> result = new ArrayList<File>();
if (vsdir.isDirectory()) {
String versions[] = vsdir.list();
for (String v : versions) {
String vv = Analyzer.cleanupVersion(v);
if (Verifier.isVersion(vv)) {
Version vvv = new Version(vv);
if (range.includes(vvv)) {
File file = Processor.getFile(vsdir, v + "/" + artifactId + "-" + v + ".jar");
if (file.isFile())
result.add(file);
else
reporter.warning("Expected maven entry was not a valid file %s ", file);
}
} else {
reporter.warning(
"Expected a version directory in maven: dir=%s raw-version=%s cleaned-up-version=%s",
vsdir, vv, v);
}
}
} else
return null;
return result.toArray(new File[result.size()]);
}
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd
File[] find(String groupId, String artifactId, VersionRange range) {
String path = groupId.replace(".", "/");
File vsdir = Processor.getFile(root, path);
if (!vsdir.isDirectory())
return null;
vsdir = Processor.getFile(vsdir, artifactId);
List<File> result = new ArrayList<>();
if (vsdir.isDirectory()) {
String versions[] = vsdir.list();
for (String v : versions) {
String vv = Analyzer.cleanupVersion(v);
if (Verifier.isVersion(vv)) {
Version vvv = new Version(vv);
if (range.includes(vvv)) {
File file = Processor.getFile(vsdir, v + "/" + artifactId + "-" + v + ".jar");
if (file.isFile())
result.add(file);
else
reporter.warning("Expected maven entry was not a valid file %s ", file);
}
} else {
reporter.warning(
"Expected a version directory in maven: dir=%s raw-version=%s cleaned-up-version=%s", vsdir, vv,
v);
}
}
} else
return null;
return result.toArray(new File[0]);
}
代码示例来源:origin: biz.aQute.bnd/bndlib
File[] find(String groupId, String artifactId, VersionRange range) {
String path = groupId.replace(".", "/");
File vsdir = Processor.getFile(root, path);
if (!vsdir.isDirectory())
return null;
vsdir = Processor.getFile(vsdir, artifactId);
List<File> result = new ArrayList<File>();
if (vsdir.isDirectory()) {
String versions[] = vsdir.list();
for (String v : versions) {
String vv = Analyzer.cleanupVersion(v);
if (Verifier.isVersion(vv)) {
Version vvv = new Version(vv);
if (range.includes(vvv)) {
File file = Processor.getFile(vsdir, v + "/" + artifactId + "-" + v + ".jar");
if (file.isFile())
result.add(file);
else
reporter.warning("Expected maven entry was not a valid file %s ", file);
}
} else {
reporter.warning(
"Expected a version directory in maven: dir=%s raw-version=%s cleaned-up-version=%s",
vsdir, vv, v);
}
}
} else
return null;
return result.toArray(new File[result.size()]);
}
代码示例来源:origin: biz.aQute.bnd/bnd
File[] find(String groupId, String artifactId, VersionRange range) {
String path = groupId.replace(".", "/");
File vsdir = Processor.getFile(root, path);
if (!vsdir.isDirectory())
return null;
vsdir = Processor.getFile(vsdir, artifactId);
List<File> result = new ArrayList<File>();
if (vsdir.isDirectory()) {
String versions[] = vsdir.list();
for (String v : versions) {
String vv = Analyzer.cleanupVersion(v);
if (Verifier.isVersion(vv)) {
Version vvv = new Version(vv);
if (range.includes(vvv)) {
File file = Processor.getFile(vsdir, v + "/" + artifactId + "-" + v + ".jar");
if (file.isFile())
result.add(file);
else
reporter.warning("Expected maven entry was not a valid file %s ", file);
}
} else {
reporter.warning(
"Expected a version directory in maven: dir=%s raw-version=%s cleaned-up-version=%s",
vsdir, vv, v);
}
}
} else
return null;
return result.toArray(new File[result.size()]);
}
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib
File[] find(String groupId, String artifactId, VersionRange range) {
String path = groupId.replace(".", "/");
File vsdir = Processor.getFile(root, path);
if (!vsdir.isDirectory())
return null;
vsdir = Processor.getFile(vsdir, artifactId);
List<File> result = new ArrayList<>();
if (vsdir.isDirectory()) {
String versions[] = vsdir.list();
for (String v : versions) {
String vv = Analyzer.cleanupVersion(v);
if (Verifier.isVersion(vv)) {
Version vvv = new Version(vv);
if (range.includes(vvv)) {
File file = Processor.getFile(vsdir, v + "/" + artifactId + "-" + v + ".jar");
if (file.isFile())
result.add(file);
else
reporter.warning("Expected maven entry was not a valid file %s ", file);
}
} else {
reporter.warning(
"Expected a version directory in maven: dir=%s raw-version=%s cleaned-up-version=%s", vsdir, vv,
v);
}
}
} else
return null;
return result.toArray(new File[0]);
}
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib
public Map<String, Version> getVersions() throws Exception {
if (versionMap.isEmpty()) {
try (ProjectBuilder pb = getBuilder(null)) {
for (Builder builder : pb.getSubBuilders()) {
String v = builder.getVersion();
if (v == null)
v = "0";
else {
v = Analyzer.cleanupVersion(v);
if (!Verifier.isVersion(v))
continue; // skip
}
Version version = new Version(v);
versionMap.put(builder.getBsn(), version);
}
}
}
return new LinkedHashMap<>(versionMap);
}
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd
public Map<String, Version> getVersions() throws Exception {
if (versionMap.isEmpty()) {
try (ProjectBuilder pb = getBuilder(null)) {
for (Builder builder : pb.getSubBuilders()) {
String v = builder.getVersion();
if (v == null)
v = "0";
else {
v = Analyzer.cleanupVersion(v);
if (!Verifier.isVersion(v))
continue; // skip
}
Version version = new Version(v);
versionMap.put(builder.getBsn(), version);
}
}
}
return new LinkedHashMap<>(versionMap);
}
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bndlib
String applyVersionPolicy(String exportVersion, String importRange, boolean provider) {
try {
setProperty("@", exportVersion);
if (importRange != null) {
importRange = cleanupVersion(importRange);
importRange = getReplacer().process(importRange);
} else
importRange = getVersionPolicy(provider);
} finally {
unsetProperty("@");
}
return importRange;
}
代码示例来源:origin: biz.aQute.bnd/biz.aQute.bnd
String applyVersionPolicy(String exportVersion, String importRange, boolean provider) {
try {
setProperty("@", exportVersion);
if (importRange != null) {
importRange = cleanupVersion(importRange);
importRange = getReplacer().process(importRange);
} else
importRange = getVersionPolicy(provider);
} finally {
unsetProperty("@");
}
return importRange;
}
代码示例来源:origin: biz.aQute.bnd/bndlib
String applyVersionPolicy(String exportVersion, String importRange, boolean provider) {
try {
setProperty("@", exportVersion);
if (importRange != null) {
importRange = cleanupVersion(importRange);
importRange = getReplacer().process(importRange);
} else
importRange = getVersionPolicy(provider);
}
finally {
unsetProperty("@");
}
return importRange;
}
代码示例来源:origin: biz.aQute.bnd/bnd
String applyVersionPolicy(String exportVersion, String importRange, boolean provider) {
try {
setProperty("@", exportVersion);
if (importRange != null) {
importRange = cleanupVersion(importRange);
importRange = getReplacer().process(importRange);
} else
importRange = getVersionPolicy(provider);
}
finally {
unsetProperty("@");
}
return importRange;
}
内容来源于网络,如有侵权,请联系作者删除!