< prev index next >

src/java.base/share/classes/java/lang/invoke/TypeDescriptor.java

Print this page




  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 package java.lang.invoke;
  26 
  27 import java.util.List;
  28 
  29 /**
  30  * An entity that has a field or method type descriptor
  31  *
  32  * @jvms 4.3.2 Field Descriptors
  33  * @jvms 4.3.3 Method Descriptors
  34  *
  35  * @since 12
  36  */
  37 public interface TypeDescriptor {
  38     /**
  39      * Return the type descriptor string for this instance, which must be either
  40      * a field type descriptor (JVMS 4.3.2) or method type descriptor (JVMS 4.3.3).
  41      *
  42      * @return the type descriptor










  43      * @jvms 4.3.2 Field Descriptors
  44      * @jvms 4.3.3 Method Descriptors
  45      */
  46     String descriptorString();
  47 
  48 
  49     /**
  50      * An entity that has a field type descriptor
  51      *
  52      * @param <F> the class implementing {@linkplain TypeDescriptor.OfField}
  53      * @jvms 4.3.2 Field Descriptors
  54      * @since 12
  55      */
  56     interface OfField<F extends TypeDescriptor.OfField<F>> extends TypeDescriptor {
  57         /**
  58          * Does this field descriptor describe an array type?
  59          * @return whether this field descriptor describes an array type
  60          */
  61         boolean isArray();
  62 




  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 package java.lang.invoke;
  26 
  27 import java.util.List;
  28 
  29 /**
  30  * An entity that has a type descriptor.
  31  *
  32  * @jvms 4.3.2 Field Descriptors
  33  * @jvms 4.3.3 Method Descriptors
  34  *
  35  * @since 12
  36  */
  37 public interface TypeDescriptor {
  38     /**
  39      * Return the descriptor string for this {@code TypeDescriptor} object.

  40      *
  41      * If this {@code TypeDescriptor} object can be described nominally, then
  42      * this method returns a field type descriptor (JVMS {@jvms 4.3.2}) or
  43      * method type descriptor (JVMS {@jvms 4.3.3}).  The result descriptor
  44      * can be used to produce a {@linkplain java.lang.constant.ConstantDesc
  45      * nominal descriptor}.
  46      *
  47      * Otherwise, the result string is not a valid type descriptor and
  48      * no {@linkplain java.lang.constant.ConstantDesc nominal descriptor}
  49      * can be produced from the result string.
  50      *
  51      * @return the descriptor string for this {@code TypeDescriptor} object
  52      * @jvms 4.3.2 Field Descriptors
  53      * @jvms 4.3.3 Method Descriptors
  54      */
  55     String descriptorString();
  56 
  57 
  58     /**
  59      * An entity that has a field type descriptor
  60      *
  61      * @param <F> the class implementing {@linkplain TypeDescriptor.OfField}
  62      * @jvms 4.3.2 Field Descriptors
  63      * @since 12
  64      */
  65     interface OfField<F extends TypeDescriptor.OfField<F>> extends TypeDescriptor {
  66         /**
  67          * Does this field descriptor describe an array type?
  68          * @return whether this field descriptor describes an array type
  69          */
  70         boolean isArray();
  71 


< prev index next >