com.sun.faban.harness.formsgen
Class XformsUtil

java.lang.Object
  extended by com.sun.faban.harness.formsgen.XformsUtil

public class XformsUtil
extends Object

Utilities for the XForms generation. This class actually represents the whole detailed generation mechanism. Element handlers mainly delegate to here.

Author:
Sheetal Patil

Constructor Summary
XformsUtil()
           
 
Method Summary
 void buildPropertyLabelsStack(Node eNode)
          Builds the XForms structures for driver framework property elements.
 void buildXforms()
          Puts together the whole XForms.
 void buildXformsBind(Node eNode, int spaces, String id)
          Builds the binding section for a config element.
 StringBuilder buildXformsCases(Node eNode, int spaces, String id, ArrayList<String> stack)
          Builds the display tab section for a config element.
 void buildXformsLabels(Node eNode)
          Builds the label section for a certain element.
 String getNodeValueForMatchingNode(Node eNode, String s)
          Obtains the node value for a node matching the given string.
 boolean hasMoreElements(Node node)
          Inspects whether a node has further child elements.
 String indent(int spaces)
          Creates an indent string for prepending to XML output.
 String makeLabel(String s)
          Generates a label from the given string.
 boolean needGroup(Node node)
          Checks whether an element needs grouping.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XformsUtil

public XformsUtil()
Method Detail

buildPropertyLabelsStack

public void buildPropertyLabelsStack(Node eNode)
Builds the XForms structures for driver framework property elements.

Parameters:
eNode - The corresponding property node

buildXforms

public void buildXforms()
Puts together the whole XForms.


buildXformsBind

public void buildXformsBind(Node eNode,
                            int spaces,
                            String id)
Builds the binding section for a config element.

Parameters:
eNode - The element
spaces - Leading spaces
id - The element identifier

buildXformsCases

public StringBuilder buildXformsCases(Node eNode,
                                      int spaces,
                                      String id,
                                      ArrayList<String> stack)
Builds the display tab section for a config element.

Parameters:
eNode - The element
spaces - Leading spaces
id - The element identifier
stack - The stack of elements to ignore
Returns:
The buffer containing the display part (cases) for the element

hasMoreElements

public boolean hasMoreElements(Node node)
Inspects whether a node has further child elements.

Parameters:
node - The node
Returns:
Whether a node has child elements

getNodeValueForMatchingNode

public String getNodeValueForMatchingNode(Node eNode,
                                          String s)
Obtains the node value for a node matching the given string.

Parameters:
eNode - The node
s - The string
Returns:
The node value

indent

public String indent(int spaces)
Creates an indent string for prepending to XML output.

Parameters:
spaces - The number of spaces in the indent
Returns:
The string representing the indent

needGroup

public boolean needGroup(Node node)
Checks whether an element needs grouping.

Parameters:
node - The element
Returns:
Whether the element needs grouping

makeLabel

public String makeLabel(String s)
Generates a label from the given string.

Parameters:
s - The string
Returns:
The label string

buildXformsLabels

public void buildXformsLabels(Node eNode)
Builds the label section for a certain element.

Parameters:
eNode - The element