com.ptc.core.ca.co.client.element
Class CoElementUtils

java.lang.Object
  extended by com.ptc.core.ca.co.client.element.CoElementUtils

Deprecated.

@Deprecated
public abstract class CoElementUtils
extends Object

CoElementUtils class provides a variety of methods to manipulate element and their models.

Supported API: true

Extendable: false


Method Summary
static CoElement findDescendentById(CoElement element, String id, boolean inDepthFirst, CoEnvData envData)
          Deprecated. Gets the subelement whose configuration id matches the specified parameter id.
static ArrayList findDescendentsById(CoElement element, String id, boolean stopAtFirst, boolean inDepthFirst, CoEnvData envData)
          Deprecated. Gets the list of the subelements whose configuration id matches the specified parameter id.
static CoWizard findWizard(CoElement elem, CoEnvData envData)
          Deprecated. Returns CoWizard ancestor if any.
static ArrayList getElementInstances(CoElement element, CoEnvData envData)
          Deprecated. Returns a list of instances for the given element.
static com.infoengine.object.factory.Element getIeElement(CoInstanceHolder instanceHolder, CoEnvData envData)
          Deprecated. Returns I*E element for the given instance holder.
static com.infoengine.object.factory.Element getIeElementOfInstanceHolder(CoElement element, CoEnvData envData)
          Deprecated. Returns I*E element of the nearest instance holder.
static CoInstance getInstance(CoInstanceHolder instanceHolder, CoEnvData envData)
          Deprecated. Returns the instance of the instance holder.
static CoInstanceHolder getInstanceHolderAncestor(CoElement element)
          Deprecated. Returns the nearest instance holder element that is an ancestor of the specified element.
static ArrayList getInstanceList(CoInstanceListHolder instanceListHolder, CoEnvData envData)
          Deprecated. Returns the list of instances of the instance holder.
static CoInstanceListHolder getInstanceListHolderAncestor(CoElement element)
          Deprecated. Returns the nearest instance list holder element that is an ancestor of the specified element.
static CoModel getModel(CoModelDriven modelDriven, CoEnvData envData)
          Deprecated. Returns the model of the element.
static CoSelector getSelectorAncestor(CoElement element)
          Deprecated. Returns the nearest selector ancestor element.
static CoSelectorType getSelectorType(CoSelector selector)
          Deprecated. Returns the selector type of the specified selector element.
static CoElement giveElement(String fullAddress, CoEnvData envData)
          Deprecated. Returns an element specfied by its address.
static boolean isDirty(CoCleanable cleanable)
          Deprecated. Checks to see whether the element is dirty.
static boolean isExecutingDoer(CoCleanable cleanable)
          Deprecated. Checks to see whether we need to execute a doer to update a model.
static boolean isWizardDescendent(CoElement elem, CoEnvData envData)
          Deprecated. Returns whether the element is a descendent of a CoWizard or a CoWizard itself.
static ArrayList mergeInstanceLists(ArrayList from, ArrayList to, CoEnvData envData)
          Deprecated. Merges the from list of instances into to.
static void removeElementBranch(CoElement element, CoEnvData envData)
          Deprecated. Removes an element and all its descendants

Supported API: true
static void setElementInstances(CoElement element, ArrayList instances, CoEnvData envData)
          Deprecated. Sets a list of instances to the given element.
static void setInstance(CoInstanceHolder instanceHolder, CoInstance instance, CoEnvData envData)
          Deprecated. Sets the instance of the instance holder.
static void setInstanceList(CoInstanceListHolder instanceListHolder, ArrayList instanceList, CoEnvData envData)
          Deprecated. Sets the list of instances of the instance holder.
static void updateModel(CoModelDriven modelDriven, CoEnvData envData)
          Deprecated. When a model does not exist: creates a model assign it to the element calls init method on the model

Supported API: true
static CoElementVisitStatus visitDown(CoElement element, CoElementVisitor visitor, CoElementVisitType type, CoEnvData envData)
          Deprecated. This method traverses the element tree starting from the specified element using preorder traversal algorithm.
static CoElementVisitStatus visitDownDepthFirst(CoElement element, CoElementVisitor visitor, CoElementVisitType type, CoEnvData envData)
          Deprecated. This method traverses the element tree starting from the specified element using postorder (depth first) traversal algorithm.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

giveElement

public static CoElement giveElement(String fullAddress,
                                    CoEnvData envData)
                             throws WTException
Deprecated. 
Returns an element specfied by its address. This method delegates to getElement when memory optimization is enabled and to findElement otherwise. By default memory optimization is enabled.

Supported API: true

Parameters:
fullAddress -
envData -
Returns:
CoElement
Throws:
WTException

visitDown

public static CoElementVisitStatus visitDown(CoElement element,
                                             CoElementVisitor visitor,
                                             CoElementVisitType type,
                                             CoEnvData envData)
                                      throws WTException
Deprecated. 
This method traverses the element tree starting from the specified element using preorder traversal algorithm.

Supported API: true

Parameters:
element - Element to start from
visitor - The instance of the visitor class implementing visiting code. The instance can support more than one visitor type.
type - Visitor type. Introduced to facilicate the code reuse between visitor classes.
envData - Environement data
Returns:
CoElementVisitStatus
Throws:
WTException

visitDownDepthFirst

public static CoElementVisitStatus visitDownDepthFirst(CoElement element,
                                                       CoElementVisitor visitor,
                                                       CoElementVisitType type,
                                                       CoEnvData envData)
                                                throws WTException
Deprecated. 
This method traverses the element tree starting from the specified element using postorder (depth first) traversal algorithm.

Supported API: true

Parameters:
element - Element to start from
visitor - The instance of the visitor class implementing visiting code. The instance can support more than one visitor type.
type - Visitor type. Introduced to facilicate the code reuse between visitor classes.
envData - Environement data
Returns:
CoElementVisitStatus
Throws:
WTException

getInstance

public static CoInstance getInstance(CoInstanceHolder instanceHolder,
                                     CoEnvData envData)
                              throws WTException
Deprecated. 
Returns the instance of the instance holder.

Supported API: true

Parameters:
instanceHolder -
envData -
Returns:
CoInstance
Throws:
WTException

setInstance

public static void setInstance(CoInstanceHolder instanceHolder,
                               CoInstance instance,
                               CoEnvData envData)
                        throws WTException
Deprecated. 
Sets the instance of the instance holder.

Supported API: true

Parameters:
instanceHolder -
instance -
envData -
Throws:
WTException

getInstanceList

public static ArrayList getInstanceList(CoInstanceListHolder instanceListHolder,
                                        CoEnvData envData)
                                 throws WTException
Deprecated. 
Returns the list of instances of the instance holder.

Supported API: true

Parameters:
instanceListHolder -
envData -
Returns:
ArrayList
Throws:
WTException

setInstanceList

public static void setInstanceList(CoInstanceListHolder instanceListHolder,
                                   ArrayList instanceList,
                                   CoEnvData envData)
                            throws WTException
Deprecated. 
Sets the list of instances of the instance holder.

Supported API: true

Parameters:
instanceListHolder -
instanceList -
envData -
Throws:
WTException

mergeInstanceLists

public static ArrayList mergeInstanceLists(ArrayList from,
                                           ArrayList to,
                                           CoEnvData envData)
                                    throws WTException
Deprecated. 
Merges the from list of instances into to.

Supported API: true

Parameters:
from -
to -
envData -
Returns:
ArrayList
Throws:
WTException

getElementInstances

public static ArrayList getElementInstances(CoElement element,
                                            CoEnvData envData)
                                     throws WTException
Deprecated. 
Returns a list of instances for the given element. The element must be either an instance holder or an instance list holder.

Supported API: true

Parameters:
element -
envData -
Returns:
ArrayList
Throws:
WTException

setElementInstances

public static void setElementInstances(CoElement element,
                                       ArrayList instances,
                                       CoEnvData envData)
                                throws WTException
Deprecated. 
Sets a list of instances to the given element. The element must be either an instance holder or an instance list holder.

Supported API: true

Parameters:
element -
instances -
envData -
Throws:
WTException

getIeElement

public static com.infoengine.object.factory.Element getIeElement(CoInstanceHolder instanceHolder,
                                                                 CoEnvData envData)
                                                          throws WTException
Deprecated. 
Returns I*E element for the given instance holder.

Supported API: true

Parameters:
instanceHolder -
envData -
Returns:
Element
Throws:
WTException

getIeElementOfInstanceHolder

public static com.infoengine.object.factory.Element getIeElementOfInstanceHolder(CoElement element,
                                                                                 CoEnvData envData)
                                                                          throws WTException
Deprecated. 
Returns I*E element of the nearest instance holder. When the element is the instance holder, it's I*E element is returned. When the element is not the instance holder, I*E element of its instance holder ancestor is returned.

Supported API: true

