public final class CompiledTagInvocation extends java.lang.Object
Invokes a tag whose namespace and name are known without going through Groovy's method dispatch.
Calling a tag as g.message(code: 'x') reaches the tag library through invokeMethod, which means a dynamic call site in the caller's bytecode even when that caller is
statically compiled. The tag being called is fixed in the source, so once it has been resolved
against the tag library index there is nothing left to decide at runtime beyond which bean holds it.
This is the entry point such a call is expressed as: an ordinary method call taking the namespace and name as arguments. It applies the same attribute and body handling, output capture, encoding and return-object behaviour as the dynamic path, because both end at TagOutput.captureTagOutput.
| Type Params | Return Type | Name and description |
|---|---|---|
|
public static java.lang.Object |
invoke(TagLibraryLookup lookup, java.lang.String namespace, java.lang.String tagName, java.util.Map<?, ?> attrs, java.lang.Object body)Invokes a tag with attributes and a body. |
|
public static java.lang.Object |
invoke(TagLibraryLookup lookup, java.lang.String namespace, java.lang.String tagName, java.util.Map<?, ?> attrs, java.lang.Object body, OutputContext outputContext)Invokes a tag against a known output context, for a caller that already has one to hand. |
|
public static java.lang.Object |
invokeArguments(TagLibraryLookup lookup, java.lang.String namespace, java.lang.String tagName, java.lang.Object args)Invokes a tag with whatever arguments the call was written with. |
|
public static java.lang.Object |
invokeArgumentsInContext(TagLibraryLookup lookup, java.lang.String namespace, java.lang.String tagName, OutputContext outputContext, java.lang.Object args)Invokes a tag with whatever arguments the call was written with, against a known output context. |
| Methods inherited from class | Name |
|---|---|
class java.lang.Object |
java.lang.Object#equals(java.lang.Object), java.lang.Object#getClass(), java.lang.Object#hashCode(), java.lang.Object#notify(), java.lang.Object#notifyAll(), java.lang.Object#toString(), java.lang.Object#wait(), java.lang.Object#wait(long), java.lang.Object#wait(long, int) |
Invokes a tag with attributes and a body.
lookup - the tag libraries available to the callernamespace - the tag library namespacetagName - the tag name within that namespaceattrs - the tag attributes, treated as empty when nullbody - the tag body as a closure or as text, or null when there is noneInvokes a tag against a known output context, for a caller that already has one to hand.
lookup - the tag libraries available to the callernamespace - the tag library namespacetagName - the tag name within that namespaceattrs - the tag attributes, treated as empty when nullbody - the tag body as a closure or as text, or null when there is noneoutputContext - where the tag writesInvokes a tag with whatever arguments the call was written with.
A tag call is written in more shapes than attributes and a body: with nothing, with a body alone, or with a single value that the tag reads under its own name. Where the shape is not evident in the source - a map held in a variable, say - the arguments are only known once they have been evaluated, which is what this takes.
lookup - the tag libraries available to the callernamespace - the tag library namespacetagName - the tag name within that namespaceargs - the evaluated arguments, in the order they were writtenInvokes a tag with whatever arguments the call was written with, against a known output context.
lookup - the tag libraries available to the callernamespace - the tag library namespacetagName - the tag name within that namespaceoutputContext - where the tag writesargs - the evaluated arguments, in the order they were written