|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object org.thymeleaf.DOMExecution
public final class DOMExecution
This class manages a couple of flags used for indicating that a node in the template DOM (or the whole tree of nodes below it) has no reason to be executed (either because it should not be executed to avoid issues like code injection, or because we can assure there are no processors in any of the dialects that can be applied to it).
Among other uses, these flags are set into Text nodes that are created during template processing. The presence of this flag disallows the execution of text inlining on nodes already generated from template code, effectively avoiding code injection.
These flags are set as Node user data using the
(Node.setUserData(String, Object, org.w3c.dom.UserDataHandler)
)
method.
This class should only be directly used when creating custom processors/dialects.
Nested Class Summary | |
---|---|
static class |
DOMExecution.NonExecutableNodeHandler
|
static class |
DOMExecution.NonExecutableTreeHandler
|
Method Summary | |
---|---|
static void |
clearExecutabilityFlags(Node node)
|
static boolean |
isExecutableNode(Node node)
Returns whether a node has any of the executable flags (either the node-specific one or the tree-wide one). |
static boolean |
isExecutableTree(Node node)
Returns whether a node has the executable tree flag set, which means that neither this node is executable nor any of its children. |
static void |
setExecutableNode(Node node,
boolean executable)
Sets or cleans the flag indicating a node should not be executed. |
static void |
setExecutableTree(Node node,
boolean executable)
Sets or cleans the flag indicating neither the node nor any of its children should not be executed. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static boolean isExecutableNode(Node node)
Returns whether a node has any of the executable flags (either the node-specific one or the tree-wide one).
node
- the node to be queried.
public static boolean isExecutableTree(Node node)
Returns whether a node has the executable tree flag set, which means that neither this node is executable nor any of its children.
node
- the node to be queried.
public static void setExecutableNode(Node node, boolean executable)
Sets or cleans the flag indicating a node should not be executed. This flag has no influence in the execution of this node's children.
node
- the node to be applied the flag.executable
- whether the node should be considered executable (clean the flag)
of non-executable (set the flag).public static void setExecutableTree(Node node, boolean executable)
Sets or cleans the flag indicating neither the node nor any of its children should not be executed.
node
- the node to be applied the flag.executable
- whether the node should be considered executable (clean the flag)
of non-executable (set the flag).public static void clearExecutabilityFlags(Node node)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |