public class JavaScriptResolution extends java.lang.Object implements Resolution
Resolution that will convert a Java object web to a web of JavaScript objects and arrays, and
stream the JavaScript back to the client. The output of this resolution can be evaluated in
JavaScript using the eval() function, and will return a reference to the top level JavaScript
object. For more information see JavaScriptBuilder
Constructor and Description |
---|
JavaScriptResolution(java.lang.Object rootObject,
java.lang.Object... objectsToExclude)
Constructs a new JavaScriptResolution that will convert the supplied object to JavaScript.
|
Modifier and Type | Method and Description |
---|---|
JavaScriptResolution |
addClassExclusion(java.lang.Class<?>... clazz)
Adds one or more classes to the list of types to exclude when translating
to JavaScript.
|
JavaScriptResolution |
addPropertyExclusion(java.lang.String... property)
Adds one or more properties to the list of types to exclude when translating
to JavaScript.
|
void |
execute(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Converts the object passed in to JavaScript and streams it back to the client.
|
public JavaScriptResolution(java.lang.Object rootObject, java.lang.Object... objectsToExclude)
rootObject
- an Object of any type supported by JavaScriptBuilder
. In most cases
this will either be a JavaBean, Map, Collection or Array, but may also be any one of
the basic Java types including String, Date, Number etc.objectsToExclude
- Classes and/or property names to exclude from the output.public JavaScriptResolution addPropertyExclusion(java.lang.String... property)
property
- one or more property names to excludepublic JavaScriptResolution addClassExclusion(java.lang.Class<?>... clazz)
clazz
- one or more classes to excludepublic void execute(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.lang.Exception
execute
in interface Resolution
request
- the current HttpServletRequestresponse
- the current HttpServletResponsejava.lang.Exception
- exceptions of any type may be thrown if the Resolution cannot be
executed as intended? Copyright 2005-2006, Stripes Development Team.