public HeaderClause(String name, Attrs attribs) { assert name != null; this.name = name; this.attribs = attribs == null ? new Attrs() : attribs; }
public HeaderClause(String name, Attrs attribs) { assert name != null; this.name = name; this.attribs = attribs == null ? new Attrs() : attribs; }
private MetaAnnotationCollector(Clazz c, Annotation annotation, Set<String> processed, Attrs baseAttrs) { this.c = c; this.annotation = annotation; this.processed = processed; this.attributesAndDirectives = new Attrs(baseAttrs); }
@Override public HeaderClause clone() { try { HeaderClause clone = (HeaderClause) super.clone(); clone.name = this.name; clone.attribs = new Attrs(this.attribs); return clone; } catch (CloneNotSupportedException e) { throw new RuntimeException(e); } }
@Override public ImportPattern clone() { return new ImportPattern(this.name, new Attrs(this.attribs)); }
@Override public HeaderClause clone() { try { HeaderClause clone = (HeaderClause) super.clone(); clone.name = this.name; clone.attribs = new Attrs(this.attribs); return clone; } catch (CloneNotSupportedException e) { throw new RuntimeException(e); } }
@Override public ImportPattern clone() { return new ImportPattern(this.name, new Attrs(this.attribs)); } }
public static Attrs create(String key, String value) { Attrs attrs = new Attrs(); attrs.put(key, value); return attrs; }
public static Attrs create(String key, String value) { Attrs attrs = new Attrs(); attrs.put(key, value); return attrs; }
@Override public VersionedClause clone() { VersionedClause clone = (VersionedClause) super.clone(); clone.name = this.name; clone.attribs = new Attrs(this.attribs); return clone; } }
@Override public VersionedClause clone() { VersionedClause clone = (VersionedClause) super.clone(); clone.name = this.name; clone.attribs = new Attrs(this.attribs); return clone; }
private Attrs getAttributes(Annotation a, String... ignores) { Attrs attrs = new Attrs(); outer: for (Entry<String, Object> entry : a.entrySet()) { String key = entry.getKey(); for (String ignore : ignores) { if (key.equals(ignore)) continue outer; } attrs.putTyped(key, entry.getValue()); } return attrs; }
public Attrs put(PackageRef ref) { Attrs attrs = get(ref); if (attrs != null) return attrs; attrs = new Attrs(); put(ref, attrs); return attrs; }
/** * Merge all attributes of the given parameters with this */ public void mergeWith(Parameters other, boolean override) { for (Map.Entry<String, Attrs> e : other.entrySet()) { Attrs existing = get(e.getKey()); if (existing == null) { put(e.getKey(), new Attrs(e.getValue())); } else existing.mergeWith(e.getValue(), override); } }
public Attrs put(PackageRef ref) { Attrs attrs = get(ref); if (attrs != null) return attrs; attrs = new Attrs(); put(ref, attrs); return attrs; }
public void referTo(TypeRef ref) { PackageRef pack = ref.getPackageRef(); if (!referred.containsKey(pack)) referred.put(pack, new Attrs()); }
public void referTo(TypeRef ref) { PackageRef pack = ref.getPackageRef(); if (!referred.containsKey(pack)) referred.put(pack, new Attrs()); }
public void addRequireBundle(String bsn, VersionRange range) throws Exception { Attrs attrs = new Attrs(); attrs.put("bundle-version", range.toString()); addRequireBundle(bsn, attrs); }
public void referTo(TypeRef ref) { PackageRef pack = ref.getPackageRef(); if (!referred.containsKey(pack)) referred.put(pack, new Attrs()); }
private void addExtenderRequirement(Set<String> requires, List<String> beans, Version version) { Version next = version.bumpMajor(); Parameters p = new Parameters(); Attrs a = new Attrs(); a.put(Constants.FILTER_DIRECTIVE, "\"(&(osgi.extender=osgi.cdi)(version>=" + version + ")(!(version>=" + next + ")))\""); a.put("beans:List<String>", String.join(",", beans)); p.put("osgi.extender", a); String s = p.toString(); requires.add(s); }