src/share/classes/javax/lang/model/element/ExecutableElement.java

changeset 1
9a66ca7c79fa
child 224
dab918a1c907
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/src/share/classes/javax/lang/model/element/ExecutableElement.java	Sat Dec 01 00:00:00 2007 +0000
     1.3 @@ -0,0 +1,100 @@
     1.4 +/*
     1.5 + * Copyright 2005-2006 Sun Microsystems, Inc.  All Rights Reserved.
     1.6 + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     1.7 + *
     1.8 + * This code is free software; you can redistribute it and/or modify it
     1.9 + * under the terms of the GNU General Public License version 2 only, as
    1.10 + * published by the Free Software Foundation.  Sun designates this
    1.11 + * particular file as subject to the "Classpath" exception as provided
    1.12 + * by Sun in the LICENSE file that accompanied this code.
    1.13 + *
    1.14 + * This code is distributed in the hope that it will be useful, but WITHOUT
    1.15 + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    1.16 + * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    1.17 + * version 2 for more details (a copy is included in the LICENSE file that
    1.18 + * accompanied this code).
    1.19 + *
    1.20 + * You should have received a copy of the GNU General Public License version
    1.21 + * 2 along with this work; if not, write to the Free Software Foundation,
    1.22 + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    1.23 + *
    1.24 + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
    1.25 + * CA 95054 USA or visit www.sun.com if you need additional information or
    1.26 + * have any questions.
    1.27 + */
    1.28 +
    1.29 +package javax.lang.model.element;
    1.30 +
    1.31 +import java.util.List;
    1.32 +import javax.lang.model.util.Types;
    1.33 +import javax.lang.model.type.*;
    1.34 +
    1.35 +/**
    1.36 + * Represents a method, constructor, or initializer (static or
    1.37 + * instance) of a class or interface, including annotation type
    1.38 + * elements.
    1.39 + *
    1.40 + * @author Joseph D. Darcy
    1.41 + * @author Scott Seligman
    1.42 + * @author Peter von der Ahé
    1.43 + * @see ExecutableType
    1.44 + * @since 1.6
    1.45 + */
    1.46 +public interface ExecutableElement extends Element {
    1.47 +    /**
    1.48 +     * Returns the formal type parameters of this executable
    1.49 +     * in declaration order.
    1.50 +     *
    1.51 +     * @return the formal type parameters, or an empty list
    1.52 +     * if there are none
    1.53 +     */
    1.54 +    List<? extends TypeParameterElement> getTypeParameters();
    1.55 +
    1.56 +    /**
    1.57 +     * Returns the return type of this executable.
    1.58 +     * Returns a {@link NoType} with kind {@link TypeKind#VOID VOID}
    1.59 +     * if this executable is not a method, or is a method that does not
    1.60 +     * return a value.
    1.61 +     *
    1.62 +     * @return the return type of this executable
    1.63 +     */
    1.64 +    TypeMirror getReturnType();
    1.65 +
    1.66 +    /**
    1.67 +     * Returns the formal parameters of this executable.
    1.68 +     * They are returned in declaration order.
    1.69 +     *
    1.70 +     * @return the formal parameters,
    1.71 +     * or an empty list if there are none
    1.72 +     */
    1.73 +    List<? extends VariableElement> getParameters();
    1.74 +
    1.75 +    /**
    1.76 +     * Returns {@code true} if this method or constructor accepts a variable
    1.77 +     * number of arguments and returns {@code false} otherwise.
    1.78 +     *
    1.79 +     * @return {@code true} if this method or constructor accepts a variable
    1.80 +     * number of arguments and {@code false} otherwise
    1.81 +     */
    1.82 +    boolean isVarArgs();
    1.83 +
    1.84 +    /**
    1.85 +     * Returns the exceptions and other throwables listed in this
    1.86 +     * method or constructor's {@code throws} clause in declaration
    1.87 +     * order.
    1.88 +     *
    1.89 +     * @return the exceptions and other throwables listed in the
    1.90 +     * {@code throws} clause, or an empty list if there are none
    1.91 +     */
    1.92 +    List<? extends TypeMirror> getThrownTypes();
    1.93 +
    1.94 +    /**
    1.95 +     * Returns the default value if this executable is an annotation
    1.96 +     * type element.  Returns {@code null} if this method is not an
    1.97 +     * annotation type element, or if it is an annotation type element
    1.98 +     * with no default value.
    1.99 +     *
   1.100 +     * @return the default value, or {@code null} if none
   1.101 +     */
   1.102 +    AnnotationValue getDefaultValue();
   1.103 +}

mercurial