< prev index next >

src/java.compiler/share/classes/javax/lang/model/util/Elements.java

Print this page




 494     List<? extends Element> getAllMembers(TypeElement type);
 495 
 496     /**
 497      * Returns all annotations <i>present</i> on an element, whether
 498      * directly present or present via inheritance.
 499      *
 500      * @param e  the element being examined
 501      * @return all annotations of the element
 502      * @see Element#getAnnotationMirrors
 503      * @see javax.lang.model.AnnotatedConstruct
 504      */
 505     List<? extends AnnotationMirror> getAllAnnotationMirrors(Element e);
 506 
 507     /**
 508      * Tests whether one type, method, or field hides another.
 509      *
 510      * @param hider   the first element
 511      * @param hidden  the second element
 512      * @return {@code true} if and only if the first element hides
 513      *          the second

 514      */
 515     boolean hides(Element hider, Element hidden);
 516 
 517     /**
 518      * Tests whether one method, as a member of a given type,
 519      * overrides another method.
 520      * When a non-abstract method overrides an abstract one, the
 521      * former is also said to <i>implement</i> the latter.
 522      *
 523      * <p> In the simplest and most typical usage, the value of the
 524      * {@code type} parameter will simply be the class or interface
 525      * directly enclosing {@code overrider} (the possibly-overriding
 526      * method).  For example, suppose {@code m1} represents the method
 527      * {@code String.hashCode} and {@code m2} represents {@code
 528      * Object.hashCode}.  We can then ask whether {@code m1} overrides
 529      * {@code m2} within the class {@code String} (it does):
 530      *
 531      * <blockquote>
 532      * {@code assert elements.overrides(m1, m2,
 533      *          elements.getTypeElement("java.lang.String")); }




 494     List<? extends Element> getAllMembers(TypeElement type);
 495 
 496     /**
 497      * Returns all annotations <i>present</i> on an element, whether
 498      * directly present or present via inheritance.
 499      *
 500      * @param e  the element being examined
 501      * @return all annotations of the element
 502      * @see Element#getAnnotationMirrors
 503      * @see javax.lang.model.AnnotatedConstruct
 504      */
 505     List<? extends AnnotationMirror> getAllAnnotationMirrors(Element e);
 506 
 507     /**
 508      * Tests whether one type, method, or field hides another.
 509      *
 510      * @param hider   the first element
 511      * @param hidden  the second element
 512      * @return {@code true} if and only if the first element hides
 513      *          the second
 514      * @jls 8.4.8 Inheritance, Overriding, and Hiding
 515      */
 516     boolean hides(Element hider, Element hidden);
 517 
 518     /**
 519      * Tests whether one method, as a member of a given type,
 520      * overrides another method.
 521      * When a non-abstract method overrides an abstract one, the
 522      * former is also said to <i>implement</i> the latter.
 523      *
 524      * <p> In the simplest and most typical usage, the value of the
 525      * {@code type} parameter will simply be the class or interface
 526      * directly enclosing {@code overrider} (the possibly-overriding
 527      * method).  For example, suppose {@code m1} represents the method
 528      * {@code String.hashCode} and {@code m2} represents {@code
 529      * Object.hashCode}.  We can then ask whether {@code m1} overrides
 530      * {@code m2} within the class {@code String} (it does):
 531      *
 532      * <blockquote>
 533      * {@code assert elements.overrides(m1, m2,
 534      *          elements.getTypeElement("java.lang.String")); }


< prev index next >