/src/solidstack/template/TemplateCompilerContext.java

http://solidstack.googlecode.com/ · Java · 156 lines · 113 code · 28 blank · 15 comment · 0 complexity · d54e3d4d8f9a0995931dfd692bee723b MD5 · raw file

  1. /*--
  2. * Copyright 2012 René M. de Bloois
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. package solidstack.template;
  17. import java.util.List;
  18. import solidstack.io.Resource;
  19. import solidstack.io.SourceReader;
  20. import solidstack.template.JSPLikeTemplateParser.Directive;
  21. import solidstack.template.JSPLikeTemplateParser.ParseEvent;
  22. @SuppressWarnings( "javadoc" )
  23. public class TemplateCompilerContext
  24. {
  25. private String path;
  26. private Resource resource;
  27. private SourceReader reader;
  28. private List<ParseEvent> events;
  29. private List<Directive> directives;
  30. private List<String> imports;
  31. private String language;
  32. private String contentType;
  33. private String charSet;
  34. private StringBuilder script;
  35. private Template template;
  36. public void setResource( Resource resource )
  37. {
  38. this.resource = resource;
  39. }
  40. public Resource getResource()
  41. {
  42. return this.resource;
  43. }
  44. public void setReader( SourceReader reader )
  45. {
  46. this.reader = reader;
  47. }
  48. public SourceReader getReader()
  49. {
  50. return this.reader;
  51. }
  52. public void setPath( String path )
  53. {
  54. this.path = path;
  55. }
  56. public String getPath()
  57. {
  58. return this.path;
  59. }
  60. public void setEvents( List<ParseEvent> events )
  61. {
  62. this.events = events;
  63. }
  64. public List<ParseEvent> getEvents()
  65. {
  66. return this.events;
  67. }
  68. public void setDirectives( List<Directive> directives )
  69. {
  70. this.directives = directives;
  71. }
  72. public List<Directive> getDirectives()
  73. {
  74. return this.directives;
  75. }
  76. public Directive[] getDirectivesArray()
  77. {
  78. return this.directives.toArray( new Directive[ this.directives.size() ] );
  79. }
  80. public void setImports( List<String> imports )
  81. {
  82. this.imports = imports;
  83. }
  84. public List<String> getImports()
  85. {
  86. return this.imports;
  87. }
  88. public void setLanguage( String language )
  89. {
  90. this.language = language;
  91. }
  92. public String getLanguage()
  93. {
  94. return this.language;
  95. }
  96. public void setContentType( String contentType )
  97. {
  98. this.contentType = contentType;
  99. }
  100. public String getContentType()
  101. {
  102. return this.contentType;
  103. }
  104. public void setCharSet( String charSet )
  105. {
  106. this.charSet = charSet;
  107. }
  108. public String getCharSet()
  109. {
  110. return this.charSet;
  111. }
  112. public void setScript( StringBuilder script )
  113. {
  114. this.script = script;
  115. }
  116. public StringBuilder getScript()
  117. {
  118. return this.script;
  119. }
  120. public void setTemplate( Template template )
  121. {
  122. this.template = template;
  123. }
  124. public Template getTemplate()
  125. {
  126. return this.template;
  127. }
  128. }