Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2004, 2010 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;

Abstract base class of AST nodes that represent annotations.

 Annotation:
  NormalAnnotation
  MarkerAnnotation
  SingleMemberAnnotation
 

Since:
3.1
 
 public abstract class Annotation extends Expression implements IExtendedModifier {

Returns structural property descriptor for the "typeName" property of this node (child type: Name).

Returns:
the property descriptor
 
Returns structural property descriptor for the "typeName" property of this node (child type: Name).

Returns:
the property descriptor
 
 	}

Creates and returns a structural property descriptor for the "typeName" property declared on the given concrete node type (child type: Name).

Returns:
the property descriptor
 
 		return new ChildPropertyDescriptor(nodeClass"typeName"Name.class); //$NON-NLS-1$
 	}

The annotation type name; lazily initialized; defaults to an unspecified, legal Java identifier.
 
 	Name typeName = null;

Creates a new AST node for an annotation node owned by the given AST.

N.B. This constructor is package-private.

Parameters:
ast the AST that is to own this node
 
 	Annotation(AST ast) {
 		super(ast);
 	}

 
 	public boolean isModifier() {
 		return false;
 	}

 
 	public boolean isAnnotation() {
 		return true;
 	}

Returns the annotation type name of this annotation.

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

Sets the annotation type name of this annotation.

Parameters:
typeName the annotation type name
Throws:
java.lang.IllegalArgumentException if:
  • the node belongs to a different AST
  • the node already has a parent
	public void setTypeName(Name typeName) {
		if (typeName == null) {
		}
		ASTNode oldChild = this.;
		preReplaceChild(oldChildtypeNamep);
		this. = typeName;
		postReplaceChild(oldChildtypeNamep);
	}

Returns whether this is a normal annotation (NormalAnnotation).

Returns:
true if this is a normal annotation, and false otherwise
	public boolean isNormalAnnotation() {
		return (this instanceof NormalAnnotation);
	}

Returns whether this is a marker annotation (MarkerAnnotation).

Returns:
true if this is a marker annotation, and false otherwise
	public boolean isMarkerAnnotation() {
		return (this instanceof MarkerAnnotation);
	}

Returns whether this is a single member annotation. (SingleMemberAnnotation).

Returns:
true if this is a single member annotation, and false otherwise
	public boolean isSingleMemberAnnotation() {
		return (this instanceof SingleMemberAnnotation);
	}
	/* (omit javadoc for this method)
	 * Method declared on ASTNode.
	 */
	int memSize() {
		return  + 1 * 4;
	}

Resolves and returns the resolved annotation for this annotation.

Note that bindings (which includes resolved annotations) are generally unavailable unless requested when the AST is being built.

Returns:
the resolved annotation, or null if the annotation cannot be resolved
Since:
3.2
	    return this..getBindingResolver().resolveAnnotation(this);
	}
New to GrepCode? Check out our FAQ X