org.apache.commons.jelly.impl
public class Embedded extends java.lang.Object
Embedded
provides easy means to embed JellyEngine
and use Jelly scripts within an application
Embedded embedded = new Embedded();
embedded.setOutputStream(new ByteArrayOutputStream());
embedded.setVariable("some-var","some-object");
.....
embedded.setScript(scriptAsString);
//or one can do.
//embedded.setScript(scriptAsInputStream);
boolean bStatus=embedded.execute();
if(!bStatus) //if error
{
String errorMsg=embedded.getErrorMsg();
}
Constructor and Description |
---|
Embedded()
Default Constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
execute()
Execute the jelly script and capture the errors (ifany)within.
|
JellyContext |
getContext()
Method getContext.
|
java.lang.String |
getErrorMsg()
Returns the errorMsg.
|
void |
registerTagLibrary(java.lang.String namespaceURI,
java.lang.String className)
Registers the given tag library class name against the given namespace URI.
|
void |
registerTagLibrary(java.lang.String namespaceURI,
TagLibrary taglib)
Registers the given tag library against the given namespace URI.
|
void |
setContext(JellyContext context)
Method setContext.
|
void |
setOutputStream(java.io.OutputStream outputStream)
Method setOutputStream.
|
void |
setScript(java.io.InputStream scriptAsInputStream)
Set the input stream
|
void |
setScript(java.lang.String scriptAsString)
Set the input script
|
void |
setVariable(java.lang.String name,
java.lang.Object value)
Set a new variable within the context for the script to use.
|
public void setContext(JellyContext context)
context
- public JellyContext getContext()
public void setVariable(java.lang.String name, java.lang.Object value)
name
- value
- public void setScript(java.lang.String scriptAsString)
scriptAsString
- public void setScript(java.io.InputStream scriptAsInputStream)
scriptAsInputStream
- public void setOutputStream(java.io.OutputStream outputStream)
outputStream
- public void registerTagLibrary(java.lang.String namespaceURI, java.lang.String className)
public void registerTagLibrary(java.lang.String namespaceURI, TagLibrary taglib)
public java.lang.String getErrorMsg()
public boolean execute()
JellyException
Copyright © 2014. All Rights Reserved.