com.dynamide.util
Class WebMacroTools

java.lang.Object
  extended by com.dynamide.util.WebMacroTools

public class WebMacroTools
extends java.lang.Object


Field Summary
static java.lang.String WEBMACROSHELL_QUIET_INIT
           
 
Constructor Summary
WebMacroTools(java.lang.String templateRoot, java.lang.String propertiesFileFullPath, boolean cache)
           
 
Method Summary
static java.lang.Object callStaticMethod(java.lang.Class theClass, java.lang.String methodName)
           
static java.lang.Object callStaticMethod(java.lang.Class theClass, java.lang.String methodName, java.lang.Class[] params, java.lang.Object[] invokeParams)
           
 void clearResults()
           
static void copyrightNotice()
           
 void destroy()
           
static java.lang.String dumpContext(org.webmacro.Context WEBMACRO_CONTEXT)
          If you want a Map, use $WEBMACRO_CONTEXT.getMap()
static java.lang.String dumpContext(org.webmacro.Context WEBMACRO_CONTEXT, boolean html)
           
 void exit()
           
static java.lang.String expand(com.icl.saxon.Context saxonContext)
           
 java.lang.String expand(org.webmacro.Context c, java.lang.String templateText)
          Before you call this method, you should call getContext(), then with that context, you should add any variables to the context with c.put(name, value), and be sure to wrap the call in a try/finally to remove the context: WebMacroTools wmt = new WebMacroTools("", "", false); Context c = wmt.getContext(); c.put("foo", foo); c.put("bar", bar); try { wmt.expand(c, templateText); } finally { wmt.releaseContext(c); wmt.destroy(); //do this if you are done with WebMacroTools. }
static java.lang.String expand(java.lang.String templateText)
           
 void finalize()
           
 boolean getAuto()
           
 boolean getBraces()
           
 org.webmacro.Context getContext()
           
 boolean getLineNumbers()
           
 boolean getNoCopyrightNotice()
           
 Opts getOpts()
           
 boolean getQuietInit()
           
 java.lang.String getResults()
           
 java.lang.String getSaveFilename()
           
 boolean getStrictLength()
           
 java.lang.String include(java.lang.String filename)
           
static java.lang.Object loadClass(java.lang.String className)
           
static java.lang.Class loadClassStatic(java.lang.String className)
           
static void main(java.lang.String[] args)
           
static void println(java.lang.String msg)
           
 void quit()
           
 void releaseContext(org.webmacro.Context c)
           
 void setAuto(boolean new_value)
           
 void setBraces(boolean new_value)
           
 void setEmulatePage(boolean val)
           
 void setLineNumbers(boolean new_value)
           
 void setNoCopyrightNotice(boolean new_value)
           
 void setQuietInit(boolean new_value)
           
 void setSaveFilename(java.lang.String new_value)
           
 void setStrictLength(boolean new_value)
           
 void shellExpand(java.lang.String line)
           
 java.lang.String shellExpand(java.lang.String line, boolean print)
           
 void source(java.lang.String filename)
           
static void usage()
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WEBMACROSHELL_QUIET_INIT

public static final java.lang.String WEBMACROSHELL_QUIET_INIT
See Also:
Constant Field Values
Constructor Detail

WebMacroTools

public WebMacroTools(java.lang.String templateRoot,
                     java.lang.String propertiesFileFullPath,
                     boolean cache)
              throws org.webmacro.InitException
Throws:
org.webmacro.InitException
Method Detail

finalize

public void finalize()
              throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable

getOpts

public Opts getOpts()

getStrictLength

public boolean getStrictLength()

setStrictLength

public void setStrictLength(boolean new_value)

setEmulatePage

public void setEmulatePage(boolean val)

getContext

public org.webmacro.Context getContext()

releaseContext

public void releaseContext(org.webmacro.Context c)

destroy

public void destroy()

quit

public void quit()

exit

public void exit()

expand

public java.lang.String expand(org.webmacro.Context c,
                               java.lang.String templateText)
                        throws java.lang.Exception
Before you call this method, you should call getContext(), then with that context, you should add any variables to the context with c.put(name, value), and be sure to wrap the call in a try/finally to remove the context:
  WebMacroTools wmt = new WebMacroTools("", "", false);
  Context c = wmt.getContext();
  c.put("foo", foo);
  c.put("bar", bar);
        try {
      wmt.expand(c, templateText);
        } finally {
      wmt.releaseContext(c);
      wmt.destroy();  //do this if you are done with WebMacroTools.
        }

 

Throws:
java.lang.Exception

expand

public static java.lang.String expand(java.lang.String templateText)
                               throws java.lang.Exception
Throws:
java.lang.Exception

expand

public static java.lang.String expand(com.icl.saxon.Context saxonContext)
                               throws java.lang.Exception
Throws:
java.lang.Exception

dumpContext

public static java.lang.String dumpContext(org.webmacro.Context WEBMACRO_CONTEXT,
                                           boolean html)

dumpContext

public static java.lang.String dumpContext(org.webmacro.Context WEBMACRO_CONTEXT)
If you want a Map, use $WEBMACRO_CONTEXT.getMap()


loadClass

public static final java.lang.Object loadClass(java.lang.String className)
                                        throws java.lang.Exception
Throws:
java.lang.Exception

loadClassStatic

public static final java.lang.Class loadClassStatic(java.lang.String className)
                                             throws java.lang.Exception
Throws:
java.lang.Exception

callStaticMethod

public static final java.lang.Object callStaticMethod(java.lang.Class theClass,
                                                      java.lang.String methodName)
                                               throws java.lang.Exception
Throws:
java.lang.Exception

callStaticMethod

public static final java.lang.Object callStaticMethod(java.lang.Class theClass,
                                                      java.lang.String methodName,
                                                      java.lang.Class[] params,
                                                      java.lang.Object[] invokeParams)
                                               throws java.lang.Exception
Throws:
java.lang.Exception

getSaveFilename

public java.lang.String getSaveFilename()

setSaveFilename

public void setSaveFilename(java.lang.String new_value)

getLineNumbers

public boolean getLineNumbers()

setLineNumbers

public void setLineNumbers(boolean new_value)

getAuto

public boolean getAuto()

setAuto

public void setAuto(boolean new_value)

getBraces

public boolean getBraces()

setBraces

public void setBraces(boolean new_value)

getQuietInit

public boolean getQuietInit()

setQuietInit

public void setQuietInit(boolean new_value)

getNoCopyrightNotice

public boolean getNoCopyrightNotice()

setNoCopyrightNotice

public void setNoCopyrightNotice(boolean new_value)

source

public void source(java.lang.String filename)
            throws java.lang.Exception
Throws:
java.lang.Exception

shellExpand

public void shellExpand(java.lang.String line)
                 throws java.lang.Exception
Throws:
java.lang.Exception

shellExpand

public java.lang.String shellExpand(java.lang.String line,
                                    boolean print)
                             throws java.lang.Exception
Throws:
java.lang.Exception

getResults

public java.lang.String getResults()

clearResults

public void clearResults()

include

public java.lang.String include(java.lang.String filename)
                         throws java.lang.Exception
Throws:
java.lang.Exception

println

public static void println(java.lang.String msg)

copyrightNotice

public static void copyrightNotice()

usage

public static void usage()

main

public static void main(java.lang.String[] args)
                 throws java.lang.Exception
Throws:
java.lang.Exception


Copyright © 2001-2013 DYNAMIDE.COM. All Rights Reserved.