org.onemind.jxp
Class JxpProcessingContext

java.lang.Object
  extended by org.onemind.jxp.JxpProcessingContext

 class JxpProcessingContext
extends java.lang.Object

An processing context contains everything specific to a specific execution of an JxpPage so that there's only one parser needed for all the processings

Author:
TiongHiang Lee (thlee@onemindsoft.org)

Field Summary
private  JxpPage _currentPage
          the current page
private static org.onemind.commons.java.lang.reflect.ClassLookupCache _default_imports
          default imports *
private  org.onemind.commons.java.lang.reflect.ClassLookupCache _imports
          the imports *
private static java.util.logging.Logger _logger
          the logger *
private  org.onemind.commons.java.datastructure.NametableStack _nametableStack
          the name tables *
private  java.util.Stack _ntStack
          the nametable scope stack
private  java.util.Stack _pageStack
          the stack of pages in current processing context *
private  java.util.List _staticImports
          the static imports
private  java.util.Map _userDefinedFunctions
          the functions map
private  java.io.Writer _writer
          the writer *
private static java.lang.String KEY_CONTEXT
           
private static java.lang.String KEY_SCRIPT_NAME
           
private static java.lang.String KEY_WRITER
           
 
Constructor Summary
JxpProcessingContext(java.io.Writer writer, java.util.Map env)
          
 
Method Summary
 void addStaticImport(StaticImport sImport)
          Add static import
 JxpPage getCurrentPage()
          Get the current page
 org.onemind.commons.java.lang.reflect.ClassLookupCache getImports()
          Return the imports
 org.onemind.commons.java.datastructure.NametableStack getNametableStack()
          Return the name table stack
 java.util.List getStaticImports()
          Get static imports
 java.util.Map getUserDefinedFunctions()
          Return the functions
 java.io.Writer getWriter()
          Get the writer
 void popPage(JxpPage page)
          Pop the current page
 void pushPage(JxpPage page)
          Push current page to the page stack
protected  java.lang.Class resolveClass(java.lang.String className)
          Resolve a class
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_logger

private static final java.util.logging.Logger _logger
the logger *


_default_imports

private static final org.onemind.commons.java.lang.reflect.ClassLookupCache _default_imports
default imports *


KEY_SCRIPT_NAME

private static final java.lang.String KEY_SCRIPT_NAME
See Also:
Constant Field Values

KEY_WRITER

private static final java.lang.String KEY_WRITER
See Also:
Constant Field Values

KEY_CONTEXT

private static final java.lang.String KEY_CONTEXT
See Also:
Constant Field Values

_imports

private org.onemind.commons.java.lang.reflect.ClassLookupCache _imports
the imports *


_writer

private java.io.Writer _writer
the writer *


_pageStack

private java.util.Stack _pageStack
the stack of pages in current processing context *


_ntStack

private java.util.Stack _ntStack
the nametable scope stack


_currentPage

private JxpPage _currentPage
the current page


_nametableStack

private org.onemind.commons.java.datastructure.NametableStack _nametableStack
the name tables *


_userDefinedFunctions

private java.util.Map _userDefinedFunctions
the functions map


_staticImports

private java.util.List _staticImports
the static imports

Constructor Detail

JxpProcessingContext

public JxpProcessingContext(java.io.Writer writer,
                            java.util.Map env)

Method Detail

pushPage

public final void pushPage(JxpPage page)
Push current page to the page stack

Parameters:
page - the page

getCurrentPage

public final JxpPage getCurrentPage()
Get the current page

Returns:
the current page

popPage

public final void popPage(JxpPage page)
                   throws java.lang.IllegalStateException
Pop the current page

Parameters:
page - the current page
Throws:
java.lang.IllegalStateException - if the page is not current page

resolveClass

protected final java.lang.Class resolveClass(java.lang.String className)
Resolve a class

Parameters:
className - the class name
Returns:
the class

getNametableStack

public final org.onemind.commons.java.datastructure.NametableStack getNametableStack()
Return the name table stack

Returns:
the name table stack

getImports

public final org.onemind.commons.java.lang.reflect.ClassLookupCache getImports()
Return the imports

Returns:
the imports

getWriter

public final java.io.Writer getWriter()
Get the writer

Returns:
the writer

getUserDefinedFunctions

public final java.util.Map getUserDefinedFunctions()
Return the functions

Returns:
the functions.

addStaticImport

public void addStaticImport(StaticImport sImport)
Add static import

Parameters:
sImport - the static import to add

getStaticImports

public final java.util.List getStaticImports()
Get static imports

Returns:
the static imports