org.eclipse.wst.jsdt.core.dom

## Class ChildPropertyDescriptor

- java.lang.Object
- - org.eclipse.wst.jsdt.core.dom.StructuralPropertyDescriptor
  - - org.eclipse.wst.jsdt.core.dom.ChildPropertyDescriptor

    public final class ChildPropertyDescriptor
    extends StructuralPropertyDescriptor

Descriptor for a child property of an AST node. A child property is one whose value is an `ASTNode`.

See Also:
  `ASTNode.getStructuralProperty(StructuralPropertyDescriptor)`, `Provisional API: This class/interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is being made available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.`

### Method Summary

All Methods Instance Methods Concrete Methods
`boolean` `cycleRisk()` Returns whether this property is vulnerable to cycles.
`java.lang.Class` `getChildType()` Returns the child type of this property.
`boolean` `isMandatory()` Returns whether this property is mandatory.

### Methods inherited from class org.eclipse.wst.jsdt.core.dom.StructuralPropertyDescriptor

`getId, getNodeClass, isChildListProperty, isChildProperty, isSimpleProperty, toString`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Method Detail

#### getChildType

    public final java.lang.Class getChildType()

Returns the child type of this property.

For example, for a node type like JavaScriptUnit, the "package" property returns `PackageDeclaration.class`.

Returns:
  the child type of the property

#### isMandatory

    public final boolean isMandatory()

Returns whether this property is mandatory. A property value is not allowed to be `null` if it is mandatory.

Returns:
  `true` if the property is mandatory, and `false` if it is may be `null`

#### cycleRisk

    public final boolean cycleRisk()

Returns whether this property is vulnerable to cycles.

A property is vulnerable to cycles if a node of the owning type (that is, the type that owns this property) could legally appear in the AST subtree below this property. For example, the body property of a `FunctionDeclaration` node admits a body which might include statement that embeds another `FunctionDeclaration` node. On the other hand, the name property of a FunctionDeclaration node admits only names, and thereby excludes another FunctionDeclaration node.

Returns:
  `true` if cycles are possible, and `false` if cycles are impossible