getChildPropsWithPrefix()

Retrieves all child properties for the hierarchical connector configuration property whose names match a specified prefix.

Syntax

public CWProperty[] getChildPropsWithPrefix(String propPrefix);

Parameters

propPrefix
Specifies the prefix to match in searching for child properties of the hierarchical connector configuration property.

Return values

A reference to an array of CWProperty objects, each of which represents one connector property in the hierarchical connector property whose name begins with the specified propPrefix. If no child properties exist in the hierarchical connector property with the specified prefix, the method returns null.

Exceptions

None.

Notes

The getChildPropsWithPrefix() method retrieves all child properties for the hierarchical connector configuration property whose name begins with the specified propPrefix. The retrieved properties are only those of the children of the current hierarchical property; they do not include any grandchildren, great-grandchildren, and so on. To retrieve child properties at lower levels in the hierarchy, you must first obtain the connector-property object for a property at a particular level and then use a method such as getHierChildProps() or getHierChildProp() to retrieve its children.

Note:
You can use the getHierProp() to retrieve a specified child, grandchild, and so on down the property hierarchy.

For example, suppose you configure properties for multiple listeners with the following property hierarchy shown in Figure 70.

Figure 70. Sample property hierarchy for protocol listeners
ProtocolListener
    SingleValProp1=dexter
    Listener1=first listener
        Port=1500
    Listener2=second listener
        Port=1502
    SingleValProp2=tashi

To obtain all the properties with the prefix of "Listener", you must first retrieve the top-level connector-object for ProtocolListener (for example, into topLevelProp). You can then use the following call to retrieve both the Listener1 and Listener2 child properties of ProtocolListener:

CWProperty[] listenerProps = topLevelProp.getChildPropsWithPrefix("Listener");

Before a call to getChildPropsWithPrefix(), you can use the hasChildren() method to verify that the hierarchical connector property has child properties. To retrieve a specified child property, use the getHierChildProp() method. To retrieve all child properties, regardless of prefix, you can use the getHierChildProps() method.

See also

getHierChildProp(),, getHierChildProps(),, getHierProp(),, hasChildren()

Copyright IBM Corp. 1997, 2004