org.eclipse.emf.codegen.jet
Class JETCompiler

java.lang.Object
  |
  +--org.eclipse.emf.codegen.jet.JETCompiler
All Implemented Interfaces:
JETParseEventListener
Direct Known Subclasses:
JETEmitter.MyJETCompiler

public class JETCompiler
extends java.lang.Object
implements JETParseEventListener


Field Summary
protected static java.lang.String CONSTANT_PREFIX
           
protected  long constantCount
           
protected  java.util.Map constantDictionary
           
protected  java.util.List constants
           
protected  boolean fNoNewLineForScriptlets
           
protected  char[] fSavedLine
           
protected  boolean fUseStaticFinalConstants
           
protected  java.util.List generators
           
protected static char[] NULL_CHAR_ARRAY
           
protected  JETParser parser
           
protected  JETReader reader
           
protected  JETSkeleton skeleton
           
protected  java.lang.String templateURI
           
protected  java.lang.String[] templateURIPath
           
protected  java.io.PrintWriter writer
           
 
Constructor Summary
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 templateURI, java.io.InputStream inputStream, java.lang.String encoding)
           
JETCompiler(java.lang.String templateURI, java.lang.String encoding)
           
 
Method Summary
 void addCharDataGenerator(char[] chars)
           
 void addGenerator(JETGenerator gen)
           
 void beginPageProcessing()
           
 void endPageProcessing()
           
static java.lang.String find(java.lang.String[] locationURIPath, java.lang.String relativeLocationURI)
           
 void generate(java.io.OutputStream oStream)
           
 java.lang.String getResolvedTemplateURI()
           
 JETSkeleton getSkeleton()
           
 void handleCharData(char[] chars)
           
 void handleDirective(java.lang.String directive, JETMark start, JETMark stop, java.util.Map attributes)
           
 void handleExpression(JETMark start, JETMark stop, java.util.Map attributes)
           
protected  void handleNewSkeleton()
           
 void handleScriptlet(JETMark start, JETMark stop, java.util.Map attributes)
           
static java.io.InputStream openStream(java.lang.String locationURI)
           
 void parse()
           
protected  void parse(JETCoreElement[] coreElements, java.lang.Class[] accept)
           
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)
           
 
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 java.lang.String[] templateURIPath

templateURI

protected java.lang.String templateURI

parser

protected JETParser parser

skeleton

protected JETSkeleton skeleton

reader

protected JETReader reader

writer

protected java.io.PrintWriter writer

generators

protected java.util.List generators

constants

protected java.util.List constants

constantDictionary

protected java.util.Map constantDictionary

constantCount

protected long constantCount

fNoNewLineForScriptlets

protected boolean fNoNewLineForScriptlets

fUseStaticFinalConstants

protected boolean fUseStaticFinalConstants

fSavedLine

protected char[] fSavedLine

CONSTANT_PREFIX

protected static final java.lang.String CONSTANT_PREFIX
Constructor Detail

JETCompiler

public JETCompiler(java.lang.String templateURI)
            throws JETException

JETCompiler

public JETCompiler(java.lang.String templateURI,
                   java.lang.String encoding)
            throws JETException

JETCompiler

public JETCompiler(java.lang.String templateURI,
                   java.io.InputStream inputStream,
                   java.lang.String encoding)
            throws JETException

JETCompiler

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

JETCompiler

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

getResolvedTemplateURI

public java.lang.String getResolvedTemplateURI()

handleDirective

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

handleNewSkeleton

protected void handleNewSkeleton()

handleExpression

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

handleScriptlet

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

handleCharData

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

addGenerator

public void addGenerator(JETGenerator gen)
                  throws JETException

addCharDataGenerator

public void addCharDataGenerator(char[] chars)
                          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

parse

public void parse()
           throws JETException

parse

protected void parse(JETCoreElement[] coreElements,
                     java.lang.Class[] accept)
              throws JETException

generate

public void generate(java.io.OutputStream oStream)
              throws JETException

getSkeleton

public JETSkeleton getSkeleton()

resolveLocation

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

find

public static java.lang.String find(java.lang.String[] locationURIPath,
                                    java.lang.String relativeLocationURI)

openStream

public static java.io.InputStream openStream(java.lang.String locationURI)
                                      throws JETException

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