com.metamatrix.jdbc.api
Class DefaultDisplayHelper

java.lang.Object
  extended by com.metamatrix.jdbc.api.DefaultDisplayHelper
All Implemented Interfaces:
DisplayHelper

public class DefaultDisplayHelper
extends java.lang.Object
implements DisplayHelper

Implement a default display helper that can be used with the TextOutputVisitor and XMLOutputVisitor.


Constructor Summary
DefaultDisplayHelper()
           
 
Method Summary
 java.lang.String getDescription(PlanNode node)
          Get the description to use for this plan node, which is usually displayed after the name as a short description.
 java.lang.String getName(PlanNode node)
          Get the name to use for this plan node.
 java.util.List getOrderedProperties(PlanNode node)
          Determine the proper order to display the properties of the node.
 java.lang.String getPropertyName(java.lang.String property)
          Get display name for a particular property name.
 void setMaxDescriptionLength(int length)
          A max description length so that the description can be truncated when necessary.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultDisplayHelper

public DefaultDisplayHelper()
Method Detail

getName

public java.lang.String getName(PlanNode node)
Description copied from interface: DisplayHelper
Get the name to use for this plan node. An obvious implementation is to use the node's type.

Specified by:
getName in interface DisplayHelper
Parameters:
node - The node
Returns:
The name, based on the node's information

getDescription

public java.lang.String getDescription(PlanNode node)
Description copied from interface: DisplayHelper
Get the description to use for this plan node, which is usually displayed after the name as a short description. The description should pull out the most important information for a particular node type.

Specified by:
getDescription in interface DisplayHelper
Parameters:
node - The node
Returns:
The description

getOrderedProperties

public java.util.List getOrderedProperties(PlanNode node)
Description copied from interface: DisplayHelper
Determine the proper order to display the properties of the node. The returned List contains the property names as found in the node's properties in the preferred order. If properties are omitted from the list, they will not be displayed. Thus, this method can also filter what properties are shown.

Specified by:
getOrderedProperties in interface DisplayHelper
Parameters:
node - The node
Returns:
List of property names

getPropertyName

public java.lang.String getPropertyName(java.lang.String property)
Description copied from interface: DisplayHelper
Get display name for a particular property name.

Specified by:
getPropertyName in interface DisplayHelper
Parameters:
property - The property name, as used in the node's properties
Returns:
The desired display name for the property

setMaxDescriptionLength

public void setMaxDescriptionLength(int length)
Description copied from interface: DisplayHelper
A max description length so that the description can be truncated when necessary.

Specified by:
setMaxDescriptionLength in interface DisplayHelper
Parameters:
length - Max string length


Copyright © 2009. All Rights Reserved.