org.eclipse.emf.codegen.jet
Class JETCompiler

java.lang.Object
  extended byorg.eclipse.emf.codegen.jet.JETCompiler
All Implemented Interfaces:
JETParseEventListener
Direct Known Subclasses:
JETEmitter.MyJETCompiler

public class JETCompiler
extends Object
implements JETParseEventListener


Field Summary
protected static String CONSTANT_PREFIX
           
protected  long constantCount
           
protected  Map constantDictionary
           
protected  List constants
           
protected  boolean fNoNewLineForScriptlets
           
protected  char[] fSavedLine
           
protected  boolean fUseStaticFinalConstants
           
protected  List generators
           
protected static char[] NULL_CHAR_ARRAY
           
protected  JETParser parser
           
protected  JETReader reader
           
protected  JETSkeleton skeleton
           
protected  String templateURI
           
protected  String[] templateURIPath
           
protected  PrintWriter writer
           
 
Constructor Summary
JETCompiler(String templateURI)
           
JETCompiler(String[] templateURIPath, String relativeTemplateURI)
           
JETCompiler(String[] templateURIPath, String relativeTemplateURI, String encoding)
           
JETCompiler(String templateURI, InputStream inputStream, String encoding)
           
JETCompiler(String templateURI, String encoding)
           
 
Method Summary
 void addCharDataGenerator(char[] chars)
           
 void addGenerator(JETGenerator gen)
           
 void beginPageProcessing()
           
 void doAddCharDataGenerator(char[] chars)
           
 void endPageProcessing()
           
static String find(String[] locationURIPath, String relativeLocationURI)
           
 void generate(OutputStream oStream)
           
 String getResolvedTemplateURI()
           
 JETSkeleton getSkeleton()
           
 void handleCharData(char[] chars)
           
 void handleDirective(String directive, JETMark start, JETMark stop, Map attributes)
           
 void handleExpression(JETMark start, JETMark stop, Map attributes)
           
protected  void handleNewSkeleton()
           
 void handleScriptlet(JETMark start, JETMark stop, Map attributes)
           
static InputStream openStream(String locationURI)
           
 void parse()
           
protected  void parse(JETCoreElement[] coreElements, Class[] accept)
           
protected static String[] resolveLocation(String[] templateURIPath, String baseLocationURI, String locationURI)
           
protected  char[] stripFirstNewLineWithBlanks(char[] chars)
           
protected  char[] stripLastNewLineWithBlanks(char[] chars)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NULL_CHAR_ARRAY

protected static final char[] NULL_CHAR_ARRAY

templateURIPath

protected String[] templateURIPath

templateURI

protected String templateURI

parser

protected JETParser parser

skeleton

protected JETSkeleton skeleton

reader

protected JETReader reader

writer

protected PrintWriter writer

generators

protected List generators

constants

protected List constants

constantDictionary

protected Map constantDictionary

constantCount

protected long constantCount

fNoNewLineForScriptlets

protected boolean fNoNewLineForScriptlets

fUseStaticFinalConstants

protected boolean fUseStaticFinalConstants

fSavedLine

protected char[] fSavedLine

CONSTANT_PREFIX

protected static final String CONSTANT_PREFIX
See Also:
Constant Field Values
Constructor Detail

JETCompiler

public JETCompiler(String templateURI)
            throws JETException

JETCompiler

public JETCompiler(String templateURI,
                   String encoding)
            throws JETException

JETCompiler

public JETCompiler(String templateURI,
                   InputStream inputStream,
                   String encoding)
            throws JETException

JETCompiler

public JETCompiler(String[] templateURIPath,
                   String relativeTemplateURI)
            throws JETException

JETCompiler

public JETCompiler(String[] templateURIPath,
                   String relativeTemplateURI,
                   String encoding)
            throws JETException
Method Detail

getResolvedTemplateURI

public String getResolvedTemplateURI()

handleDirective

public void handleDirective(String directive,
                            JETMark start,
                            JETMark stop,
                            Map attributes)
                     throws JETException
Specified by:
handleDirective in interface JETParseEventListener
Throws:
JETException

handleNewSkeleton

protected void handleNewSkeleton()

handleExpression

public void handleExpression(JETMark start,
                             JETMark stop,
                             Map attributes)
                      throws JETException
Specified by:
handleExpression in interface JETParseEventListener
Throws:
JETException

handleScriptlet

public void handleScriptlet(JETMark start,
                            JETMark stop,
                            Map attributes)
                     throws JETException
Specified by:
handleScriptlet in interface JETParseEventListener
Throws:
JETException

handleCharData

public void handleCharData(char[] chars)
                    throws JETException
Specified by:
handleCharData in interface JETParseEventListener
Throws:
JETException

addGenerator

public void addGenerator(JETGenerator gen)
                  throws JETException
Throws:
JETException

addCharDataGenerator

public void addCharDataGenerator(char[] chars)
                          throws JETException
Throws:
JETException

doAddCharDataGenerator

public void doAddCharDataGenerator(char[] chars)
                            throws JETException
Throws:
JETException

stripFirstNewLineWithBlanks

protected char[] stripFirstNewLineWithBlanks(char[] chars)

stripLastNewLineWithBlanks

protected char[] stripLastNewLineWithBlanks(char[] chars)

beginPageProcessing

public void beginPageProcessing()
Specified by:
beginPageProcessing in interface JETParseEventListener

endPageProcessing

public void endPageProcessing()
                       throws JETException
Specified by:
endPageProcessing in interface JETParseEventListener
Throws:
JETException

parse

public void parse()
           throws JETException
Throws:
JETException

parse

protected void parse(JETCoreElement[] coreElements,
                     Class[] accept)
              throws JETException
Throws:
JETException

generate

public void generate(OutputStream oStream)
              throws JETException
Throws:
JETException

getSkeleton

public JETSkeleton getSkeleton()

resolveLocation

protected static String[] resolveLocation(String[] templateURIPath,
                                          String baseLocationURI,
                                          String locationURI)

find

public static String find(String[] locationURIPath,
                          String relativeLocationURI)

openStream

public static InputStream openStream(String locationURI)
                              throws JETException
Throws:
JETException

Copyright 2001-2004 IBM Corporation and others.
All Rights Reserved.