private void loadBuiltInSharedVariables() { sharedVariables.put("capture_output", new CaptureOutput()); sharedVariables.put("compress", StandardCompress.INSTANCE); sharedVariables.put("html_escape", new HtmlEscape()); sharedVariables.put("normalize_newlines", new NormalizeNewlines()); sharedVariables.put("xml_escape", new XmlEscape()); }
public static void main(String[] args) throws Exception { String content = null; System.out.println("This will be printed"); try (CaptureOutput co = new CaptureOutput()) { System.out.println("EXAMPLE"); content = co.getContent(); } System.out.println("This will be printed, too."); System.out.println("The content of the string is " + content); }
public static void main(String[] args) throws Exception { System.out.println("This will be printed"); ByteArrayOutputStream stream = new ByteArrayOutputStream(); try (CaptureOutput co = new CaptureOutput(stream)) { System.out.println("EXAMPLE"); } System.out.println("This will be printed, too."); System.out.println("The content of the string is " + stream.toString()); }
import java.io.ByteArrayOutputStream; public class Main { public static void main(String[] args) throws Exception { System.out.println("This will be printed"); ByteArrayOutputStream stream = new ByteArrayOutputStream(); try (CaptureOutput co = new CaptureOutput(stream)) { System.out.println("EXAMPLE"); } System.out.println("This will be printed, too."); System.out.println("The content of the string is " + stream.toString()); } }
private void loadBuiltInSharedVariables() { variables.put("capture_output", new CaptureOutput()); variables.put("compress", StandardCompress.INSTANCE); variables.put("html_escape", new HtmlEscape()); variables.put("normalize_newlines", new NormalizeNewlines()); variables.put("xml_escape", new XmlEscape()); }
private void loadBuiltInSharedVariables() { sharedVariables.put("capture_output", new CaptureOutput()); sharedVariables.put("compress", StandardCompress.INSTANCE); sharedVariables.put("html_escape", new HtmlEscape()); sharedVariables.put("normalize_newlines", new NormalizeNewlines()); sharedVariables.put("xml_escape", new XmlEscape()); }
private void loadBuiltInSharedVariables() { sharedVariables.put("capture_output", new CaptureOutput()); sharedVariables.put("compress", StandardCompress.INSTANCE); sharedVariables.put("html_escape", new HtmlEscape()); sharedVariables.put("normalize_newlines", new NormalizeNewlines()); sharedVariables.put("xml_escape", new XmlEscape()); }