/vertx-template-engines/vertx-web-templ-rocker/src/main/java/io/vertx/ext/web/templ/rocker/RockerTemplateEngine.java

https://github.com/vert-x3/vertx-web · Java · 53 lines · 14 code · 6 blank · 33 comment · 0 complexity · 1b1debb05e2d53e39bddcd580091c11d MD5 · raw file

  1. /*
  2. * Copyright 2014 Red Hat, Inc.
  3. *
  4. * All rights reserved. This program and the accompanying materials
  5. * are made available under the terms of the Eclipse Public License v1.0
  6. * and Apache License v2.0 which accompanies this distribution.
  7. *
  8. * The Eclipse Public License is available at
  9. * http://www.eclipse.org/legal/epl-v10.html
  10. *
  11. * The Apache License v2.0 is available at
  12. * http://www.opensource.org/licenses/apache2.0.php
  13. *
  14. * You may elect to redistribute this code under either of these licenses.
  15. */
  16. package io.vertx.ext.web.templ.rocker;
  17. import io.vertx.codegen.annotations.VertxGen;
  18. import io.vertx.ext.web.common.template.TemplateEngine;
  19. import io.vertx.ext.web.templ.rocker.impl.RockerTemplateEngineImpl;
  20. /**
  21. * A template engine that uses the Rocker library.
  22. *
  23. * @author <a href="mailto:xianguang.zhou@outlook.com">Xianguang Zhou</a>
  24. */
  25. @VertxGen
  26. public interface RockerTemplateEngine extends TemplateEngine {
  27. /**
  28. * Default template extension
  29. */
  30. String DEFAULT_TEMPLATE_EXTENSION = "rocker.html";
  31. /**
  32. * Create a template engine using defaults
  33. *
  34. * @return the engine
  35. */
  36. static RockerTemplateEngine create() {
  37. return create(DEFAULT_TEMPLATE_EXTENSION);
  38. }
  39. /**
  40. * Create a template engine using a custom extension
  41. *
  42. * @return the engine
  43. */
  44. static RockerTemplateEngine create(String extension) {
  45. return new RockerTemplateEngineImpl(extension);
  46. }
  47. }