Package org.eclipse.jdt.core.dom
Class ChildPropertyDescriptor
- java.lang.Object
-
- org.eclipse.jdt.core.dom.StructuralPropertyDescriptor
-
- org.eclipse.jdt.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 anASTNode.- Since:
- 3.0
- See Also:
ASTNode.getStructuralProperty(StructuralPropertyDescriptor),ASTNode.setStructuralProperty(StructuralPropertyDescriptor, Object)- Restriction:
- This class is not intended to be instantiated by clients.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancycleRisk()Returns whether this property is vulnerable to cycles.ClassgetChildType()Returns the child type of this property.booleanisMandatory()Returns whether this property is mandatory.-
Methods inherited from class org.eclipse.jdt.core.dom.StructuralPropertyDescriptor
getId, getNodeClass, isChildListProperty, isChildProperty, isSimpleProperty, toString
-
-
-
-
Method Detail
-
getChildType
public final Class getChildType()
Returns the child type of this property.For example, for a node type like CompilationUnit, 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 benullif it is mandatory.- Returns:
trueif the property is mandatory, andfalseif it is may benull
-
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
MethodDeclarationnode admits a body which might include statement that embeds anotherMethodDeclarationnode. On the other hand, the name property of a MethodDeclaration node admits only names, and thereby excludes another MethodDeclaration node.- Returns:
trueif cycles are possible, andfalseif cycles are impossible
-
-