|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.ejen.util.XSLUtil
XSL utility (static methods used in java code).
Constructor Summary | |
protected |
XSLUtil()
Prevents instanciation. |
Method Summary | |
static boolean |
equals(NodeIterator ni1,
NodeIterator ni2)
Checks ni1 and ni2 for strict equality (same names, same attributes, same child nodes...). |
static boolean |
equals(Node n1,
Node n2)
Checks n1 and n2 for strict equality (same names, same attributes, same child nodes...). |
static String |
evaluate(ExpressionContext context,
String avt)
Returns an interpreted value (AVT) of a Node attribute whose name is equals to the avt parameter. |
static XObject |
evaluate(Node contextNode,
String str)
Returns an XObject resulting from the evaluation of the str parameter. |
static XObject |
evaluate(Node contextNode,
String str,
ErrorListener el)
Returns an XObject resulting from the evaluation of the str parameter. |
static XObject |
evaluate(Node contextNode,
String str,
Node namespaceNode,
ErrorListener el)
Returns an XObject resulting from the evaluation of the str parameter. |
static String |
evaluate(XSLProcessorContext context,
ElemExtensionCall elem)
Returns an interpreted value (AVT) of a Node attribute whose name is "avt". |
static XObject |
evaluate(XSLProcessorContext context,
ElemExtensionCall elem,
String expression)
Returns the interpretion (AVT) of the expression parameter. |
static String |
evaluateAttribute(StylesheetHandler sh,
XPathContext xpc,
Node node,
String expr)
Returns a String resulting from the evaluation of the expr parameter (AVT). |
static String |
getAttribute(XSLProcessorContext context,
ElemExtensionCall elem,
String name,
boolean throwsIfNull)
Returns an interpreted value (AVT) of a Node attribute whose name is 'name'. |
static Document |
getContextDocument(ExpressionContext context)
Returns the Document used in the context parameter. |
static TransformerImpl |
getDefaultTransformer(TransformerFactoryImpl tfi)
Returns a new TransformerImpl using the EjenConstants.DEFAULT_XSL_DATA
String as source. |
static Object |
getOAttribute(XSLProcessorContext context,
ElemExtensionCall elem,
String name,
Class clazz,
boolean isAVT,
boolean throwsIfNull)
Returns an Object value (AVT or not) of a Node attribute whose name is 'name'. |
static XObject |
getXOAttribute(XSLProcessorContext context,
ElemExtensionCall elem,
String name,
boolean isAVT,
boolean throwsIfNull)
Returns an XObject value (AVT or not) of a Node attribute whose name is 'name'. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected XSLUtil()
Method Detail |
public static TransformerImpl getDefaultTransformer(TransformerFactoryImpl tfi)
EjenConstants.DEFAULT_XSL_DATA
String as source.
tfi
- the TransformerFactoryImpl to use to build the TransformerImpl.
WrappedRuntimeException
- ...public static String getAttribute(XSLProcessorContext context, ElemExtensionCall elem, String name, boolean throwsIfNull)
context
- the XSLProcessorContext to be used.elem
- the ElemExtensionCall to be used.name
- name of the attribute.throwsIfNull
- if true, an IllegalArgumentException will be thrown
if no 'name' attribute can be found, otherwise null will returned.
IllegalArgumentException
- ...
WrappedRuntimeException
- ...public static XObject getXOAttribute(XSLProcessorContext context, ElemExtensionCall elem, String name, boolean isAVT, boolean throwsIfNull)
context
- the XSLProcessorContext to be used.elem
- the ElemExtensionCall to be used.name
- name of the attribute.isAVT
- should the value be interpreted as an AVT?throwsIfNull
- if true, an IllegalArgumentException will be thrown
if no 'name' attribute can be found, otherwise null will returned.
IllegalArgumentException
- ...
WrappedRuntimeException
- ...public static Object getOAttribute(XSLProcessorContext context, ElemExtensionCall elem, String name, Class clazz, boolean isAVT, boolean throwsIfNull)
context
- the XSLProcessorContext to be used.elem
- the ElemExtensionCall to be used.name
- name of the attribute.clazz
- Class of the Object to return.isAVT
- should the value be interpreted as an AVT?throwsIfNull
- if true, an IllegalArgumentException will be thrown
if no 'name' attribute can be found, otherwise null will returned.
ClassCastException
- if the Object is not an instance of
clazz.
IllegalArgumentException
- ...
WrappedRuntimeException
- ...public static String evaluate(XSLProcessorContext context, ElemExtensionCall elem)
context
- the XSLProcessorContext to be used.elem
- the ElemExtensionCall to be used.
IllegalArgumentException
- bad context.
WrappedRuntimeException
- ...public static String evaluate(ExpressionContext context, String avt)
context
- the ExpressionContext to be used.avt
- the name of the attribute.
IllegalArgumentException
- bad context.
WrappedRuntimeException
- ...public static XObject evaluate(XSLProcessorContext context, ElemExtensionCall elem, String expression)
context
- the XSLProcessorContext to be used.elem
- the ElemExtensionCall to be used.expression
- the expression to be evaluated.
WrappedRuntimeException
- ...public static XObject evaluate(Node contextNode, String str)
contextNode
- the Node to be used as context.str
- the expression to be evaluated.
WrappedRuntimeException
- ...public static XObject evaluate(Node contextNode, String str, ErrorListener el)
contextNode
- the Node to be used as context.str
- the expression to be evaluated.el
- the ErrorListener to be used.
WrappedRuntimeException
- ...public static XObject evaluate(Node contextNode, String str, Node namespaceNode, ErrorListener el)
contextNode
- the Node to be used as context.str
- the expression to be evaluated.namespaceNode
- the namespace Node to be used.el
- the ErrorListener to be used.
WrappedRuntimeException
- ...public static String evaluateAttribute(StylesheetHandler sh, XPathContext xpc, Node node, String expr) throws TransformerException
sh
- the StylesheetHandler to be used.xpc
- the XPathContext to be used.node
- the Node to be used as context.expr
- the expression to be evaluated.
TransformerException
- ...public static boolean equals(NodeIterator ni1, NodeIterator ni2)
ni1
- the first NodeIterator.ni2
- the second NodeIterator.
public static boolean equals(Node n1, Node n2)
n1
- the first Node.n2
- the second Node.
public static Document getContextDocument(ExpressionContext context)
context
- an ExpressionContext.
WrappedRuntimeException
- failed...
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |