Example usage for org.dom4j Node isReadOnly

List of usage examples for org.dom4j Node isReadOnly

Introduction

In this page you can find the example usage for org.dom4j Node isReadOnly.

Prototype

boolean isReadOnly();

Source Link

Document

isReadOnly returns true if this node is read only and cannot be modified.

Usage

From source file:org.pentaho.platform.engine.services.solution.ComponentBase.java

License:Open Source License

/**
 * Return the xml Node containing the component's definition. If <code>process</code> is true, visit every child
 * node in the tree, and if the child node's text is an action parameter convert it to it's value. (See doc for
 * applyInputsToFormat())/*from  w  w  w  .j  av a2  s . c o m*/
 * 
 * @param process
 *          if true, if the node's text represents a parameter, convert the parameter to it's value, and assign
 *          the value to the node's text.
 * 
 * @return Node containing this component's definition.
 */
@SuppressWarnings("unchecked")
public Node getComponentDefinition(final boolean process) {
    if (process) {
        List nodes = componentDefinition.selectNodes("//*"); //$NON-NLS-1$
        Iterator it = nodes.iterator();
        while (it.hasNext()) {
            Node node = (Node) it.next();
            String txt = node.getText();
            if ((txt != null) && !node.isReadOnly()) {
                node.setText(applyInputsToFormat(txt));
            }
        }
    }
    return componentDefinition;
}