public static String extractUrl(String override) { Clause[] cs = Parser.parseClauses(new String[]{override}); if (cs.length != 1) { throw new IllegalStateException("Override contains more than one clause: " + override); } return cs[0].getName(); }
private void fillAttributesOfRequirementFromClause(final Map<String, Object> attributes, final Clause clauses) { Attribute[] parsedAttributes = clauses.getAttributes(); for (Attribute attribute : parsedAttributes) { attributes.put(attribute.getName(), attribute.getValue()); } }
public void pre(Clause clause, StringBuilder output) { boolean isSatisfied = checkBundle(clause.getName(), clause.getAttribute("bundle-version")); output.append(isSatisfied ? SimpleAnsi.COLOR_DEFAULT : SimpleAnsi.COLOR_RED); } public void post(Clause clause, StringBuilder output) {
protected List<Clause> getOptionalImports(String importsStr) { Clause[] imports = Parser.parseHeader(importsStr); List<Clause> result = new LinkedList<Clause>(); for (Clause anImport : imports) { String resolution = anImport.getDirective(Constants.RESOLUTION_DIRECTIVE); if (Constants.RESOLUTION_OPTIONAL.equals(resolution)) { result.add(anImport); } } return result; }
protected void formatHeader(String header, ClauseFormatter formatter, StringBuilder builder, int indent) { Clause[] clauses = Parser.parseHeader(header); formatClauses(clauses, formatter, builder, indent); }
/** * Check if a given manifest clause represents an optional import * * @param clause the manifest clause * @return <code>true</code> for an optional import, <code>false</code> for mandatory imports */ public static boolean isOptional(Clause clause) { return "optional".equals(clause.getDirective("resolution")); }
public void pre(Clause clause, StringBuilder output) { boolean isSatisfied = checkBundle(clause.getName(), clause.getAttribute("bundle-version")); output.append(isSatisfied ? SimpleAnsi.COLOR_DEFAULT : SimpleAnsi.COLOR_RED); } public void post(Clause clause, StringBuilder output) {
protected void formatHeader(String header, ClauseFormatter formatter, StringBuilder builder, int indent) { Clause[] clauses = Parser.parseHeader(header); formatClauses(clauses, formatter, builder, indent); }
/** * Check if a given manifest clause represents an optional import * * @param clause the manifest clause * @return <code>true</code> for an optional import, <code>false</code> for mandatory imports */ public static boolean isOptional(Clause clause) { return "optional".equals(clause.getDirective("resolution")); }
public void pre(Clause clause, StringBuilder output) { boolean isSatisfied = checkBundle(clause.getName(), clause.getAttribute("version")); Ansi.ansi(output).fg(isSatisfied ? Ansi.Color.DEFAULT : Ansi.Color.RED).a(""); } public void post(Clause clause, StringBuilder output) {
protected void formatHeader(String header, ClauseFormatter formatter, StringBuilder builder, int indent) { Clause[] clauses = Parser.parseHeader(header); formatClauses(clauses, formatter, builder, indent); }