Package com.floreysoft.jmte.encoder

Examples of com.floreysoft.jmte.encoder.XMLEncoder


  }
 
  @Test
  public void xmlEncoder() throws Exception {
    Engine engine = newEngine();
    engine.setEncoder(new XMLEncoder());

    Map<String, Object> model = new HashMap<String, Object>();
    model.put("toEncode", "&<>'\"");

    String actual = engine.transform("${toEncode}", model);
View Full Code Here


  @Test
  public void xmlEncoderRawRenderer() throws Exception {
    Renderer<String> rawRenderer = new RawNoopRenderer();
    Engine engine = newEngine();
    engine.registerRenderer(String.class, rawRenderer);
    engine.setEncoder(new XMLEncoder());

    Map<String, Object> model = new HashMap<String, Object>();
    model.put("toEncode", "&<>'\"");

    String actual = engine.transform("${toEncode}", model);
View Full Code Here

  @Test
  public void xmlEncoderRawNamedRenderer() throws Exception {
    NamedRenderer rawRenderer = new RawNamedNoopRenderer();
    Engine engine = newEngine();
    engine.registerNamedRenderer(rawRenderer);
    engine.setEncoder(new XMLEncoder());

    Map<String, Object> model = new HashMap<String, Object>();
    model.put("toEncode", "&<>'\"");

    String actual = engine.transform("${toEncode;raw}", model);
View Full Code Here

TOP

Related Classes of com.floreysoft.jmte.encoder.XMLEncoder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.