org.eclipse.wst.jsdt.core

## Interface IParent

All Known Subinterfaces:
  IClassFile, IExportContainer, IField, IFunction, IImportContainer, IInitializer, IJavaScriptModel, IJavaScriptProject, IJavaScriptUnit, IMember, IPackageFragment, IPackageFragmentRoot, IType, ITypeRoot

    public interface IParent

Common protocol for JavaScript elements that contain other JavaScript elements.

This interface is not intended to be implemented by clients.

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 Abstract Methods
`IJavaScriptElement[]` `getChildren()` Returns the immediate children of this element.
`boolean` `hasChildren()` Returns whether this element has one or more immediate children.

### Method Detail

#### getChildren

    IJavaScriptElement[] getChildren()
                              throws JavaScriptModelException

Returns the immediate children of this element. Unless otherwise specified by the implementing element, the children are in no particular order.

Returns:
  the immediate children of this element
Throws:
  `JavaScriptModelException` - if this element does not exist or if an exception occurs while accessing its corresponding resource

#### hasChildren

    boolean hasChildren()
                 throws JavaScriptModelException

Returns whether this element has one or more immediate children. This is a convenience method, and may be more efficient than testing whether `getChildren` is an empty array.

Returns:
  true if the immediate children of this element, false otherwise
Throws:
  `JavaScriptModelException` - if this element does not exist or if an exception occurs while accessing its corresponding resource