|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectverinec.util.DataUtil
public class DataUtil
Utility functions for data operations.
| Field Summary | |
|---|---|
private static XSLTransformer |
nodeRemover
A transformer to remove the <node> tags from a nodes element. |
| Constructor Summary | |
|---|---|
private |
DataUtil()
Do not instantiate DataUtil, it contains only static methods. |
| Method Summary | |
|---|---|
static List |
cloneList(List l)
Return a new list with a clone of each element in the list. |
static Element |
expandVariables(Element nodes)
Expand all variables to their values. |
static Properties |
jdomToProps(Element nodes)
Convert a nodes element's variables to properties. |
static Element |
propsToJdom(Properties vars)
Convert properties to a <nodes> jdom element containing a list of <variable>. |
static Element |
propsToJdom(Properties vars,
Namespace ns)
Convert properties to a <nodes> jdom element containing a list of <variable>. |
static Element |
removeNodeChildren(Element nodes)
Remove all node elements from a nodes document. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private static XSLTransformer nodeRemover
| Constructor Detail |
|---|
private DataUtil()
| Method Detail |
|---|
public static Element expandVariables(Element nodes)
throws VerinecException
Variables are recognized as a string of [a-zA-Z0-9_], enclosed between dollar signs $. All variables are replaced by looking up the closest value with that name in the tree. To get a $ sign in the output, you have to escape it with a backslash \$.
Normally, variables have to be defined before use. The only exception are the % special variables for java environment values. For example, $%user.name$ results in the current users username.
The variables are expected to exist in the same namespace as the document root element.
nodes - A jdom tree containing variables and nodes.
VerinecException - if a variable is not defined.
public static Element removeNodeChildren(Element nodes)
throws VerinecException
nodes - The document to treat.
VerinecException - If an error occurs during remove.public static Properties jdomToProps(Element nodes)
nodes - A nodes element according to the schema.
public static Element propsToJdom(Properties vars)
vars - A (possibly empty) list of variables.
public static Element propsToJdom(Properties vars,
Namespace ns)
vars - A (possibly empty) list of variables.ns - A Namespace to put the variable elements into.
public static List cloneList(List l)
l - The list to clone its element. Every single element must be cloneable and have a public clone method.
|
Copyright © 2005 Verinec, DIUF | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||