|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.dvsl.DVSL
public class DVSL
Main DVSL class - use this as the helper class for apps
Nested Class Summary | |
---|---|
protected static class |
DVSL.LogAdapter
|
Constructor Summary | |
---|---|
DVSL()
|
Method Summary | |
---|---|
Object |
getAppValue(Object key)
Gets the application value for the specified key |
static void |
main(String[] args)
Allows command-line access. |
protected void |
makeReady()
sets up all the context goodies |
Object |
putAppValue(Object key,
Object value)
Sets the application value for the specified key |
void |
setClassLoader(ClassLoader classLoader)
Specify a classloader for loading the Toolbox classes. |
void |
setLogChute(LogChute logger)
lets the user specify a class instance for logging. |
void |
setLogFile(File logFile)
lets the user specify a filename for logging. |
void |
setLogSystem(LogSystem logger)
Deprecated. use setLogChute instead |
void |
setStylesheet(File stylesheet)
Convenience function. |
void |
setStylesheet(File stylesheet,
String stylesheetEncoding)
Convenience function. |
void |
setStylesheet(Reader styleReader)
Sets the stylesheet for this transformation set |
void |
setStylesheet(String stylesheet)
Convenience function. |
void |
setToolbox(Properties p)
Loads the toolbox from the input Properties. |
void |
setUserContext(Context ctx)
Sets the user context. |
void |
setValidatingParser(boolean validate)
Uses a validating parser on all input documents |
void |
setVelocityConfig(Map map)
lets the user pass a java.util.Properties containing properties for the configuration of the VelocityEngine used by DVSL |
long |
transform(org.dom4j.Document dom4jdoc,
Writer writer)
Transforms the given dom4j Document into the writer. |
long |
transform(File f,
Writer writer)
|
long |
transform(InputStream is,
Writer writer)
|
long |
transform(Reader reader,
Writer writer)
|
long |
transform(String infile,
Writer writer)
|
protected long |
xform(org.dom4j.Document dom4jdoc,
Writer writer)
|
protected long |
xform(Reader reader,
Writer writer)
does the transformation of the inputstream into the output writer |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DVSL()
Method Detail |
---|
public void setLogFile(File logFile)
lets the user specify a filename for logging.
public void setLogSystem(LogSystem logger)
lets the user specify a class instance for logging.
public void setLogChute(LogChute logger)
lets the user specify a class instance for logging.
public void setVelocityConfig(Map map)
lets the user pass a java.util.Properties containing properties for the configuration of the VelocityEngine used by DVSL
public void setUserContext(Context ctx)
Sets the user context. The user context is a Velocity Context containing user-supplied objects and data that are to be made available in the template
ctx
- User context of datapublic void setValidatingParser(boolean validate)
Uses a validating parser on all input documents
validate
- public void setClassLoader(ClassLoader classLoader)
Specify a classloader for loading the Toolbox classes. Setting to null resets to the default ClassLoader.
classLoader
- ClassLoader or null for default ClassLoaderpublic void setToolbox(Properties p) throws ClassNotFoundException, InstantiationException, IllegalAccessException
Loads the toolbox from the input Properties.
Currently supports specification of the Toolbox name in the context, creating classes, and string and integer values. Ex :
toolbox.contextname = floyd toolbox.tool.footool = Footool toolbox.string.mystring = Hello there! toolbox.integer.myint = 7 toolbox.string.sourcebase = ./xdocs/
So in template, this toolbox and it's values would be accessed as :
$context.floyd.footool.getFoo() $context.floyd.mystring $context.floyd.myint
ClassNotFoundException
InstantiationException
IllegalAccessException
public void setStylesheet(String stylesheet) throws Exception
Exception
public void setStylesheet(File stylesheet) throws Exception
Exception
public void setStylesheet(File stylesheet, String stylesheetEncoding) throws Exception
Exception
public void setStylesheet(Reader styleReader) throws Exception
Sets the stylesheet for this transformation set
Note that don't need this for each document you want to transform. Just do it once, and transform away...
styleReader
- Reader with stylesheet char stream
Exception
protected void makeReady()
protected long xform(Reader reader, Writer writer) throws Exception
Exception
protected long xform(org.dom4j.Document dom4jdoc, Writer writer) throws Exception
Exception
public long transform(File f, Writer writer) throws Exception
Exception
public long transform(Reader reader, Writer writer) throws Exception
Exception
public long transform(InputStream is, Writer writer) throws Exception
Exception
public long transform(org.dom4j.Document dom4jdoc, Writer writer) throws Exception
dom4jdoc
- dom4j Document objectwriter
- Writer for output
Exception
public long transform(String infile, Writer writer) throws Exception
Exception
public Object getAppValue(Object key)
key
- key to use to retrieve value
public Object putAppValue(Object key, Object value)
key
- key to use to store valuevalue
- value to be stored
public static void main(String[] args) throws Exception
Allows command-line access.
Usage : java -jar dvsl.jar -STYLE stylesheeet [-IN infile] [-OUT outfile] [-TOOL toolboxname]
Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |