ca.sqlpower.wabit
Class WabitUtils

java.lang.Object
  extended by ca.sqlpower.wabit.WabitUtils

public class WabitUtils
extends java.lang.Object


Constructor Summary
WabitUtils()
           
 
Method Summary
static java.util.List<WabitObject> getAncestorList(WabitObject o)
          This method returns a list of all of the ancestors of the given WabitObject.
static WabitSession getSession(ca.sqlpower.object.SPObject o)
          Walks up the parent chain of SPObjects and returns the WabitSession that these objects belong to.
static WabitWorkspace getWorkspace(ca.sqlpower.object.SPObject o)
          Walks up the parent chain of SPObjects and returns the WabitWorkspace that these objects belong to or null if the workspace does not exist.
static java.lang.String randomWabitUUID()
          Generates a new UUID in the format suitable for use with any WabitObject's UUID property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WabitUtils

public WabitUtils()
Method Detail

getAncestorList

public static java.util.List<WabitObject> getAncestorList(WabitObject o)
This method returns a list of all of the ancestors of the given WabitObject. The order of the ancestors is such that the highest ancestor is at the start of the list and the parent of the object itself is at the end of the list.

See Also:
SQLPowerUtils.getAncestorList(SPObject)

getWorkspace

public static WabitWorkspace getWorkspace(ca.sqlpower.object.SPObject o)
Walks up the parent chain of SPObjects and returns the WabitWorkspace that these objects belong to or null if the workspace does not exist.

Parameters:
o - The object to follow the parent chain.
Returns:
A WabitWorkspace that contains the given SPObject and all of its children or null if the given object is not in a workspace.

getSession

public static WabitSession getSession(ca.sqlpower.object.SPObject o)
Walks up the parent chain of SPObjects and returns the WabitSession that these objects belong to. This can throw a SessionNotFoundException if the object is not attached to a session.

Parameters:
o - The object to follow the parent chain.
Returns:
A WabitSession that contains the given SPObject and all of its children.

randomWabitUUID

public static java.lang.String randomWabitUUID()
Generates a new UUID in the format suitable for use with any WabitObject's UUID property.



Copyright © 2009. All Rights Reserved.