Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2000, 2012 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;
 
 import java.util.List;

Simple or qualified "super" method invocation expression AST node type. For JLS2:
 SuperMethodInvocation:
     [ ClassName . ] super . Identifier
         ( [ Expression { , Expression } ] )
 
For JLS3, type arguments are added:
 SuperMethodInvocation:
     [ ClassName . ] super .
         [ < Type { , Type } > ]
         Identifier ( [ Expression { , Expression } ] )
 

Since:
2.0
Noinstantiate:
This class is not intended to be instantiated by clients.
 
 public class SuperMethodInvocation extends Expression {

The "qualifier" structural property of this node type (child type: Name).

Since:
3.0
 
 	public static final ChildPropertyDescriptor QUALIFIER_PROPERTY =
 		new ChildPropertyDescriptor(SuperMethodInvocation.class"qualifier"Name.class); //$NON-NLS-1$
 
The "typeArguments" structural property of this node type (element type: Type) (added in JLS3 API).

Since:
3.1
 
 		new ChildListPropertyDescriptor(SuperMethodInvocation.class"typeArguments"Type.class); //$NON-NLS-1$
 
The "name" structural property of this node type (child type: SimpleName).

Since:
3.0
 
 	public static final ChildPropertyDescriptor NAME_PROPERTY =
 		new ChildPropertyDescriptor(SuperMethodInvocation.class"name"SimpleName.class); //$NON-NLS-1$
 
The "arguments" structural property of this node type (element type: Expression).

Since:
3.0
 
 		new ChildListPropertyDescriptor(SuperMethodInvocation.class"arguments"Expression.class); //$NON-NLS-1$
 
A list of property descriptors (element type: StructuralPropertyDescriptor), or null if uninitialized.

Since:
3.0
 
 	private static final List PROPERTY_DESCRIPTORS_2_0;

A list of property descriptors (element type: StructuralPropertyDescriptor), or null if uninitialized.

Since:
3.1
 
 	private static final List PROPERTY_DESCRIPTORS_3_0;
 
 	static {
 		List propertyList = new ArrayList(4);
 		addProperty(propertyList);
 		addProperty(propertyList);
 		addProperty(propertyList);
 
 		propertyList = new ArrayList(5);
 		addProperty(propertyList);
 		addProperty(propertyList);
 		addProperty(propertyList);
 	}

Returns a list of structural property descriptors for this node type. Clients must not modify the result.

Parameters:
apiLevel the API level; one of the AST.JLS* constants
Returns:
a list of property descriptors (element type: StructuralPropertyDescriptor)
Since:
3.0
	public static List propertyDescriptors(int apiLevel) {
		if (apiLevel == .) {
else {
		}
	}

The optional qualifier; null for none; defaults to none.
	private Name optionalQualifier = null;

The type arguments (element type: Type). Null in JLS2. Added in JLS3; defaults to an empty list (see constructor).

Since:
3.1
	private ASTNode.NodeList typeArguments = null;

The method name; lazily initialized; defaults to a unspecified, legal Java method name.
	private SimpleName methodName = null;

The list of argument expressions (element type: Expression). Defaults to an empty list.
Creates a new AST node for a "super" method invocation expression owned by the given AST. By default, no qualifier, no type arguments, an unspecified, but legal, method name, and an empty list of arguments.

Parameters:
ast the AST that is to own this node
		super(ast);
		if (ast.apiLevel >= .) {
		}
	}
	/* (omit javadoc for this method)
	 * Method declared on ASTNode.
	 */
	final List internalStructuralPropertiesForType(int apiLevel) {
		return propertyDescriptors(apiLevel);
	}
	/* (omit javadoc for this method)
	 * Method declared on ASTNode.
	 */
	final ASTNode internalGetSetChildProperty(ChildPropertyDescriptor propertyboolean getASTNode child) {
		if (property == ) {
			if (get) {
				return getQualifier();
else {
				setQualifier((Namechild);
				return null;
			}
		}
		if (property == ) {
			if (get) {
				return getName();
else {
				return null;
			}
		}
		// allow default implementation to flag the error
		return super.internalGetSetChildProperty(propertygetchild);
	}
	/* (omit javadoc for this method)
	 * Method declared on ASTNode.
	 */
		if (property == ) {
			return arguments();
		}
		if (property == ) {
			return typeArguments();
		}
		// allow default implementation to flag the error
		return super.internalGetChildListProperty(property);
	}
	/* (omit javadoc for this method)
	 * Method declared on ASTNode.
	 */
	final int getNodeType0() {
	}
	/* (omit javadoc for this method)
	 * Method declared on ASTNode.
	 */
	ASTNode clone0(AST target) {
		result.setName((SimpleNamegetName().clone(target));
		result.setQualifier((Name) ASTNode.copySubtree(targetgetQualifier()));
		if (this.. >= .) {
			result.typeArguments().addAll(ASTNode.copySubtrees(targettypeArguments()));
		}
		result.arguments().addAll(ASTNode.copySubtrees(targetarguments()));
		return result;
	}
	/* (omit javadoc for this method)
	 * Method declared on ASTNode.
	 */
	final boolean subtreeMatch0(ASTMatcher matcherObject other) {
		// dispatch to correct overloaded match method
		return matcher.match(thisother);
	}
	/* (omit javadoc for this method)
	 * Method declared on ASTNode.
	 */
	void accept0(ASTVisitor visitor) {
		boolean visitChildren = visitor.visit(this);
		if (visitChildren) {
			// visit children in normal left to right reading order
			if (this.. >= .) {
			}
			acceptChild(visitorgetName());
			acceptChildren(visitorthis.);
		}
		visitor.endVisit(this);
	}

Returns the qualifier of this "super" method invocation expression, or null if there is none.

Returns:
the qualifier name node, or null if there is none
	public Name getQualifier() {
		return this.;
	}

Returns true if the resolved return type has been inferred from the assignment context (JLS3 15.12.2.8), false otherwise.

This information is available only when bindings are requested when the AST is being built

.

Returns:
true if the resolved return type has been inferred from the assignment context (JLS3 15.12.2.8), false otherwise
Since:
3.3
	}


Sets or clears the qualifier of this "super" method invocation expression.

Parameters:
name the qualifier name node, or null if there is none
Throws:
java.lang.IllegalArgumentException if:
  • the node belongs to a different AST
  • the node already has a parent
	public void setQualifier(Name name) {
		ASTNode oldChild = this.;
		this. = name;
	}

Returns the live ordered list of type arguments of this method invocation (added in JLS3 API).

Returns:
the live list of type arguments (element type: Type)
Throws:
java.lang.UnsupportedOperationException if this operation is used in a JLS2 AST
Since:
3.1
	public List typeArguments() {
		// more efficient than just calling unsupportedIn2() to check
		if (this. == null) {
		}
		return this.;
	}

Returns the name of the method invoked in this expression.

Returns:
the method name node
	public SimpleName getName() {
		if (this. == null) {
			// lazy init must be thread-safe for readers
			synchronized (this) {
				if (this. == null) {
					this. = new SimpleName(this.);
				}
			}
		}
		return this.;
	}

Sets the name of the method invoked in this expression to the given name.

Parameters:
name the new method name
Throws:
java.lang.IllegalArgumentException if:
  • the node belongs to a different AST
  • the node already has a parent
	public void setName(SimpleName name) {
		if (name == null) {
		}
		ASTNode oldChild = this.;
		preReplaceChild(oldChildname);
		this. = name;
		postReplaceChild(oldChildname);
	}

Returns the live ordered list of argument expressions in this "super" method invocation expression.

Returns:
the live list of argument expressions (element type: Expression)
	public List arguments() {
		return this.;
	}

Resolves and returns the binding for the method invoked by this expression.

Note that bindings are generally unavailable unless requested when the AST is being built.

Returns:
the method binding, or null if the binding cannot be resolved
Since:
2.1
		return this..getBindingResolver().resolveMethod(this);
	}
	/* (omit javadoc for this method)
	 * Method declared on ASTNode.
	 */
	int memSize() {
		// treat Code as free
		return  + 4 * 4;
	}
	/* (omit javadoc for this method)
	 * Method declared on ASTNode.
	 */
	int treeSize() {
		return
			+ (this. == null ? 0 : getQualifier().treeSize())
			+ (this. == null ? 0 : this..listSize())
			+ (this. == null ? 0 : getName().treeSize())
			+ (this. == null ? 0 : this..listSize());
	}
New to GrepCode? Check out our FAQ X