@SuppressWarnings("resource") private String getProperty(String key, String deflt, String separator, boolean inherit) { Instruction ins = new Instruction(key); if (ins.isLiteral()) { return getLiteralProperty(ins.getLiteral(), deflt, this, inherit); } return getWildcardProperty(deflt, separator, inherit, ins); }
/** * @param from */ private List<Jar> filterFrom(Instruction from, List<Jar> providers) { if (from.isAny()) return providers; List<Jar> np = new ArrayList<>(); for (Iterator<Jar> i = providers.iterator(); i.hasNext();) { Jar j = i.next(); if (from.matches(j.getName())) { np.add(j); } } return np; }
if ( instruction.matches( key ) ) if (!instruction.isNegated()) { Object name = entry.getValue(); Object value = source.get( name ); if (!match && !instruction.isAny()) nomatch.add(instruction); if (instruction.isLiteral() && !instruction.isNegated()) { Object key = keys.get( instruction.getLiteral() ); if ( key != null ) if (instruction.isNegated()) { i.remove(); continue; if (instruction.isOptional()) { i.remove(); continue;
if (instruction.isDuplicate()) continue; Instruction from = new Instruction(directives.get(FROM_DIRECTIVE, "*")); if (packageRef.isMetaData() && instruction.isAny()) continue; if (!instruction.matches(packageRef.getFQN())) continue; if (instruction.isNegated()) continue;
if (instr.getKey().isLiteral() && !instr.getKey().isNegated()) { File f = IO.getFile(base, instr.getKey().getLiteral()); if (f.isFile()) result.put(f, instr.getValue()); for (Entry<Instruction,Attrs> instr : entrySet()) { String name = f.getName(); if (instr.getKey().matches(name)) { if (!instr.getKey().isNegated()) result.put(f, instr.getValue()); continue nextFile;
Instruction ins = new Instruction(key); if (!ins.isLiteral()) { String del = ""; for (String k : sortedList) { if (ins.matches(k)) { String v = getProperty(k, null); if (v != null) {
public DependencyFilter( String expression, String defaultValue ) { m_instruction = new Instruction( expression ); m_defaultValue = defaultValue; }
public Resource process(String source) { Instructions make = getMakeHeader(); logger.debug("make {}", source); for (Map.Entry<Instruction, Attrs> entry : make.entrySet()) { Instruction instr = entry.getKey(); Matcher m = instr.getMatcher(source); if (m.matches() || instr.isNegated()) { Map<String, String> arguments = replace(m, entry.getValue()); List<MakePlugin> plugins = builder.getPlugins(MakePlugin.class); for (MakePlugin plugin : plugins) { try { Resource resource = plugin.make(builder, source, arguments); if (resource != null) { logger.debug("Made {} from args {} with {}", source, arguments, plugin); return resource; } } catch (Exception e) { builder.exception(e, "Plugin %s generates error when use in making %s with args %s", plugin, source, arguments); } } } } return null; }
public boolean finds(String value) { return getMatcher(value).find(); }
public Instruction matcher(String value) { for (Instruction i : keySet()) { if (i.matches(value)) { return i; } } return null; }
public boolean matches(String value) { if (size() == 0) return true; Instruction instr = matcher(value); if (instr == null || instr.isNegated()) return false; // we deny this one explicitly return true; }
if (!unused.isEmpty()) { if (!(unused.size() == 1 && unused.iterator().next().toString().equals("*"))) warning("Unused Import-Package instructions: %s ", unused);
String literal = ins.getLiteral(); if (literal.equals("name")) out.println(jar.getSource().getName());
if (instruction.matches(packageName)) { match = true; if (!instruction.isNegated()) { result.merge(packageRef, instruction.isDuplicate(), source.get(packageRef), instructions.get(instruction)); if (!match && !instruction.isAny()) nomatch.add(instruction); if (instruction.isLiteral() && !instruction.isNegated()) { result.merge(getPackageRef(instruction.getLiteral()), true, instructions.get(instruction)); i.remove(); continue; if (instruction.isNegated()) { i.remove(); continue; if (instruction.isOptional()) { i.remove(); continue;
if (instruction.isDuplicate()) continue; Instruction from = new Instruction(directives.get(FROM_DIRECTIVE, "*")); if (packageRef.isMetaData() && instruction.isAny()) continue; if (!instruction.matches(packageRef.getFQN())) continue; if (instruction.isNegated()) continue;
if (instr.getKey().isLiteral() && !instr.getKey().isNegated()) { File f = IO.getFile(base, instr.getKey().getLiteral()); if (f.isFile()) result.put(f, instr.getValue()); for (Entry<Instruction,Attrs> instr : entrySet()) { String name = f.getName(); if (instr.getKey().matches(name)) { if (!instr.getKey().isNegated()) result.put(f, instr.getValue()); continue nextFile;
Instruction ins = new Instruction(key); if (!ins.isLiteral()) { String del = ""; for (String k : sortedList) { if (ins.matches(k)) { String v = getProperty(k, null); if (v != null) {
public class Generator { //... public IEnumerable<Instruction> Generate() { // ... yield return new Instruction(...); // ... } //... }