a tiny c-template work-alike for java
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

48 lines
1004 B

  1. package com.binarythought.picotemplate;
  2. /**
  3. * Groups of TemplateNodes compose a template once it's compiled.
  4. * This class shouldn't be used directly.
  5. * @see Template
  6. */
  7. public class TemplateNode
  8. {
  9. /** Plain node type */
  10. public static final int PLAIN = 0;
  11. /** Variable node type */
  12. public static final int VARIABLE = 1;
  13. /** Start of section node type */
  14. public static final int SECTION_START = 2;
  15. /** End of section node type */
  16. public static final int SECTION_END = 3;
  17. private int nodeType;
  18. private String content;
  19. /**
  20. * Instantiate new node.
  21. * @param nodeType Type of node
  22. * @param content Content of this node.
  23. */
  24. public TemplateNode(int nodeType, String content)
  25. {
  26. this.nodeType = nodeType;
  27. this.content = content;
  28. }
  29. /**
  30. * Get the type of this node
  31. * @return Type of this node.
  32. */
  33. public int getNodeType(){ return nodeType; }
  34. /**
  35. * Get the content of this node.
  36. * @return Content of this node.
  37. */
  38. public String getContent(){ return content; }
  39. }