/** * Extra the paths for the directories and files that are used in the * Include-Resource header. */ private Stream<String> getIncludedResourcePrefixes() { Stream<String> prefixes = getIncludeResource().entrySet() .stream() .filter(e -> !e.getValue() .containsKey("literal")) .map(Entry::getKey) .map(IR_PATTERN::matcher) .filter(Matcher::matches) .map(m -> m.group(1)) .map(this::getFile) .map(IO::absolutePath); return prefixes; }
/** * Extra the paths for the directories and files that are used in the * Include-Resource header. */ private Stream<String> getIncludedResourcePrefixes() { Stream<String> prefixes = getIncludeResource().entrySet() .stream() .filter(e -> !e.getValue() .containsKey("literal")) .map(Entry::getKey) .map(IR_PATTERN::matcher) .filter(Matcher::matches) .map(m -> m.group(1)) .map(this::getFile) .map(IO::absolutePath); return prefixes; }
/** * Merge the attributes */ public void mergeWith(Attrs other, boolean override) { for (Map.Entry<String, String> e : other.entrySet()) { String key = e.getKey(); if (override || !containsKey(key)) { map.put(key, e.getValue()); Type t = other.getType(key); if (t != Type.STRING) { types.put(key, t); } else { types.remove(key); } } } }
/** * Merge the attributes */ public void mergeWith(Attrs other, boolean override) { for (Map.Entry<String, String> e : other.entrySet()) { String key = e.getKey(); if (override || !containsKey(key)) { map.put(key, e.getValue()); Type t = other.getType(key); if (t != Type.STRING) { types.put(key, t); } else { types.remove(key); } } } }
/** * Merge the attributes */ public void mergeWith(Attrs other, boolean override) { for (Map.Entry<String, String> e : other.entrySet()) { String key = e.getKey(); if (override || !containsKey(key)) { map.put(key, e.getValue()); Type t = other.getType(key); if (t != Type.STRING) { types.put(key, t); } else { types.remove(key); } } } }
/** * Merge the attributes */ public void mergeWith(Attrs other, boolean override) { for (Map.Entry<String, String> e : other.entrySet()) { String key = e.getKey(); if (override || !containsKey(key)) { map.put(key, e.getValue()); Type t = other.getType(key); if (t != Type.STRING) { types.put(key, t); } else { types.remove(key); } } } }
@Override public String toString() { StringBuilder sb = new StringBuilder(getName()); if (isProvided()) sb.append(";") .append("provided:=true"); if (getAttribs().containsKey("version")) sb.append(";version=") .append(getAttribs().get("version")); return sb.toString(); }
@Override public String toString() { StringBuilder sb = new StringBuilder(getName()); if (isProvided()) sb.append(";") .append("provided:=true"); if (getAttribs().containsKey("version")) sb.append(";version=") .append(getAttribs().get("version")); return sb.toString(); }
/** * Extra the paths for the directories and files that are used in the * Include-Resource header. * * @return */ private Collection<String> getIncludedResourcePrefixes() { List<String> prefixes = new ArrayList<String>(); Parameters includeResource = getIncludeResource(); for (Entry<String,Attrs> p : includeResource.entrySet()) { if (p.getValue().containsKey("literal")) continue; Matcher m = IR_PATTERN.matcher(p.getKey()); if (m.matches()) { File f = getFile(m.group(1)); prefixes.add(f.getAbsolutePath()); } } return prefixes; }
/** * Extra the paths for the directories and files that are used in the * Include-Resource header. * * @return */ private Collection<String> getIncludedResourcePrefixes() { List<String> prefixes = new ArrayList<String>(); Parameters includeResource = getIncludeResource(); for (Entry<String,Attrs> p : includeResource.entrySet()) { if (p.getValue().containsKey("literal")) continue; Matcher m = IR_PATTERN.matcher(p.getKey()); if (m.matches()) { File f = getFile(m.group(1)); prefixes.add(f.getAbsolutePath()); } } return prefixes; }
private void fixupOldStyleVersions(Attrs attrs) { if (attrs.containsKey(SPECIFICATION_VERSION) && attrs.getVersion() == null) { attrs.put("version", attrs.get(SPECIFICATION_VERSION)); attrs.remove(SPECIFICATION_VERSION); } }
private void fixupOldStyleVersions(Attrs attrs) { if (attrs.containsKey(SPECIFICATION_VERSION) && attrs.getVersion() == null) { attrs.put("version", attrs.get(SPECIFICATION_VERSION)); attrs.remove(SPECIFICATION_VERSION); } }
private void fixupOldStyleVersions(Attrs attrs) { if (attrs.containsKey(SPECIFICATION_VERSION) && attrs.getVersion() == null) { attrs.put("version", attrs.get(SPECIFICATION_VERSION)); attrs.remove(SPECIFICATION_VERSION); } }
private void fixupOldStyleVersions(Attrs attrs) { if (attrs.containsKey(SPECIFICATION_VERSION) && attrs.getVersion() == null) { attrs.put("version", attrs.get(SPECIFICATION_VERSION)); attrs.remove(SPECIFICATION_VERSION); } }
private void handleAttributeOrDirective(Annotation a) { Object o = annotation.get(lastMethodSeen); if (o != null) { String attributeName = a.get("value"); if (attributeName == null) { attributeName = lastMethodSeen; } if (STD_DIRECTIVE.equals(a.getName() .getFQN())) { attributeName += ":"; } if (!attributesAndDirectives.containsKey(attributeName)) { attributesAndDirectives.putTyped(attributeName, o); } } }
private void handleAttributeOrDirective(Annotation a) { Object o = annotation.get(lastMethodSeen); if (o != null) { String attributeName = a.get("value"); if (attributeName == null) { attributeName = lastMethodSeen; } if (STD_DIRECTIVE.equals(a.getName() .getFQN())) { attributeName += ":"; } if (!attributesAndDirectives.containsKey(attributeName)) { attributesAndDirectives.putTyped(attributeName, o); } } }
private static void doOr(FilterBuilder sb, String key, String attribute, Attrs attrs) throws Exception { sb.or(); while (attrs.containsKey(key)) { String[] names = Converter.cnv(String[].class, attrs.getTyped(key)); for (String name : names) { sb.approximate(attribute, name); } key += "~"; } sb.endOr(); }
public void addExportPackage(String packageName, Attrs attrs) throws Exception { CapReqBuilder capb = new CapReqBuilder(resource, PackageNamespace.PACKAGE_NAMESPACE); capb.addAttributesOrDirectives(attrs); if (!attrs.containsKey(PackageNamespace.CAPABILITY_VERSION_ATTRIBUTE)) { capb.addAttribute(PackageNamespace.CAPABILITY_VERSION_ATTRIBUTE, Version.emptyVersion); } capb.addAttribute(PackageNamespace.PACKAGE_NAMESPACE, packageName); addCapability(capb); }
public void addExportPackage(String packageName, Attrs attrs) throws Exception { CapReqBuilder capb = new CapReqBuilder(resource, PackageNamespace.PACKAGE_NAMESPACE); capb.addAttributesOrDirectives(attrs); if (!attrs.containsKey(PackageNamespace.CAPABILITY_VERSION_ATTRIBUTE)) { capb.addAttribute(PackageNamespace.CAPABILITY_VERSION_ATTRIBUTE, Version.emptyVersion); } capb.addAttribute(PackageNamespace.PACKAGE_NAMESPACE, packageName); addCapability(capb); }
private static void doOr(FilterBuilder sb, String key, String attribute, Attrs attrs) throws Exception { sb.or(); while (attrs.containsKey(key)) { String[] names = Converter.cnv(String[].class, attrs.getTyped(key)); for (String name : names) { sb.approximate(attribute, name); } key += "~"; } sb.endOr(); }