@Override public PreprocessorReader process(Document document, PreprocessorReader reader) { if (contentLines == null) { contentLines = reader.readLines(); } return reader; }
@Override public void process(Document document, PreprocessorReader reader, String target, Map<String, Object> attributes) { Map<String, Object> treeMap = new TreeMap<String, Object>(attributes); String str = ""; Iterator<Map.Entry<String, Object>> it = treeMap.entrySet().iterator(); if (it.hasNext()) str += it.next().getValue(); while (it.hasNext()) { str += "," + it.next().getValue(); } reader.push_include(str, target, target, 1, attributes); }
@Override public void process(Document document, PreprocessorReader reader) { List<String> lines = reader.readLines(); // <2> List<String> newLines = new ArrayList<String>(); boolean inComment = false; for (String line: lines) { // <3> if (line.trim().equals("////")) { if (!inComment) { newLines.add("[NOTE]"); } newLines.add("--"); inComment = !inComment; } else { newLines.add(line); } } reader.restoreLines(newLines); // <4> } }
@Override public void process(Document document, PreprocessorReader reader) { assertThat(reader.isNextLineEmpty(), is(false)); reader.advance(); assertThat(reader.isNextLineEmpty(), is(true)); }
@Override public void process(Document document, PreprocessorReader reader) { assertThat(reader.getLineNumber(), is(1)); } }
@Override public void process(Document document, PreprocessorReader reader) { assertThat(reader.hasMoreLines(), is(true)); }
@Override public void process(Document document, PreprocessorReader reader, String target, Map<String, Object> attributes) { StringBuilder content = readContent(target); reader.push_include(content.toString(), target, target, 1, attributes); }
@Override public void process(Document document, PreprocessorReader reader, String target, Map<String, Object> attributes) { StringBuilder content = readContent(target); reader.push_include(content.toString(), target, target, 1, attributes); }
@Override public void process(Document document, PreprocessorReader reader, String target, Map<String, Object> attributes) { StringBuilder content = readContent(target); reader.push_include(content.toString(), target, target, 1, attributes); }
@Override public void process(Document document, PreprocessorReader reader, String target, Map<String, Object> attributes) { StringBuilder content = readContent(target); reader.push_include(content.toString(), target, target, 1, attributes); }
@Override public void process(Document document, PreprocessorReader reader, String target, Map<String, Object> attributes) { StringBuilder content = readContent(target); reader.push_include(content.toString(), target, target, 1, attributes); }
@Override public void process(Document document, // <3> PreprocessorReader reader, String target, Map<String, Object> attributes) { StringBuilder sb = new StringBuilder(); for (File f: new File(".").listFiles()) { sb.append(f.getName()).append("\n"); } reader.push_include( // <4> sb.toString(), target, new File(".").getAbsolutePath(), 1, attributes); } }