/** * Standard OSGi header parser. This parser can handle the format clauses * ::= clause ( ',' clause ) + clause ::= name ( ';' name ) (';' key '=' * value ) This is mapped to a Map { name => Map { attr|directive => value } * } * * @param value A string * @return a Map<String,Map<String,String>> */ static public Parameters parseHeader(String value, Reporter logger) { return parseHeader(value, logger, new Parameters()); }
public void add(String key, Attrs attrs) { while (containsKey(key)) key += "~"; put(key, attrs); }
/** * Standard OSGi header parser. * * @param value */ static public Parameters parseHeader(String value, Processor logger) { return new Parameters(value, logger); }
private void fixupOldStyleVersions(Attrs attrs) { if (attrs.containsKey(SPECIFICATION_VERSION) && attrs.getVersion() == null) { attrs.put("version", attrs.get(SPECIFICATION_VERSION)); attrs.remove(SPECIFICATION_VERSION); } }
public Attrs with(String key, String value) { put(key, value); return this; } }
public String get(String key, String deflt) { String s = get(key); if (s == null) return deflt; return s; }
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 Map<String, String> convert(String input) throws IllegalArgumentException { if (input == null) return null; return OSGiHeader.parseProperties(input); }
private static Parameters combiner(Parameters t, Parameters u) { t.mergeWith(u, true); return t; } }
/** * @param sb * @param value * @throws IOException */ public static boolean quote(Appendable sb, String value) throws IOException { return OSGiHeader.quote(sb, value); }
/** * Standard OSGi header parser. This parser can handle the format clauses * ::= clause ( ',' clause ) + clause ::= name ( ';' name ) (';' key '=' * value ) This is mapped to a Map { name => Map { attr|directive => value } * } * * @param value A string * @return a Map<String,Map<String,String>> */ static public Parameters parseHeader(String value, Reporter logger) { return parseHeader(value, logger, new Parameters()); }
public HeaderClause(String name, Attrs attribs) { assert name != null; this.name = name; this.attribs = attribs == null ? new Attrs() : attribs; }
/** * Standard OSGi header parser. This parser can handle the format clauses * ::= clause ( ',' clause ) + clause ::= name ( ';' name ) (';' key '=' * value ) This is mapped to a Map { name => Map { attr|directive => value } * } * * @param value A string * @return a Map<String,Map<String,String>> */ static public Parameters parseHeader(String value, Reporter logger) { return parseHeader(value, logger, new Parameters()); }
/** * Standard OSGi header parser. This parser can handle the format clauses * ::= clause ( ',' clause ) + clause ::= name ( ';' name ) (';' key '=' * value ) This is mapped to a Map { name => Map { attr|directive => value } * } * * @param value A string * @return a Map<String,Map<String,String>> */ static public Parameters parseHeader(String value, Reporter logger) { return parseHeader(value, logger, new Parameters()); }
/** * Standard OSGi header parser. This parser can handle the format clauses * ::= clause ( ',' clause ) + clause ::= name ( ';' name ) (';' key '=' * value ) This is mapped to a Map { name => Map { attr|directive => value } * } * * @param value * A string * @return a Map<String,Map<String,String>> */ static public Parameters parseHeader(String value, Reporter logger) { return parseHeader(value, logger, new Parameters()); }
/** * Standard OSGi header parser. This parser can handle the format clauses * ::= clause ( ',' clause ) + clause ::= name ( ';' name ) (';' key '=' * value ) This is mapped to a Map { name => Map { attr|directive => value } * } * * @param value * A string * @return a Map<String,Map<String,String>> */ static public Parameters parseHeader(String value, Reporter logger) { return parseHeader(value, logger, new Parameters()); }
/** * Standard OSGi header parser. This parser can handle the format clauses * ::= clause ( ',' clause ) + clause ::= name ( ';' name ) (';' key '=' * value ) This is mapped to a Map { name => Map { attr|directive => value } * } * * @param value * A string * @return a Map<String,Map<String,String>> */ static public Parameters parseHeader(String value, Reporter logger) { return parseHeader(value, logger, new Parameters()); }