Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2004, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html Contributors: IBM Corporation - initial API and implementation /
package org.eclipse.jdt.core.dom;

Descriptor for a simple property of an AST node. A simple property is one whose value is a primitive type (such as int or boolean) or some simple value type (such as String or InfixExpression.Operator).

public final class SimplePropertyDescriptor extends StructuralPropertyDescriptor {

Value type. For example, for a node type like SingleVariableDeclaration, the modifiers property is int.class
	private final Class valueType;

Indicates whether a value is mandatory. A property value is allowed to be null only if it is not mandatory.
	private final boolean mandatory;

Creates a new simple property descriptor with the given property id. Note that this constructor is declared package-private so that property descriptors can only be created by the AST implementation.

Parameters:
nodeClass concrete AST node type that owns this property
propertyId the property id
valueType the value type of this property
mandatory true if the property is mandatory, and false if it is may be null
	SimplePropertyDescriptor(Class nodeClassString propertyIdClass valueTypeboolean mandatory) {
		super(nodeClasspropertyId);
		if (valueType == null || ASTNode.class.isAssignableFrom(valueType)) {
		}
		this. = valueType;
		this. = mandatory;
	}

Returns the value type of this property.

For example, for a node type like SingleVariableDeclaration, the "modifiers" property returns int.class.

Returns:
the value type of the property
	public Class getValueType() {
		return this.;
	}

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
	public boolean isMandatory() {
		return this.;
	}
New to GrepCode? Check out our FAQ X