src/share/classes/com/sun/mirror/declaration/Declaration.java

Print this page




  27 
  28 
  29 import java.lang.annotation.Annotation;
  30 import java.util.Collection;
  31 
  32 import com.sun.mirror.type.*;
  33 import com.sun.mirror.util.*;
  34 
  35 
  36 /**
  37  * Represents the declaration of a program element such as a package,
  38  * class, or method.  Each declaration represents a static, language-level
  39  * construct (and not, for example, a runtime construct of the virtual
  40  * machine), and typically corresponds one-to-one with a particular
  41  * fragment of source code.
  42  *
  43  * <p> Declarations should be compared using the {@link #equals(Object)}
  44  * method.  There is no guarantee that any particular declaration will
  45  * always be represented by the same object.
  46  *





  47  * @author Joseph D. Darcy
  48  * @author Scott Seligman
  49  *
  50  * @see Declarations
  51  * @see TypeMirror
  52  * @since 1.5
  53  */
  54 

  55 public interface Declaration {
  56 
  57     /**
  58      * Tests whether an object represents the same declaration as this.
  59      *
  60      * @param obj  the object to be compared with this declaration
  61      * @return <tt>true</tt> if the specified object represents the same
  62      *          declaration as this
  63      */
  64     boolean equals(Object obj);
  65 
  66     /**
  67      * Returns the text of the documentation ("javadoc") comment of
  68      * this declaration.
  69      *
  70      * @return the documentation comment of this declaration, or <tt>null</tt>
  71      *          if there is none
  72      */
  73     String getDocComment();
  74 




  27 
  28 
  29 import java.lang.annotation.Annotation;
  30 import java.util.Collection;
  31 
  32 import com.sun.mirror.type.*;
  33 import com.sun.mirror.util.*;
  34 
  35 
  36 /**
  37  * Represents the declaration of a program element such as a package,
  38  * class, or method.  Each declaration represents a static, language-level
  39  * construct (and not, for example, a runtime construct of the virtual
  40  * machine), and typically corresponds one-to-one with a particular
  41  * fragment of source code.
  42  *
  43  * <p> Declarations should be compared using the {@link #equals(Object)}
  44  * method.  There is no guarantee that any particular declaration will
  45  * always be represented by the same object.
  46  *
  47  * @deprecated All components of this API have been superseded by the
  48  * standardized annotation processing API.  The replacement for the
  49  * functionality of this interface is {@link
  50  * javax.lang.model.element.Element}.
  51  *
  52  * @author Joseph D. Darcy
  53  * @author Scott Seligman
  54  *
  55  * @see Declarations
  56  * @see TypeMirror
  57  * @since 1.5
  58  */
  59 @Deprecated
  60 @SuppressWarnings("deprecation")
  61 public interface Declaration {
  62 
  63     /**
  64      * Tests whether an object represents the same declaration as this.
  65      *
  66      * @param obj  the object to be compared with this declaration
  67      * @return <tt>true</tt> if the specified object represents the same
  68      *          declaration as this
  69      */
  70     boolean equals(Object obj);
  71 
  72     /**
  73      * Returns the text of the documentation ("javadoc") comment of
  74      * this declaration.
  75      *
  76      * @return the documentation comment of this declaration, or <tt>null</tt>
  77      *          if there is none
  78      */
  79     String getDocComment();
  80