/src/solidstack/template/TemplateCompilerContext.java
Java | 156 lines | 113 code | 28 blank | 15 comment | 0 complexity | d54e3d4d8f9a0995931dfd692bee723b MD5 | raw file
Possible License(s): Apache-2.0
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 17package solidstack.template; 18 19import java.util.List; 20 21import solidstack.io.Resource; 22import solidstack.io.SourceReader; 23import solidstack.template.JSPLikeTemplateParser.Directive; 24import solidstack.template.JSPLikeTemplateParser.ParseEvent; 25 26 27@SuppressWarnings( "javadoc" ) 28public class TemplateCompilerContext 29{ 30 private String path; 31 private Resource resource; 32 private SourceReader reader; 33 private List<ParseEvent> events; 34 private List<Directive> directives; 35 private List<String> imports; 36 private String language; 37 private String contentType; 38 private String charSet; 39 private StringBuilder script; 40 private Template template; 41 42 public void setResource( Resource resource ) 43 { 44 this.resource = resource; 45 } 46 47 public Resource getResource() 48 { 49 return this.resource; 50 } 51 52 public void setReader( SourceReader reader ) 53 { 54 this.reader = reader; 55 } 56 57 public SourceReader getReader() 58 { 59 return this.reader; 60 } 61 62 public void setPath( String path ) 63 { 64 this.path = path; 65 } 66 67 public String getPath() 68 { 69 return this.path; 70 } 71 72 public void setEvents( List<ParseEvent> events ) 73 { 74 this.events = events; 75 } 76 77 public List<ParseEvent> getEvents() 78 { 79 return this.events; 80 } 81 82 public void setDirectives( List<Directive> directives ) 83 { 84 this.directives = directives; 85 } 86 87 public List<Directive> getDirectives() 88 { 89 return this.directives; 90 } 91 92 public Directive[] getDirectivesArray() 93 { 94 return this.directives.toArray( new Directive[ this.directives.size() ] ); 95 } 96 97 public void setImports( List<String> imports ) 98 { 99 this.imports = imports; 100 } 101 102 public List<String> getImports() 103 { 104 return this.imports; 105 } 106 107 public void setLanguage( String language ) 108 { 109 this.language = language; 110 } 111 112 public String getLanguage() 113 { 114 return this.language; 115 } 116 117 public void setContentType( String contentType ) 118 { 119 this.contentType = contentType; 120 } 121 122 public String getContentType() 123 { 124 return this.contentType; 125 } 126 127 public void setCharSet( String charSet ) 128 { 129 this.charSet = charSet; 130 } 131 132 public String getCharSet() 133 { 134 return this.charSet; 135 } 136 137 public void setScript( StringBuilder script ) 138 { 139 this.script = script; 140 } 141 142 public StringBuilder getScript() 143 { 144 return this.script; 145 } 146 147 public void setTemplate( Template template ) 148 { 149 this.template = template; 150 } 151 152 public Template getTemplate() 153 { 154 return this.template; 155 } 156}