< prev index next >

src/jdk.jdi/share/classes/com/sun/jdi/ReferenceType.java

Print this page
rev 17275 : 8181417: Code cleanups in com.sun.jdi
   1 /*
   2  * Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  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


  61  * <p>
  62  * Any method on <code>ReferenceType</code> which directly or
  63  * indirectly takes <code>ReferenceType</code> as an parameter may throw
  64  * {@link com.sun.jdi.VMOutOfMemoryException} if the target VM has run out of memory.
  65  * <p>
  66  * Any method on <code>ReferenceType</code> or which directly or indirectly takes
  67  * <code>ReferenceType</code> as parameter may throw
  68  * {@link com.sun.jdi.ObjectCollectedException} if the mirrored type has been unloaded.
  69  *
  70  * @see ObjectReference
  71  * @see ObjectReference#referenceType
  72  * @see VirtualMachine
  73  * @see VirtualMachine#allClasses
  74  *
  75  * @author Robert Field
  76  * @author Gordon Hirsch
  77  * @author James McIlree
  78  * @since  1.3
  79  */
  80 public interface ReferenceType
  81     extends Type, Comparable<ReferenceType>, Accessible
  82 {
  83 
  84     /**
  85      * Gets the fully qualified name of this type. The returned name
  86      * is formatted as it might appear in a Java programming langauge
  87      * declaration for objects of this type.
  88      * <p>
  89      * For primitive classes
  90      * the returned name is the name of the corresponding primitive
  91      * type; for example, "int" is returned as the name of the class
  92      * represented by {@link java.lang.Integer#TYPE Integer.TYPE}.
  93      * @return a string containing the type name.
  94      */
  95     String name();
  96 
  97     /**
  98      * Gets the generic signature for this type if there is one.
  99      * Generic signatures are described in the
 100      * <cite>The Java&trade; Virtual Machine Specification</cite>.
 101      *
 102      * @return a string containing the generic signature, or <code>null</code>


 598      * @param stratum The stratum to retrieve information from
 599      * or <code>null</code> for the {@link #defaultStratum()}.
 600      *
 601      * @param sourceName Return locations only within this
 602      * source file or <code>null</code> to return locations.
 603      *
 604      * @return a List of all source line {@link Location} objects.
 605      *
 606      * @throws AbsentInformationException if there is no line
 607      * number information for this class and there are non-native,
 608      * non-abstract executable members of this class.
 609      * Or if <i>sourceName</i> is non-<code>null</code>
 610      * and source name information is not present.
 611      *
 612      * @throws ClassNotPreparedException if this class not yet
 613      * been prepared.
 614      *
 615      * @since 1.4
 616      */
 617     List<Location> allLineLocations(String stratum, String sourceName)
 618                              throws AbsentInformationException;
 619 
 620     /**
 621      * Returns a List containing all {@link Location} objects
 622      * that map to the given line number.
 623      * <P>
 624      * This method is equivalent to
 625      * <code>locationsOfLine(vm.getDefaultStratum(), null,
 626      * lineNumber)</code> -
 627      * see {@link
 628      * #locationsOfLine(java.lang.String,java.lang.String,int)}
 629      * for more information.
 630      *
 631      * @param lineNumber the line number
 632      *
 633      * @return a List of all {@link Location} objects that map to
 634      * the given line.
 635      *
 636      * @throws AbsentInformationException if there is no line
 637      * number information for this class.
 638      *


 833      * compatibility.
 834      *
 835      * For arrays ({@link ArrayType}) and primitive classes,
 836      * a zero length byte array is returned.
 837      *
 838      * Not all target virtual machines support this operation.
 839      * Use {@link VirtualMachine#canGetConstantPool()}
 840      * to determine if the operation is supported.
 841      *
 842      * @return the raw bytes of constant pool.
 843      *
 844      * @throws java.lang.UnsupportedOperationException if
 845      * the target virtual machine does not support this
 846      * operation - see
 847      * {@link VirtualMachine#canGetConstantPool() canGetConstantPool()}
 848      *
 849      * @see #constantPoolCount()
 850      * @since 1.6
 851      */
 852      byte[] constantPool();
 853 
 854 }
   1 /*
   2  * Copyright (c) 1998, 2017, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  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


  61  * <p>
  62  * Any method on <code>ReferenceType</code> which directly or
  63  * indirectly takes <code>ReferenceType</code> as an parameter may throw
  64  * {@link com.sun.jdi.VMOutOfMemoryException} if the target VM has run out of memory.
  65  * <p>
  66  * Any method on <code>ReferenceType</code> or which directly or indirectly takes
  67  * <code>ReferenceType</code> as parameter may throw
  68  * {@link com.sun.jdi.ObjectCollectedException} if the mirrored type has been unloaded.
  69  *
  70  * @see ObjectReference
  71  * @see ObjectReference#referenceType
  72  * @see VirtualMachine
  73  * @see VirtualMachine#allClasses
  74  *
  75  * @author Robert Field
  76  * @author Gordon Hirsch
  77  * @author James McIlree
  78  * @since  1.3
  79  */
  80 public interface ReferenceType
  81     extends Type, Comparable<ReferenceType>, Accessible {

  82 
  83     /**
  84      * Gets the fully qualified name of this type. The returned name
  85      * is formatted as it might appear in a Java programming langauge
  86      * declaration for objects of this type.
  87      * <p>
  88      * For primitive classes
  89      * the returned name is the name of the corresponding primitive
  90      * type; for example, "int" is returned as the name of the class
  91      * represented by {@link java.lang.Integer#TYPE Integer.TYPE}.
  92      * @return a string containing the type name.
  93      */
  94     String name();
  95 
  96     /**
  97      * Gets the generic signature for this type if there is one.
  98      * Generic signatures are described in the
  99      * <cite>The Java&trade; Virtual Machine Specification</cite>.
 100      *
 101      * @return a string containing the generic signature, or <code>null</code>


 597      * @param stratum The stratum to retrieve information from
 598      * or <code>null</code> for the {@link #defaultStratum()}.
 599      *
 600      * @param sourceName Return locations only within this
 601      * source file or <code>null</code> to return locations.
 602      *
 603      * @return a List of all source line {@link Location} objects.
 604      *
 605      * @throws AbsentInformationException if there is no line
 606      * number information for this class and there are non-native,
 607      * non-abstract executable members of this class.
 608      * Or if <i>sourceName</i> is non-<code>null</code>
 609      * and source name information is not present.
 610      *
 611      * @throws ClassNotPreparedException if this class not yet
 612      * been prepared.
 613      *
 614      * @since 1.4
 615      */
 616     List<Location> allLineLocations(String stratum, String sourceName)
 617         throws AbsentInformationException;
 618 
 619     /**
 620      * Returns a List containing all {@link Location} objects
 621      * that map to the given line number.
 622      * <P>
 623      * This method is equivalent to
 624      * <code>locationsOfLine(vm.getDefaultStratum(), null,
 625      * lineNumber)</code> -
 626      * see {@link
 627      * #locationsOfLine(java.lang.String,java.lang.String,int)}
 628      * for more information.
 629      *
 630      * @param lineNumber the line number
 631      *
 632      * @return a List of all {@link Location} objects that map to
 633      * the given line.
 634      *
 635      * @throws AbsentInformationException if there is no line
 636      * number information for this class.
 637      *


 832      * compatibility.
 833      *
 834      * For arrays ({@link ArrayType}) and primitive classes,
 835      * a zero length byte array is returned.
 836      *
 837      * Not all target virtual machines support this operation.
 838      * Use {@link VirtualMachine#canGetConstantPool()}
 839      * to determine if the operation is supported.
 840      *
 841      * @return the raw bytes of constant pool.
 842      *
 843      * @throws java.lang.UnsupportedOperationException if
 844      * the target virtual machine does not support this
 845      * operation - see
 846      * {@link VirtualMachine#canGetConstantPool() canGetConstantPool()}
 847      *
 848      * @see #constantPoolCount()
 849      * @since 1.6
 850      */
 851      byte[] constantPool();

 852 }
< prev index next >