public VelocityTemplateRepresentationGenerator(byte[] templateData) throws InvalidTemplateException { try { this.simpleNode = RuntimeSingleton.parse( new InputStreamReader(new ByteArrayInputStream(templateData)), "some.vm"); } catch (Exception ex) { logger.warn(ex.getMessage(), ex); throw new InvalidTemplateException(ex); } if (simpleNode == null) { throw new InvalidTemplateException(); } }
/** * Parse the input and return the root of the AST node structure. * * @param InputStream inputstream retrieved by a resource loader * @param String name of the template being parsed * @param dumpNamespace flag to dump the Velocimacro namespace for this template */ public static SimpleNode parse(Reader reader, String templateName, boolean dumpNamespace) throws ParseException { return RuntimeSingleton.parse(reader, templateName, dumpNamespace); }