|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.velocity.runtime.directive.Directive
com.opensymphony.webwork.views.velocity.AbstractTagDirective
Custom user Directive that enables the WebWork2 UI tags to be easily accessed from Velocity pages
Field Summary | |
protected static org.apache.commons.logging.Log |
log
|
protected static Map |
tagclassMap
a params of tagname to tagclass that provides faster lookup that searching through the tagpath. |
static String |
VELOCITY_WRITER
|
Fields inherited from class org.apache.velocity.runtime.directive.Directive |
rsvc |
Fields inherited from interface org.apache.velocity.runtime.directive.DirectiveConstants |
BLOCK, LINE |
Constructor Summary | |
AbstractTagDirective()
|
Method Summary | |
protected Object |
createObject(org.apache.velocity.runtime.parser.node.Node node)
create a new instance of our rendering object. |
protected Map |
createPropertyMap(org.apache.velocity.context.InternalContextAdapter contextAdapter,
org.apache.velocity.runtime.parser.node.Node node)
create a Map of properties that the user has passed in. |
protected Class |
findTagInPath(String tagname)
Searches for tags (class that are instances of Renderers or Tags) in the webwork.velocity.tag.path using the following rules: append the tagname + 'Tag' to the path and see if a class exists and is a Renderer or Tag append the tagname to the path and see if a class exists and is a Renderer or Tag For example, let us say that we're search for a custom tag, Foobar. |
protected String[] |
getTagPath()
todo it would be nice for the Configuration object to allow listeners to be registered so that they can be notified of changes to the Configuration files |
protected boolean |
processTag(PageContext pageContext,
Tag tag,
org.apache.velocity.context.InternalContextAdapter context,
Writer writer,
org.apache.velocity.runtime.parser.node.Node node,
org.apache.velocity.runtime.parser.node.Node bodyNode)
|
protected void |
putProperty(Map propertyMap,
org.apache.velocity.context.InternalContextAdapter contextAdapter,
org.apache.velocity.runtime.parser.node.Node node)
adds a given Node's key/value pair to the propertyMap. |
boolean |
render(org.apache.velocity.context.InternalContextAdapter contextAdapter,
Writer writer,
org.apache.velocity.runtime.parser.node.Node node)
the guts of this directive that indicates how this directive should be rendered. |
Methods inherited from class org.apache.velocity.runtime.directive.Directive |
getColumn, getLine, getName, getType, init, setLocation |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static org.apache.commons.logging.Log log
public static final String VELOCITY_WRITER
protected static Map tagclassMap
#tag( TextField )would result in "TextField" and com.opensymphony.webwork.views.jsp.ui.TextFieldTag.class being stored in the tagclassMap todo enable this params to be reloaded or reset
Constructor Detail |
public AbstractTagDirective()
Method Detail |
public boolean render(org.apache.velocity.context.InternalContextAdapter contextAdapter, Writer writer, org.apache.velocity.runtime.parser.node.Node node) throws IOException, org.apache.velocity.exception.ResourceNotFoundException, org.apache.velocity.exception.ParseErrorException, org.apache.velocity.exception.MethodInvocationException
IOException
org.apache.velocity.exception.ResourceNotFoundException
org.apache.velocity.exception.ParseErrorException
org.apache.velocity.exception.MethodInvocationException
protected String[] getTagPath() throws org.apache.velocity.exception.ResourceNotFoundException
org.apache.velocity.exception.ResourceNotFoundException
protected Object createObject(org.apache.velocity.runtime.parser.node.Node node) throws org.apache.velocity.exception.ResourceNotFoundException
node
- the node that contains the label for our rendering object. this will usually be something like
TextField, Password, or Component
org.apache.velocity.exception.ResourceNotFoundException
protected Map createPropertyMap(org.apache.velocity.context.InternalContextAdapter contextAdapter, org.apache.velocity.runtime.parser.node.Node node) throws org.apache.velocity.exception.ParseErrorException, org.apache.velocity.exception.MethodInvocationException
#tag( TextField "name=hello" "value=world" "template=foo" )would yield a params that contains {["name", "hello"], ["value", "world"], ["template", "foo"]}
node
- the Node passed in to the render method
org.apache.velocity.exception.ParseErrorException
- if the was an error in the format of the property
org.apache.velocity.exception.MethodInvocationException
render(org.apache.velocity.context.InternalContextAdapter, java.io.Writer, org.apache.velocity.runtime.parser.node.Node)
protected Class findTagInPath(String tagname) throws org.apache.velocity.exception.ResourceNotFoundException
tagname
-
org.apache.velocity.exception.ResourceNotFoundException
getTagPath()
protected boolean processTag(PageContext pageContext, Tag tag, org.apache.velocity.context.InternalContextAdapter context, Writer writer, org.apache.velocity.runtime.parser.node.Node node, org.apache.velocity.runtime.parser.node.Node bodyNode) throws org.apache.velocity.exception.ParseErrorException, IOException, org.apache.velocity.exception.MethodInvocationException, org.apache.velocity.exception.ResourceNotFoundException
org.apache.velocity.exception.ParseErrorException
IOException
org.apache.velocity.exception.MethodInvocationException
org.apache.velocity.exception.ResourceNotFoundException
protected void putProperty(Map propertyMap, org.apache.velocity.context.InternalContextAdapter contextAdapter, org.apache.velocity.runtime.parser.node.Node node) throws org.apache.velocity.exception.ParseErrorException, org.apache.velocity.exception.MethodInvocationException
propertyMap
- a params containing all the properties that we wish to setnode
- the parameter to set expressed in "name=value" format
org.apache.velocity.exception.ParseErrorException
org.apache.velocity.exception.MethodInvocationException
|
WebWork Project Page | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |