Generate Java source from Nodes.
| 61 | * Generate Java source from Nodes. |
| 62 | */ |
| 63 | class Generator { |
| 64 | |
| 65 | private static final Class<?>[] OBJECT_CLASS = { Object.class }; |
| 66 | |
| 67 | private static final Pattern PRE_TAG_PATTERN = Pattern.compile("(?s).*(<pre>|</pre>).*"); |
| 68 | |
| 69 | private static final Pattern BLANK_LINE_PATTERN = Pattern.compile("(\\s*(\\n|\\r)+\\s*)"); |
| 70 | |
| 71 | private static final String CORE_LIBS_URI = "http://java.sun.com/jsp/jstl/core"; |
| 72 | |
| 73 | private final ServletWriter out; |
| 74 | |
| 75 | private final ArrayList<GenBuffer> methodsBuffered; |
| 76 | |
| 77 | private final FragmentHelperClass fragmentHelperClass; |
| 78 | |
| 79 | private final ErrorDispatcher err; |
| 80 | |
| 81 | private final BeanRepository beanInfo; |
| 82 | |
| 83 | private final Set<String> varInfoNames; |
| 84 | |
| 85 | private final JspCompilationContext ctxt; |
| 86 | |
| 87 | private final boolean isPoolingEnabled; |
| 88 | |
| 89 | private final boolean breakAtLF; |
| 90 | |
| 91 | private String jspIdPrefix; |
| 92 | |
| 93 | private int jspId; |
| 94 | |
| 95 | private final PageInfo pageInfo; |
| 96 | |
| 97 | private final List<String> tagHandlerPoolNames; |
| 98 | |
| 99 | private GenBuffer charArrayBuffer; |
| 100 | |
| 101 | private final DateFormat timestampFormat; |
| 102 | |
| 103 | private final ELInterpreter elInterpreter; |
| 104 | |
| 105 | private final Set<String> nonstandardCustomTagNames; |
| 106 | |
| 107 | private final StringInterpreter stringInterpreter; |
| 108 | |
| 109 | /** |
| 110 | * @param s the input string |
| 111 | * |
| 112 | * @return quoted and escaped string, per Java rule |
| 113 | */ |
| 114 | static String quote(String s) { |
| 115 | |
| 116 | if (s == null) { |
| 117 | return "null"; |
| 118 | } |
| 119 | |
| 120 | return '"' + escape(s) + '"'; |