public class JETCompiler extends java.lang.Object implements JETParseEventListener, JETParseEventListener.CommentListener
| Modifier and Type | Class and Description |
|---|---|
static interface |
JETCompiler.JETCompilerResultMonitor |
static class |
JETCompiler.JETInputStreamHandler |
JETParseEventListener.CommentListener| Modifier and Type | Field and Description |
|---|---|
protected static java.lang.String |
CONSTANT_PREFIX |
protected long |
constantCount |
protected java.util.Map<char[],JETConstantDataGenerator> |
constantDictionary |
protected java.util.List<JETConstantDataGenerator> |
constants |
protected java.util.Map<java.lang.String,java.lang.String> |
constantSubstitutitons |
protected JETLiteralItem |
currentLiteralItem |
protected boolean |
fNoNewLineForScriptlets
If true, the newline immediately preceding a scriptlet or directive (though not a successful include directive),
along with any intervening spaces, will be stripped from the character data.
|
protected char[] |
fSavedLine
If fNoNewLineForScriptlets is true, the trailing newline/space sequence is stripped from each character
data segment, and stored in this field.
|
protected boolean |
fUseStaticFinalConstants |
protected java.util.List<JETGenerator> |
generators |
protected JETCompiler.JETInputStreamHandler |
inputStreamHandler |
protected java.util.List<JETItem> |
jetItems |
protected static char[] |
NULL_CHAR_ARRAY |
protected JETMark |
pageStart |
protected JETParser |
parser |
protected JETProblemListener |
problemListener |
protected JETReader |
reader |
protected JETLiteralItem |
savedLineLiteralItem |
protected int |
sectionDepth
The depth of the current section, where 0 is outside of any sections.
|
protected JETSkeleton |
skeleton |
protected boolean |
skipping
Whether content is currently being skipped.
|
protected java.util.Stack<org.eclipse.emf.codegen.jet.JETCompiler.SkipSection> |
skipSections
A stack of sections and whether to start skipping, one from each include with alternative encountered.
|
protected java.lang.String |
templateURI |
protected java.lang.String[] |
templateURIPath |
protected boolean |
useMinimizedConstants |
protected java.io.PrintWriter |
writer |
| Constructor and Description |
|---|
JETCompiler(java.lang.String templateURI) |
JETCompiler(java.lang.String[] templateURIPath,
java.lang.String relativeTemplateURI) |
JETCompiler(java.lang.String[] templateURIPath,
java.lang.String relativeTemplateURI,
java.lang.String encoding) |
JETCompiler(java.lang.String[] templateURIPath,
java.lang.String relativeTemplateURI,
java.lang.String encoding,
JETCompiler.JETInputStreamHandler inputStreamHandler,
JETProblemListener problemListener) |
JETCompiler(java.lang.String templateURI,
java.io.InputStream inputStream,
java.lang.String encoding) |
JETCompiler(java.lang.String templateURI,
java.lang.String encoding) |
| Modifier and Type | Method and Description |
|---|---|
void |
addCharDataGenerator(char[] chars) |
void |
addGenerator(JETGenerator gen) |
void |
beginPageProcessing() |
void |
doAddCharDataGenerator(char[] chars) |
void |
endPageProcessing() |
static java.lang.String |
find(java.lang.String[] locationURIPath,
java.lang.String relativeLocationURI) |
static java.lang.String[] |
findLocation(java.lang.String[] locationURIPath,
int start,
java.lang.String relativeLocationURI) |
static java.lang.String[] |
findLocation(java.lang.String[] locationURIPath,
int start,
java.lang.String relativeLocationURI,
JETCompiler.JETInputStreamHandler inputStreamHandler) |
void |
generate(java.io.OutputStream oStream) |
void |
generate(java.io.Writer writer) |
java.lang.String |
getLineSeparator() |
java.lang.String |
getResolvedTemplateURI() |
JETCompilationUnit |
getResult() |
JETSkeleton |
getSkeleton() |
void |
handleCharData(char[] chars) |
void |
handleComment(JETMark start,
JETMark stop) |
void |
handleDirective(java.lang.String directive,
JETMark start,
JETMark stop,
java.util.Map<java.lang.String,java.lang.String> attributes) |
void |
handleExpression(JETMark start,
JETMark stop,
java.util.Map<java.lang.String,java.lang.String> attributes) |
protected void |
handleNewSkeleton() |
void |
handleScriptlet(JETMark start,
JETMark stop,
java.util.Map<java.lang.String,java.lang.String> attributes) |
static java.io.InputStream |
openStream(java.lang.String locationURI) |
static java.io.InputStream |
openStream(java.lang.String locationURI,
JETCompiler.JETInputStreamHandler inputStreamHandler) |
void |
parse() |
protected void |
parse(JETCoreElement[] coreElements,
java.lang.Class<?>[] accept) |
protected static java.lang.String[] |
resolveLocation(java.lang.String[] templateURIPath,
int start,
java.lang.String baseLocationURI,
java.lang.String locationURI) |
protected static java.lang.String[] |
resolveLocation(java.lang.String[] templateURIPath,
java.lang.String baseLocationURI,
java.lang.String locationURI) |
protected char[] |
stripFirstNewLineWithBlanks(char[] chars) |
protected char[] |
stripLastNewLineWithBlanks(char[] chars) |
protected static final char[] NULL_CHAR_ARRAY
protected java.lang.String[] templateURIPath
protected java.lang.String templateURI
protected JETParser parser
protected JETSkeleton skeleton
protected JETReader reader
protected java.io.PrintWriter writer
protected java.util.List<JETGenerator> generators
protected java.util.List<JETConstantDataGenerator> constants
protected java.util.Map<char[],JETConstantDataGenerator> constantDictionary
protected long constantCount
protected boolean fNoNewLineForScriptlets
protected boolean fUseStaticFinalConstants
protected boolean useMinimizedConstants
protected final java.util.Map<java.lang.String,java.lang.String> constantSubstitutitons
protected char[] fSavedLine
protected JETLiteralItem savedLineLiteralItem
protected int sectionDepth
protected boolean skipping
protected java.util.Stack<org.eclipse.emf.codegen.jet.JETCompiler.SkipSection> skipSections
protected static final java.lang.String CONSTANT_PREFIX
protected JETCompiler.JETInputStreamHandler inputStreamHandler
protected final java.util.List<JETItem> jetItems
protected JETLiteralItem currentLiteralItem
protected JETProblemListener problemListener
protected JETMark pageStart
public JETCompiler(java.lang.String templateURI)
throws JETException
JETExceptionpublic JETCompiler(java.lang.String templateURI,
java.lang.String encoding)
throws JETException
JETExceptionpublic JETCompiler(java.lang.String templateURI,
java.io.InputStream inputStream,
java.lang.String encoding)
throws JETException
JETExceptionpublic JETCompiler(java.lang.String[] templateURIPath,
java.lang.String relativeTemplateURI)
throws JETException
JETExceptionpublic JETCompiler(java.lang.String[] templateURIPath,
java.lang.String relativeTemplateURI,
java.lang.String encoding)
throws JETException
JETExceptionpublic JETCompiler(java.lang.String[] templateURIPath,
java.lang.String relativeTemplateURI,
java.lang.String encoding,
JETCompiler.JETInputStreamHandler inputStreamHandler,
JETProblemListener problemListener)
throws JETException
JETExceptionpublic java.lang.String getLineSeparator()
public java.lang.String getResolvedTemplateURI()
public void handleDirective(java.lang.String directive,
JETMark start,
JETMark stop,
java.util.Map<java.lang.String,java.lang.String> attributes)
throws JETException
handleDirective in interface JETParseEventListenerJETExceptionprotected void handleNewSkeleton()
public void handleComment(JETMark start, JETMark stop) throws JETException
handleComment in interface JETParseEventListener.CommentListenerJETExceptionpublic void handleExpression(JETMark start, JETMark stop, java.util.Map<java.lang.String,java.lang.String> attributes) throws JETException
handleExpression in interface JETParseEventListenerJETExceptionpublic void handleScriptlet(JETMark start, JETMark stop, java.util.Map<java.lang.String,java.lang.String> attributes) throws JETException
handleScriptlet in interface JETParseEventListenerJETExceptionpublic void handleCharData(char[] chars)
throws JETException
handleCharData in interface JETParseEventListenerJETExceptionpublic void addGenerator(JETGenerator gen) throws JETException
JETExceptionpublic void addCharDataGenerator(char[] chars)
throws JETException
JETExceptionpublic void doAddCharDataGenerator(char[] chars)
throws JETException
JETExceptionprotected char[] stripFirstNewLineWithBlanks(char[] chars)
protected char[] stripLastNewLineWithBlanks(char[] chars)
public void beginPageProcessing()
beginPageProcessing in interface JETParseEventListenerpublic void endPageProcessing()
throws JETException
endPageProcessing in interface JETParseEventListenerJETExceptionpublic JETCompilationUnit getResult()
public void parse()
throws JETException
JETExceptionprotected void parse(JETCoreElement[] coreElements, java.lang.Class<?>[] accept) throws JETException
JETExceptionpublic void generate(java.io.OutputStream oStream)
throws JETException
JETExceptionpublic void generate(java.io.Writer writer)
throws JETException
JETExceptionpublic JETSkeleton getSkeleton()
protected static java.lang.String[] resolveLocation(java.lang.String[] templateURIPath,
java.lang.String baseLocationURI,
java.lang.String locationURI)
protected static java.lang.String[] resolveLocation(java.lang.String[] templateURIPath,
int start,
java.lang.String baseLocationURI,
java.lang.String locationURI)
public static java.lang.String[] findLocation(java.lang.String[] locationURIPath,
int start,
java.lang.String relativeLocationURI)
public static java.lang.String[] findLocation(java.lang.String[] locationURIPath,
int start,
java.lang.String relativeLocationURI,
JETCompiler.JETInputStreamHandler inputStreamHandler)
public static java.lang.String find(java.lang.String[] locationURIPath,
java.lang.String relativeLocationURI)
public static java.io.InputStream openStream(java.lang.String locationURI)
throws JETException
JETExceptionpublic static java.io.InputStream openStream(java.lang.String locationURI,
JETCompiler.JETInputStreamHandler inputStreamHandler)
throws JETException
JETExceptionCopyright © 2019. Licensed under the Eclipse Public License v2.0. All rights reserved.
Submit a bug or feature