Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.aendvari.common.model
Class ModelUtil  view ModelUtil download ModelUtil.java

java.lang.Object
  extended bycom.aendvari.common.model.ModelUtil

public class ModelUtil
extends java.lang.Object

Provides various utility methods for the model classes.


Constructor Summary
ModelUtil()
           
 
Method Summary
static void clearNodes(ModelNode baseNode)
          Sets the values of the supplied node and all of its children to an empty string.
protected static void examineNode(ModelNode modelNode, java.io.Writer output, java.lang.String indent)
          Outputs a single ModelNode, then recursively examines children.
static void modelToOsm(ModelNode sourceNode, com.aendvari.common.osm.OsmNode destinationNode, java.lang.String destinationExpression, boolean createNodes)
          Copies data from the ModelNode into the specified location of the supplied OSM.
static void osmToModel(com.aendvari.common.osm.OsmNode sourceNode, java.lang.String sourceExpression, ModelNode destinationNode, boolean createNodes)
          Copies data from the specified location in the supplied OSM to the destination ModelNode.
static void removeAllChildren(ModelNode modelNode)
          Removes all children of the supplied node.
static void removeAllChildren(ModelNode modelNode, java.lang.String selectExpression)
          Removes all children of the selected node.
static void removeNamedChildren(ModelNode modelNode, java.lang.String childName)
          Removes the children having the specified name from the supplied node.
protected static void updateNode(ModelTree destinationTree, ModelNode sourceNode, ModelNode destinationParent, boolean createNodes)
          Updates the value of the supplied node.
static void updateNodes(ModelNode sourceNode, java.lang.String sourceExpression, ModelNode destinationNode, java.lang.String destinationExpression, boolean createNodes)
          Updates the children of the specified ModelNode using the values stored within other ModelNodes.
static java.lang.String writeNode(ModelNode modelNode)
          Writes the supplied ModelNode and its children to a string.
static void writeNode(ModelNode modelNode, java.io.Writer output)
          Writes the supplied ModelNode and its children to output.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModelUtil

public ModelUtil()
Method Detail

updateNodes

public static void updateNodes(ModelNode sourceNode,
                               java.lang.String sourceExpression,
                               ModelNode destinationNode,
                               java.lang.String destinationExpression,
                               boolean createNodes)
Updates the children of the specified ModelNode using the values stored within other ModelNodes.


updateNode

protected static void updateNode(ModelTree destinationTree,
                                 ModelNode sourceNode,
                                 ModelNode destinationParent,
                                 boolean createNodes)
Updates the value of the supplied node. Each child node is then recursively updated.


clearNodes

public static void clearNodes(ModelNode baseNode)
Sets the values of the supplied node and all of its children to an empty string. Each child is then recursively visited and cleared.


removeNamedChildren

public static void removeNamedChildren(ModelNode modelNode,
                                       java.lang.String childName)
Removes the children having the specified name from the supplied node.


removeAllChildren

public static void removeAllChildren(ModelNode modelNode)
Removes all children of the supplied node.


removeAllChildren

public static void removeAllChildren(ModelNode modelNode,
                                     java.lang.String selectExpression)
Removes all children of the selected node.


osmToModel

public static void osmToModel(com.aendvari.common.osm.OsmNode sourceNode,
                              java.lang.String sourceExpression,
                              ModelNode destinationNode,
                              boolean createNodes)
Copies data from the specified location in the supplied OSM to the destination ModelNode.


modelToOsm

public static void modelToOsm(ModelNode sourceNode,
                              com.aendvari.common.osm.OsmNode destinationNode,
                              java.lang.String destinationExpression,
                              boolean createNodes)
Copies data from the ModelNode into the specified location of the supplied OSM.


writeNode

public static java.lang.String writeNode(ModelNode modelNode)
Writes the supplied ModelNode and its children to a string.


writeNode

public static void writeNode(ModelNode modelNode,
                             java.io.Writer output)
                      throws java.io.IOException
Writes the supplied ModelNode and its children to output.


examineNode

protected static void examineNode(ModelNode modelNode,
                                  java.io.Writer output,
                                  java.lang.String indent)
                           throws java.io.IOException
Outputs a single ModelNode, then recursively examines children.