1 29 30 package com.caucho.jsp; 31 32 import com.caucho.java.LineMap; 33 import com.caucho.log.Log; 34 import com.caucho.util.L10N; 35 import com.caucho.vfs.Path; 36 import com.caucho.vfs.PersistentDependency; 37 38 import javax.servlet.jsp.tagext.TagInfo ; 39 import javax.servlet.jsp.tagext.TagLibraryInfo ; 40 import java.util.ArrayList ; 41 import java.util.logging.Logger ; 42 43 51 abstract public class JspGenerator { 52 static final L10N L = new L10N(JspGenerator.class); 53 static final Logger log = Log.open(JspGenerator.class); 54 55 protected JspParser _jspParser; 56 protected JspCompiler _jspCompiler; 57 protected JspCompilerInstance _jspCompilerInstance; 58 59 protected LineMap _lineMap; 62 63 public void setJspCompiler(JspCompiler compiler) 64 { 65 _jspCompiler = compiler; 66 } 67 68 public JspCompiler getJspCompiler() 69 { 70 return _jspCompiler; 71 } 72 73 public void setJspCompilerInstance(JspCompilerInstance compiler) 74 { 75 _jspCompilerInstance = compiler; 76 } 77 78 public JspCompilerInstance getJspCompilerInstance() 79 { 80 return _jspCompilerInstance; 81 } 82 83 abstract protected void setParseState(ParseState parseState); 84 85 abstract protected ParseState getParseState(); 86 87 public void setJspParser(JspParser parser) 88 { 89 _jspParser = parser; 90 } 91 92 public JspParser getJspParser() 93 { 94 return _jspParser; 95 } 96 97 public LineMap getLineMap() 98 { 99 return _lineMap; 100 } 101 102 public boolean isELIgnore() 103 { 104 return getParseState().isELIgnored(); 105 } 106 107 public void addDepend(PersistentDependency depend) 108 { 109 } 110 111 public ArrayList <PersistentDependency> getDependList() 112 { 113 return null; 114 } 115 116 119 public boolean isStatic() 120 { 121 return false; 122 } 123 124 127 public TagInfo generateTagInfo(String className, TagLibraryInfo tag) 128 { 129 throw new IllegalStateException (); 130 } 131 132 135 abstract public void validate() 136 throws Exception ; 137 138 141 abstract protected void generate(Path path, String className) 142 throws Exception ; 143 144 public String getSourceLines(Path source, int errorLine) 145 { 146 return ""; 147 } 148 } 149 | Popular Tags |