Parameters:
element -
envData -
Returns:
Element
Throws:
WTException

getInstanceHolderAncestor

public static CoInstanceHolder getInstanceHolderAncestor(CoElement element)
                                                  throws WTException
Deprecated. 
Returns the nearest instance holder element that is an ancestor of the specified element.

Supported API: true

Parameters:
element -
Returns:
CoInstanceHolder
Throws:
WTException

getInstanceListHolderAncestor

public static CoInstanceListHolder getInstanceListHolderAncestor(CoElement element)
                                                          throws WTException
Deprecated. 
Returns the nearest instance list holder element that is an ancestor of the specified element.

Supported API: true

Parameters:
element -
Returns:
CoInstanceListHolder
Throws:
WTException

isDirty

public static boolean isDirty(CoCleanable cleanable)
                       throws WTException
Deprecated. 
Checks to see whether the element is dirty. The element is considered to be dirty when it is cleanable and its dirty flag set to true, or when one of its ancestors is cleanable and has dirty flag set to true.

Supported API: true

Parameters:
cleanable -
Returns:
boolean
Throws:
WTException

isExecutingDoer

public static boolean isExecutingDoer(CoCleanable cleanable)
                               throws WTException
Deprecated. 
Checks to see whether we need to execute a doer to update a model.

Supported API: true

Parameters:
cleanable -
Returns:
boolean
Throws:
WTException

getModel

public static CoModel getModel(CoModelDriven modelDriven,
                               CoEnvData envData)
                        throws WTException
Deprecated. 
Returns the model of the element.

Supported API: true

Parameters:
modelDriven -
envData -
Returns:
CoModel
Throws:
WTException

updateModel

public static void updateModel(CoModelDriven modelDriven,
                               CoEnvData envData)
                        throws WTException
Deprecated. 
When a model does not exist:
  • creates a model
  • assign it to the element
  • calls init method on the model


Supported API: true

Parameters:
modelDriven -
envData -
Throws:
WTException

removeElementBranch

public static void removeElementBranch(CoElement element,
                                       CoEnvData envData)
                                throws WTException
Deprecated. 
Removes an element and all its descendants

Supported API: true

Parameters:
element -
envData -
Throws:
WTException

isWizardDescendent

public static boolean isWizardDescendent(CoElement elem,
                                         CoEnvData envData)
                                  throws WTException
Deprecated. 
Returns whether the element is a descendent of a CoWizard or a CoWizard itself.

Supported API: true

Parameters:
elem -
envData -
Returns:
boolean
Throws:
WTException

findWizard

public static CoWizard findWizard(CoElement elem,
                                  CoEnvData envData)
                           throws WTException
Deprecated. 
Returns CoWizard ancestor if any.

Supported API: true

Parameters:
elem -
envData -
Returns:
CoWizard
Throws:
WTException

findDescendentsById

public static ArrayList findDescendentsById(CoElement element,
                                            String id,
                                            boolean stopAtFirst,
                                            boolean inDepthFirst,
                                            CoEnvData envData)
                                     throws WTException
Deprecated. 
Gets the list of the subelements whose configuration id matches the specified parameter id. If the parameter stopAtFirst is true, the search will stop at the first occurence of such element, so the returned list will have only one element. The parameter inDepthFirst defines the method that is going to be used for visiting. If no element is found for the specified id, the method returns null.

Supported API: true

Parameters:
element -
id -
stopAtFirst -
inDepthFirst -
envData -
Returns:
ArrayList
Throws:
WTException

findDescendentById

public static CoElement findDescendentById(CoElement element,
                                           String id,
                                           boolean inDepthFirst,
                                           CoEnvData envData)
                                    throws WTException
Deprecated. 
Gets the subelement whose configuration id matches the specified parameter id. The parameter inDepthFirst defines the method that is going to be used for visiting. If no element is found for the specified id, the method returns null.

Supported API: true

Parameters:
element -
id -
inDepthFirst -
envData -
Returns:
CoElement
Throws:
WTException

getSelectorAncestor

public static CoSelector getSelectorAncestor(CoElement element)
                                      throws WTException
Deprecated. 
Returns the nearest selector ancestor element.

Supported API: true

Parameters:
element -
Returns:
CoSelector
Throws:
WTException

getSelectorType

public static CoSelectorType getSelectorType(CoSelector selector)
                                      throws WTException
Deprecated. 
Returns the selector type of the specified selector element.

Supported API: true

Parameters:
selector -
Returns:
CoSelectorType
Throws:
WTException