站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc (Current Development Version)

ElementUtilities (Java Source) - NetBeans API Javadoc (Current Development Version)

org.netbeans.modules.java.source 0.13.0 1

org.netbeans.api.java.source
Class ElementUtilities

java.lang.Object
  extended by org.netbeans.api.java.source.ElementUtilities

public final class ElementUtilities
extends Object


Nested Class Summary
static interface ElementUtilities.ElementAcceptor
           
 
Constructor Summary
ElementUtilities(JavacTask task)
           
 
Method Summary
 boolean alreadyDefinedIn(CharSequence name, ExecutableType method, TypeElement enclClass)
          Returns true if a method specified by name and type is defined in a class type.
 boolean assigned(Element e, Element parent)
          Returns true if the element is assigned by a specified tree.
 Element elementFor(com.sun.javadoc.Doc doc)
           
 TypeElement enclosingTypeElement(Element element)
          Returns the TypeElement which encloses the specified element.
static String getBinaryName(TypeElement element)
          Returns a binary name of a type.
 CharSequence getFullName(Element element)
          Returns the fully qualified name of this element, which is its simple name with its owner(s) prepended.
 Iterable<? extends TypeElement> getGlobalTypes(ElementUtilities.ElementAcceptor acceptor)
           
 Element getImplementationOf(ExecutableElement method, TypeElement origin)
          Returns the implementation of a method in class origin; null if none exists.
 Iterable<? extends Element> getLocalMembersAndVars(Scope scope, ElementUtilities.ElementAcceptor acceptor)
           
 Iterable<? extends Element> getLocalVars(Scope scope, ElementUtilities.ElementAcceptor acceptor)
           
 Iterable<? extends Element> getMembers(TypeMirror type, ElementUtilities.ElementAcceptor acceptor)
           
 ExecutableElement getOverriddenMethod(ExecutableElement method)
          Returns the parent method which the specified method overrides, or null if the method does not override a parent class method.
 boolean implementsMethod(ExecutableElement element)
          Returns true if this element represents a method which implements a method in an interface the parent class implements.
 boolean isLocal(Element element)
          Returns true if the element is declared (directly or indirectly) local to a method or variable initializer.
 boolean isMemberOf(Element e, TypeElement type)
          Returns true if a type element has the specified element as a member.
 boolean isSynthetic(Element element)
          Returns true if the given element is syntetic.
 com.sun.javadoc.Doc javaDocFor(Element element)
           
 TypeElement outermostTypeElement(Element element)
          The outermost TypeElement which indirectly encloses this element.
 boolean overridesMethod(ExecutableElement element)
          Returns true if this element represents a method which overrides a method in one of its superclasses.
 PackageElement packageElement(Element element)
          The package element which indirectly encloses this element..
 boolean parameter(Element e, Element parent)
          Returns true if the element is a parameter for a specified method.
 boolean referenced(Element e, Element parent)
          Returns true if the specified element is referenced by a specified tree.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ElementUtilities

public ElementUtilities(JavacTask task)
Method Detail

enclosingTypeElement

public TypeElement enclosingTypeElement(Element element)
Returns the TypeElement which encloses the specified element.


outermostTypeElement

public TypeElement outermostTypeElement(Element element)
The outermost TypeElement which indirectly encloses this element.


packageElement

public PackageElement packageElement(Element element)
The package element which indirectly encloses this element..


getImplementationOf

public Element getImplementationOf(ExecutableElement method,
                                   TypeElement origin)
Returns the implementation of a method in class origin; null if none exists.


isSynthetic

public boolean isSynthetic(Element element)
Returns true if the given element is syntetic.

Parameters:
element - to check
Returns:
true if and only if the given element is syntetic, false otherwise

overridesMethod

public boolean overridesMethod(ExecutableElement element)
Returns true if this element represents a method which overrides a method in one of its superclasses.


getBinaryName

public static String getBinaryName(TypeElement element)
                            throws IllegalArgumentException
Returns a binary name of a type.

Parameters:
element - for which the binary name should be returned
Returns:
the binary name, see Java Language Specification 13.1
Throws:
IllegalArgumentException - when the element is not a javac element

javaDocFor

public com.sun.javadoc.Doc javaDocFor(Element element)

elementFor

public Element elementFor(com.sun.javadoc.Doc doc)

getMembers

public Iterable<? extends Element> getMembers(TypeMirror type,
                                              ElementUtilities.ElementAcceptor acceptor)

getLocalMembersAndVars

public Iterable<? extends Element> getLocalMembersAndVars(Scope scope,
                                                          ElementUtilities.ElementAcceptor acceptor)

getLocalVars

public Iterable<? extends Element> getLocalVars(Scope scope,
                                                ElementUtilities.ElementAcceptor acceptor)

getGlobalTypes

public Iterable<? extends TypeElement> getGlobalTypes(ElementUtilities.ElementAcceptor acceptor)

referenced

public boolean referenced(Element e,
                          Element parent)
Returns true if the specified element is referenced by a specified tree.


assigned

public boolean assigned(Element e,
                        Element parent)
Returns true if the element is assigned by a specified tree.


parameter

public boolean parameter(Element e,
                         Element parent)
Returns true if the element is a parameter for a specified method.


isLocal

public boolean isLocal(Element element)
Returns true if the element is declared (directly or indirectly) local to a method or variable initializer. Also true for fields of inner classes which are in turn local to a method or variable initializer.


alreadyDefinedIn

public boolean alreadyDefinedIn(CharSequence name,
                                ExecutableType method,
                                TypeElement enclClass)
Returns true if a method specified by name and type is defined in a class type.


isMemberOf

public boolean isMemberOf(Element e,
                          TypeElement type)
Returns true if a type element has the specified element as a member.


getFullName

public CharSequence getFullName(Element element)
Returns the fully qualified name of this element, which is its simple name with its owner(s) prepended.


getOverriddenMethod

public ExecutableElement getOverriddenMethod(ExecutableElement method)
Returns the parent method which the specified method overrides, or null if the method does not override a parent class method.


implementsMethod

public boolean implementsMethod(ExecutableElement element)
Returns true if this element represents a method which implements a method in an interface the parent class implements.


org.netbeans.modules.java.source 0.13.0 1

Built on May 28 2007.  |  Portions Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.