0N/A/*
2362N/A * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
0N/A *
0N/A * This code is free software; you can redistribute it and/or modify it
0N/A * under the terms of the GNU General Public License version 2 only, as
2362N/A * published by the Free Software Foundation. Oracle designates this
0N/A * particular file as subject to the "Classpath" exception as provided
2362N/A * by Oracle in the LICENSE file that accompanied this code.
0N/A *
0N/A * This code is distributed in the hope that it will be useful, but WITHOUT
0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
0N/A * version 2 for more details (a copy is included in the LICENSE file that
0N/A * accompanied this code).
0N/A *
0N/A * You should have received a copy of the GNU General Public License version
0N/A * 2 along with this work; if not, write to the Free Software Foundation,
0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0N/A *
2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A * or visit www.oracle.com if you need additional information or have any
2362N/A * questions.
0N/A */
0N/A
0N/Apackage com.sun.jdi;
0N/A
0N/Aimport java.util.List;
0N/Aimport java.util.Map;
0N/A
0N/A/**
0N/A * The type of an object in a target VM. ReferenceType encompasses
4008N/A * classes, interfaces, and array types as defined in
4008N/A * <cite>The Java&trade; Language Specification</cite>.
0N/A * All ReferenceType objects belong to one of the following
0N/A * subinterfaces:
0N/A * {@link ClassType} for classes,
0N/A * {@link InterfaceType} for interfaces, and
0N/A * {@link ArrayType} for arrays.
0N/A * Note that primitive classes (for example, the
0N/A * {@link ClassObjectReference#reflectedType() reflected type} of
0N/A * {@link java.lang.Integer#TYPE Integer.TYPE})
0N/A * are represented as ClassType.
0N/A * The VM creates Class objects for all three, so from the VM perspective,
0N/A * each ReferenceType maps to a distinct Class object.
0N/A * <p>
0N/A * ReferenceTypes can
0N/A * be obtained by querying a particular {@link ObjectReference} for its
0N/A * type or by getting a list of all reference types from the
0N/A * {@link VirtualMachine}.
0N/A * <p>
0N/A * ReferenceType provides access to static type information such as
0N/A * methods and fields and provides access to dynamic type
0N/A * information such as the corresponding Class object and the classloader.
0N/A * <p>
0N/A * Any method on <code>ReferenceType</code> which directly or
0N/A * indirectly takes <code>ReferenceType</code> as an parameter may throw
0N/A * {@link com.sun.jdi.VMDisconnectedException} if the target VM is
0N/A * disconnected and the {@link com.sun.jdi.event.VMDisconnectEvent} has been or is
0N/A * available to be read from the {@link com.sun.jdi.event.EventQueue}.
0N/A * <p>
0N/A * Any method on <code>ReferenceType</code> which directly or
0N/A * indirectly takes <code>ReferenceType</code> as an parameter may throw
0N/A * {@link com.sun.jdi.VMOutOfMemoryException} if the target VM has run out of memory.
0N/A * <p>
0N/A * Any method on <code>ReferenceType</code> or which directly or indirectly takes
0N/A * <code>ReferenceType</code> as parameter may throw
0N/A * {@link com.sun.jdi.ObjectCollectedException} if the mirrored type has been unloaded.
0N/A *
0N/A * @see ObjectReference
0N/A * @see ObjectReference#referenceType
0N/A * @see VirtualMachine
0N/A * @see VirtualMachine#allClasses
0N/A *
0N/A * @author Robert Field
0N/A * @author Gordon Hirsch
0N/A * @author James McIlree
0N/A * @since 1.3
0N/A */
0N/Apublic interface ReferenceType
0N/A extends Type, Comparable<ReferenceType>, Accessible
0N/A{
0N/A
0N/A /**
0N/A * Gets the fully qualified name of this type. The returned name
0N/A * is formatted as it might appear in a Java programming langauge
0N/A * declaration for objects of this type.
0N/A * <p>
0N/A * For primitive classes
0N/A * the returned name is the name of the corresponding primitive
0N/A * type; for example, "int" is returned as the name of the class
0N/A * represented by {@link java.lang.Integer#TYPE Integer.TYPE}.
0N/A * @return a string containing the type name.
0N/A */
0N/A String name();
0N/A
0N/A /**
0N/A * Gets the generic signature for this type if there is one.
0N/A * Generic signatures are described in the
4008N/A * <cite>The Java&trade; Virtual Machine Specification</cite>.
0N/A *
0N/A * @return a string containing the generic signature, or <code>null</code>
0N/A * if there is no generic signature.
0N/A *
0N/A * @since 1.5
0N/A */
0N/A String genericSignature();
0N/A
0N/A /**
0N/A * Gets the classloader object which loaded the class corresponding
0N/A * to this type.
0N/A *
0N/A * @return a {@link ClassLoaderReference} which mirrors the classloader,
0N/A * or <code>null</code> if the class was loaded through the bootstrap class
0N/A * loader.
0N/A */
0N/A ClassLoaderReference classLoader();
0N/A
0N/A /**
0N/A * Gets an identifying name for the source corresponding to the
0N/A * declaration of this type. Interpretation of this string is
0N/A * the responsibility of the source repository mechanism.
0N/A * <P>
0N/A * The returned name is dependent on VM's default stratum
0N/A * ({@link VirtualMachine#getDefaultStratum()}).
0N/A * In the reference implementation, when using the base stratum,
0N/A * the returned string is the
0N/A * unqualified name of the source file containing the declaration
0N/A * of this type. In other strata the returned source name is
0N/A * the first source name for that stratum. Since other languages
0N/A * may have more than one source name for a reference type,
0N/A * the use of {@link Location#sourceName()} or
0N/A * {@link #sourceNames(String)} is preferred.
0N/A * <p>
0N/A * For arrays ({@link ArrayType}) and primitive classes,
0N/A * AbsentInformationException is always thrown.
0N/A *
0N/A * @return the string source file name
0N/A * @throws AbsentInformationException if the source name is not
0N/A * known
0N/A */
0N/A String sourceName() throws AbsentInformationException;
0N/A
0N/A /**
0N/A * Gets the identifying names for all the source corresponding to the
0N/A * declaration of this type. Interpretation of these names is
0N/A * the responsibility of the source repository mechanism.
0N/A * <P>
0N/A * The returned names are for the specified stratum
0N/A * (see {@link Location} for a description of strata).
0N/A * In the reference implementation, when using the Java
0N/A * programming language stratum,
0N/A * the returned List contains one element: a String which is the
0N/A * unqualified name of the source file containing the declaration
0N/A * of this type. In other strata the returned source names are
0N/A * all the source names defined for that stratum.
0N/A *
0N/A * @param stratum The stratum to retrieve information from
0N/A * or <code>null</code> for the declaring type's
0N/A * default stratum.
0N/A *
0N/A * @return a List of String objects each representing a source name
0N/A *
0N/A * @throws AbsentInformationException if the source names are not
0N/A * known.
0N/A * <p>
0N/A * For arrays ({@link ArrayType}) and primitive classes,
0N/A * AbsentInformationException is always thrown.
0N/A *
0N/A * @since 1.4
0N/A */
0N/A List<String> sourceNames(String stratum) throws AbsentInformationException;
0N/A
0N/A /**
0N/A * Gets the paths to the source corresponding to the
0N/A * declaration of this type. Interpretation of these paths is
0N/A * the responsibility of the source repository mechanism.
0N/A * <P>
0N/A * The returned paths are for the specified stratum
0N/A * (see {@link Location} for a description of strata).
0N/A * In the reference implementation, for strata which
0N/A * do not explicitly specify source path (the Java
0N/A * programming language stratum never does), the returned
0N/A * strings are the {@link #sourceNames(String)} prefixed by
0N/A * the package name of this ReferenceType
0N/A * converted to a platform dependent path.
0N/A * For example, on a Windows platform,
0N/A * <CODE>java.lang.Thread</CODE>
0N/A * would return a List containing one element:
0N/A * <CODE>"java\lang\Thread.java"</CODE>.
0N/A *
0N/A * @param stratum The stratum to retrieve information from
0N/A * or <code>null</code> for the declaring type's
0N/A * default stratum.
0N/A *
0N/A * @return a List of String objects each representing a source path
0N/A *
0N/A * @throws AbsentInformationException if the source names are not
0N/A * known.
0N/A * <p>
0N/A * For arrays ({@link ArrayType}) and primitive classes,
0N/A * AbsentInformationException is always thrown.
0N/A *
0N/A * @since 1.4
0N/A */
0N/A List<String> sourcePaths(String stratum) throws AbsentInformationException;
0N/A
0N/A /**
0N/A * Get the source debug extension of this type.
0N/A * <p>
0N/A * Not all target virtual machines support this operation.
0N/A * Use
0N/A * {@link VirtualMachine#canGetSourceDebugExtension() canGetSourceDebugExtension()}
0N/A * to determine if the operation is supported.
0N/A * @return as a string the source debug extension attribute
0N/A * @throws AbsentInformationException if the extension is not
0N/A * specified
0N/A * @throws java.lang.UnsupportedOperationException if
0N/A * the target virtual machine does not support this
0N/A * operation - see
0N/A * {@link VirtualMachine#canGetSourceDebugExtension() canGetSourceDebugExtension()},
0N/A */
0N/A String sourceDebugExtension() throws AbsentInformationException;
0N/A
0N/A /**
0N/A * Determines if this type was declared static. Only nested types,
0N/A * can be declared static, so <code>false</code> is returned
0N/A * for any package-level type, array type, or primitive class.
0N/A *
0N/A * @return <code>true</code> if this type is static; false otherwise.
0N/A */
0N/A boolean isStatic();
0N/A
0N/A /**
0N/A * Determines if this type was declared abstract.
0N/A * <p>
0N/A * For arrays ({@link ArrayType}) and primitive classes,
0N/A * the return value is undefined.
0N/A *
0N/A * @return <code>true</code> if this type is abstract; false otherwise.
0N/A */
0N/A boolean isAbstract();
0N/A
0N/A /**
0N/A * Determines if this type was declared final.
0N/A * <p>
0N/A * For arrays ({@link ArrayType}) and primitive classes,
0N/A * the return value is always true.
0N/A *
0N/A * @return <code>true</code> if this type is final; false otherwise.
0N/A */
0N/A boolean isFinal();
0N/A
0N/A /**
0N/A * Determines if this type has been prepared. See the JVM
0N/A * specification for a definition of class preparation.
0N/A * <p>
0N/A * For arrays ({@link ArrayType}) and primitive classes,
0N/A * the return value is undefined.
0N/A *
0N/A * @return <code>true</code> if this type is prepared; false otherwise.
0N/A */
0N/A boolean isPrepared();
0N/A
0N/A /**
0N/A * Determines if this type has been verified. See the JVM
0N/A * specification for a definition of class verification.
0N/A * <p>
0N/A * For arrays ({@link ArrayType}) and primitive classes,
0N/A * the return value is undefined.
0N/A *
0N/A * @return <code>true</code> if this type is verified; false otherwise.
0N/A */
0N/A boolean isVerified();
0N/A
0N/A /**
0N/A * Determines if this type has been initialized. See the JVM
0N/A * specification for a definition of class verification.
0N/A * For {@link InterfaceType}, this method always returns the
0N/A * same value as {@link #isPrepared()}.
0N/A * <p>
0N/A * For arrays ({@link ArrayType}) and primitive classes,
0N/A * the return value is undefined.
0N/A *
0N/A * @return <code>true</code> if this type is initialized; false otherwise.
0N/A */
0N/A boolean isInitialized();
0N/A
0N/A /**
0N/A * Determines if initialization failed for this class. See the JVM
0N/A * specification for details on class initialization.
0N/A * <p>
0N/A * For arrays ({@link ArrayType}) and primitive classes,
0N/A * the return value is undefined.
0N/A *
0N/A * @return <code>true</code> if initialization was attempted and
0N/A * failed; false otherwise.
0N/A */
0N/A boolean failedToInitialize();
0N/A
0N/A /**
0N/A * Returns a list containing each {@link Field} declared in this type.
0N/A * Inherited fields are not included. Any synthetic fields created
0N/A * by the compiler are included in the list.
0N/A * <p>
0N/A * For arrays ({@link ArrayType}) and primitive classes, the returned
0N/A * list is always empty.
0N/A *
0N/A * @return a list {@link Field} objects; the list has length 0
0N/A * if no fields exist.
0N/A * @throws ClassNotPreparedException if this class not yet been
0N/A * prepared.
0N/A */
0N/A List<Field> fields();
0N/A
0N/A /**
0N/A * Returns a list containing each unhidden and unambiguous {@link Field}
0N/A * in this type.
0N/A * Each field that can be accessed from the class
0N/A * or its instances with its simple name is included. Fields that
0N/A * are ambiguously multiply inherited or fields that are hidden by
0N/A * fields with the same name in a more recently inherited class
0N/A * cannot be accessed
0N/A * by their simple names and are not included in the returned
0N/A * list. All other inherited fields are included.
0N/A * See JLS section 8.3 for details.
0N/A * <p>
0N/A * For arrays ({@link ArrayType}) and primitive classes, the returned
0N/A * list is always empty.
0N/A *
0N/A * @return a List of {@link Field} objects; the list has length
0N/A * 0 if no visible fields exist.
0N/A * @throws ClassNotPreparedException if this class not yet been
0N/A * prepared.
0N/A */
0N/A List<Field> visibleFields();
0N/A
0N/A /**
0N/A * Returns a list containing each {@link Field} declared in this type,
0N/A * and its superclasses, implemented interfaces, and/or superinterfaces.
0N/A * All declared and inherited
0N/A * fields are included, regardless of whether they are hidden or
0N/A * multiply inherited.
0N/A * <p>
0N/A * For arrays ({@link ArrayType}) and primitive classes, the returned
0N/A * list is always empty.
0N/A *
0N/A * @return a List of {@link Field} objects; the list has length
0N/A * 0 if no fields exist.
0N/A * @throws ClassNotPreparedException if this class not yet been
0N/A * prepared.
0N/A */
0N/A List<Field> allFields();
0N/A
0N/A /**
0N/A * Finds the visible {@link Field} with the given
0N/A * non-ambiguous name. This method follows the
0N/A * inheritance rules specified in the JLS (8.3.3) to determine
0N/A * visibility.
0N/A * <p>
0N/A * For arrays ({@link ArrayType}) and primitive classes, the returned
0N/A * value is always null.
0N/A *
0N/A * @param fieldName a String containing the name of desired field.
0N/A * @return a {@link Field} object which mirrors the found field, or
0N/A * null if there is no field with the given name or if the given
0N/A * name is ambiguous.
0N/A * @throws ClassNotPreparedException if this class not yet been
0N/A * prepared.
0N/A */
0N/A Field fieldByName(String fieldName);
0N/A
0N/A /**
0N/A * Returns a list containing each {@link Method} declared
0N/A * directly in this type.
0N/A * Inherited methods are not included. Constructors,
0N/A * the initialization method if any, and any synthetic methods created
0N/A * by the compiler are included in the list.
0N/A * <p>
0N/A * For arrays ({@link ArrayType}) and primitive classes, the returned
0N/A * list is always empty.
0N/A *
0N/A * @return a list {@link Method} objects; the list has length 0
0N/A * if no methods exist.
0N/A * @throws ClassNotPreparedException if this class not yet been
0N/A * prepared.
0N/A */
0N/A List<Method> methods();
0N/A
0N/A /**
0N/A * Returns a list containing each {@link Method}
0N/A * declared or inherited by this type. Methods from superclasses
0N/A * or superinterfaces that that have been hidden or overridden
0N/A * are not included.
0N/A * <p>
0N/A * Note that despite this exclusion, multiple inherited methods
0N/A * with the same signature can be present in the returned list, but
0N/A * at most one can be a member of a {@link ClassType}.
0N/A * See JLS section 8.4.6 for details.
0N/A * <p>
0N/A * For arrays ({@link ArrayType}) and primitive classes, the returned
0N/A * list is always empty.
0N/A *
0N/A * @return a List of {@link Method} objects; the list has length
0N/A * 0 if no visible methods exist.
0N/A * @throws ClassNotPreparedException if this class not yet been
0N/A * prepared.
0N/A */
0N/A List<Method> visibleMethods();
0N/A
0N/A /**
0N/A * Returns a list containing each {@link Method} declared in this type,
0N/A * and its superclasses, implemented interfaces, and/or superinterfaces.
0N/A * All declared and inherited
0N/A * methods are included, regardless of whether they are hidden or
0N/A * overridden.
0N/A * <p>
0N/A * For arrays ({@link ArrayType}) and primitive classes, the returned
0N/A * list is always empty.
0N/A *
0N/A * @return a List of {@link Method} objects; the list has length
0N/A * 0 if no methods exist.
0N/A * @throws ClassNotPreparedException if this class not yet been
0N/A * prepared.
0N/A */
0N/A List<Method> allMethods();
0N/A
0N/A /**
0N/A * Returns a List containing each visible {@link Method} that
0N/A * has the given name. This is most commonly used to
0N/A * find overloaded methods.
0N/A * <p>
0N/A * Overridden and hidden methods are not included.
0N/A * See JLS (8.4.6) for details.
0N/A * <p>
0N/A * For arrays ({@link ArrayType}) and primitive classes, the returned
0N/A * list is always empty.
0N/A *
0N/A * @param name the name of the method to find.
0N/A * @return a List of {@link Method} objects that match the given
0N/A * name; the list has length 0 if no matching methods are found.
0N/A * @throws ClassNotPreparedException if this class not yet been
0N/A * prepared.
0N/A */
0N/A List<Method> methodsByName(String name);
0N/A
0N/A /**
0N/A * Returns a List containing each visible {@link Method} that
0N/A * has the given name and signature.
0N/A * The signature string is the
0N/A * JNI signature for the target method:
0N/A * <ul>
0N/A * <li><code>()V</code>
0N/A * <li><code>([Ljava/lang/String;)V</code>
0N/A * <li><code>(IIII)Z</code>
0N/A * </ul>
0N/A * This method follows the inheritance rules specified
0N/A * in the JLS (8.4.6) to determine visibility.
0N/A * <p>
0N/A * At most one method in the list is a concrete method and a
0N/A * component of {@link ClassType}; any other methods in the list
0N/A * are abstract. Use {@link ClassType#concreteMethodByName} to
0N/A * retrieve only the matching concrete method.
0N/A * <p>
0N/A * For arrays ({@link ArrayType}) and primitive classes, the returned
0N/A * list is always empty.
0N/A *
0N/A * @param name the name of the method to find.
0N/A * @param signature the signature of the method to find
0N/A * @return a List of {@link Method} objects that match the given
0N/A * name and signature; the list has length 0 if no matching methods
0N/A * are found.
0N/A * @throws ClassNotPreparedException if this class not yet been
0N/A * prepared.
0N/A */
0N/A List<Method> methodsByName(String name, String signature);
0N/A
0N/A /**
0N/A * Returns a List containing {@link ReferenceType} objects that are
0N/A * declared within this type and are currently loaded into the Virtual
0N/A * Machine. Both static nested types and non-static nested
0N/A * types (that is, inner types) are included. Local inner types
0N/A * (declared within a code block somewhere in this reference type) are
0N/A * also included in the returned list.
0N/A * <p>
0N/A * For arrays ({@link ArrayType}) and primitive classes, the returned
0N/A * list is always empty.
0N/A *
0N/A * @return a List of nested {@link ReferenceType} objects; the list
0N/A * has 0 length if there are no nested types.
0N/A */
0N/A List<ReferenceType> nestedTypes();
0N/A
0N/A /**
0N/A * Gets the {@link Value} of a given static {@link Field} in this type.
0N/A * The Field must be valid for this type;
0N/A * that is, it must be declared in this type, a superclass, a
0N/A * superinterface, or an implemented interface.
0N/A *
0N/A * @param field the field containing the requested value
0N/A * @return the {@link Value} of the instance field.
0N/A * @throws java.lang.IllegalArgumentException if the field is not valid for
0N/A * this object's class.
0N/A */
0N/A Value getValue(Field field);
0N/A
0N/A /**
0N/A * Returns a map containing the {@link Value} of each
0N/A * static {@link Field} in the given list.
0N/A * The Fields must be valid for this type;
0N/A * that is, they must be declared in this type, a superclass, a
0N/A * superinterface, or an implemented interface.
0N/A *
0N/A * @param fields a list of {@link Field} objects containing the
0N/A * requested values.
0N/A * @return a Map of the requested {@link Field} objects with
0N/A * their {@link Value}.
0N/A * @throws java.lang.IllegalArgumentException if any field is not valid for
0N/A * this object's class.
0N/A * @throws VMMismatchException if a {@link Mirror} argument and this mirror
0N/A * do not belong to the same {@link VirtualMachine}.
0N/A */
0N/A Map<Field,Value> getValues(List<? extends Field> fields);
0N/A
0N/A /**
0N/A * Returns the class object that corresponds to this type in the
0N/A * target VM. The VM creates class objects for every kind of
0N/A * ReferenceType: classes, interfaces, and array types.
0N/A * @return the {@link ClassObjectReference} for this reference type
0N/A * in the target VM.
0N/A */
0N/A ClassObjectReference classObject();
0N/A
0N/A /**
0N/A * Returns a list containing a {@link Location} object
0N/A * for each executable source line in this reference type.
0N/A * <P>
0N/A * This method is equivalent to
0N/A * <code>allLineLocations(vm.getDefaultStratum(),null)</code> -
0N/A * see {@link #allLineLocations(String,String)}
0N/A * for more information.
0N/A *
0N/A * @throws AbsentInformationException if there is no line
0N/A * number information for this class and there are non-native,
0N/A * non-abstract executable members of this class.
0N/A *
0N/A * @throws ClassNotPreparedException if this class not yet
0N/A * been prepared.
0N/A */
0N/A List<Location> allLineLocations() throws AbsentInformationException;
0N/A
0N/A /**
0N/A * Returns a list containing a {@link Location} object
0N/A * for each executable source line in this reference type.
0N/A * Each location maps a source line to a range of code
0N/A * indices.
0N/A * The beginning of the range can be determined through
0N/A * {@link Location#codeIndex}. The returned list may contain
0N/A * multiple locations for a particular line number, if the
0N/A * compiler and/or VM has mapped that line to two or more
0N/A * disjoint code index ranges. Note that it is possible for
0N/A * the same source line to represent different code index
0N/A * ranges in <i>different</i> methods.
0N/A * <P>
0N/A * For arrays ({@link ArrayType}) and primitive classes, the
0N/A * returned list is always empty. For interfaces ({@link
0N/A * InterfaceType}), the returned list will be non-empty only
0N/A * if the interface has executable code in its class
0N/A * initialization.
0N/A * <P>
0N/A * Returned list is for the specified <i>stratum</i>
0N/A * (see {@link Location} for a description of strata).
0N/A *
0N/A * @param stratum The stratum to retrieve information from
0N/A * or <code>null</code> for the {@link #defaultStratum()}.
0N/A *
0N/A * @param sourceName Return locations only within this
0N/A * source file or <code>null</code> to return locations.
0N/A *
0N/A * @return a List of all source line {@link Location} objects.
0N/A *
0N/A * @throws AbsentInformationException if there is no line
0N/A * number information for this class and there are non-native,
0N/A * non-abstract executable members of this class.
0N/A * Or if <i>sourceName</i> is non-<code>null</code>
0N/A * and source name information is not present.
0N/A *
0N/A * @throws ClassNotPreparedException if this class not yet
0N/A * been prepared.
0N/A *
0N/A * @since 1.4
0N/A */
0N/A List<Location> allLineLocations(String stratum, String sourceName)
0N/A throws AbsentInformationException;
0N/A
0N/A /**
0N/A * Returns a List containing all {@link Location} objects
0N/A * that map to the given line number.
0N/A * <P>
0N/A * This method is equivalent to
0N/A * <code>locationsOfLine(vm.getDefaultStratum(), null,
0N/A * lineNumber)</code> -
0N/A * see {@link
0N/A * #locationsOfLine(java.lang.String,java.lang.String,int)}
0N/A * for more information.
0N/A *
0N/A * @param lineNumber the line number
0N/A *
0N/A * @return a List of all {@link Location} objects that map to
0N/A * the given line.
0N/A *
0N/A * @throws AbsentInformationException if there is no line
0N/A * number information for this class.
0N/A *
0N/A * @throws ClassNotPreparedException if this class not yet
0N/A * been prepared.
0N/A *
0N/A * @see VirtualMachine#getDefaultStratum()
0N/A */
0N/A List<Location> locationsOfLine(int lineNumber)
0N/A throws AbsentInformationException;
0N/A
0N/A /**
0N/A * Returns a List containing all {@link Location} objects
0N/A * that map to the given line number.
0N/A * <P>
0N/A * For arrays ({@link ArrayType}) and primitive classes, the
0N/A * returned list is always empty.
0N/A * For interfaces ({@link InterfaceType}), the returned list
0N/A * will be non-empty only if the interface has executable code
0N/A * in its class initialization at the specified line number.
0N/A * An empty list will be returned if there is no executable
0N/A * code at the specified line number.
0N/A * <p>
0N/A * Returned list is for the specified <i>stratum</i>
0N/A * (see {@link Location} for a description of strata).
0N/A *
0N/A * @param stratum the stratum to use for comparing line number
0N/A * and source name, or <code>null</code> to
0N/A * use the {@link #defaultStratum()}.
0N/A *
0N/A * @param sourceName the source name containing the line
0N/A * number, or <code>null</code> to match
0N/A * all source names
0N/A *
0N/A * @param lineNumber the line number
0N/A *
0N/A * @return a List of all {@link Location} objects that map
0N/A * to the given line.
0N/A *
0N/A * @throws AbsentInformationException if there is no line
0N/A * number information for this class.
0N/A * Or if <i>sourceName</i> is non-<code>null</code>
0N/A * and source name information is not present.
0N/A *
0N/A * @throws ClassNotPreparedException if this class not yet
0N/A * been prepared.
0N/A *
0N/A * @since 1.4
0N/A */
0N/A List<Location> locationsOfLine(String stratum,
0N/A String sourceName,
0N/A int lineNumber)
0N/A throws AbsentInformationException;
0N/A
0N/A /**
0N/A * Return the available strata for this reference type.
0N/A * <P>
0N/A * See the {@link Location} for a description of strata.
0N/A *
0N/A * @return List of <CODE>java.lang.String</CODE>, each
0N/A * representing a stratum
0N/A *
0N/A * @since 1.4
0N/A */
0N/A List<String> availableStrata();
0N/A
0N/A /**
0N/A * Returns the default stratum for this reference type.
0N/A * This value is specified in the class file and cannot
0N/A * be set by the user. If the class file does not
0N/A * specify a default stratum the base stratum
0N/A * (<code>"Java"</code>) will be returned.
0N/A * <P>
0N/A * See the {@link Location} for a description of strata.
0N/A *
0N/A * @since 1.4
0N/A */
0N/A String defaultStratum();
0N/A
0N/A /**
0N/A * Returns instances of this ReferenceType.
0N/A * Only instances that are reachable for the purposes of garbage collection
0N/A * are returned.
0N/A * <p>
0N/A * Not all target virtual machines support this operation.
0N/A * Use {@link VirtualMachine#canGetInstanceInfo()}
0N/A * to determine if the operation is supported.
0N/A *
0N/A * @see VirtualMachine#instanceCounts(List)
0N/A * @see ObjectReference#referringObjects(long)
0N/A *
0N/A * @param maxInstances the maximum number of instances to return.
0N/A * Must be non-negative. If zero, all instances are returned.
0N/A * @return a List of {@link ObjectReference} objects. If there are
0N/A * no instances of this ReferenceType, a zero-length list is returned.
0N/A *
0N/A * @throws java.lang.UnsupportedOperationException if
0N/A * the target virtual machine does not support this
0N/A * operation - see
0N/A * {@link VirtualMachine#canGetInstanceInfo() canGetInstanceInfo()}
0N/A * @throws java.lang.IllegalArgumentException if maxInstances is less
0N/A * than zero.
0N/A * @since 1.6
0N/A */
0N/A List<ObjectReference> instances(long maxInstances);
0N/A
0N/A /**
0N/A * Compares the specified Object with this ReferenceType for equality.
0N/A *
0N/A * @return true if the Object is a {@link ReferenceType}, if the
0N/A * ReferenceTypes belong to the same VM, and if they mirror classes
0N/A * which correspond to the same instance of java.lang.Class in that VM.
0N/A */
0N/A boolean equals(Object obj);
0N/A
0N/A /**
0N/A * Returns the hash code value for this ObjectReference.
0N/A *
0N/A * @return the integer hash code
0N/A */
0N/A int hashCode();
0N/A
0N/A /**
0N/A * Returns the class major version number, as defined in the class file format
0N/A * of the Java Virtual Machine Specification.
0N/A *
0N/A * For arrays ({@link ArrayType}) and primitive classes,
0N/A * the returned major version number value is zero.
0N/A *
0N/A * Not all target virtual machines support this operation.
0N/A * Use {@link VirtualMachine#canGetClassFileVersion()}
0N/A * to determine if the operation is supported.
0N/A *
0N/A * @return the major version number of the class.
0N/A *
0N/A * @throws java.lang.UnsupportedOperationException if
0N/A * the target virtual machine does not support this
0N/A * operation - see
0N/A * {@link VirtualMachine#canGetClassFileVersion() canGetClassFileVersion()}
0N/A *
0N/A * @since 1.6
0N/A */
0N/A int majorVersion();
0N/A
0N/A
0N/A /**
0N/A * Returns the class minor version number, as defined in the class file format
0N/A * of the Java Virtual Machine Specification.
0N/A *
0N/A * For arrays ({@link ArrayType}) and primitive classes,
0N/A * the returned minor version number value is zero.
0N/A *
0N/A * Not all target virtual machines support this operation.
0N/A * Use {@link VirtualMachine#canGetClassFileVersion()}
0N/A * to determine if the operation is supported.
0N/A *
0N/A * @return the minor version number of the class.
0N/A *
0N/A * @throws java.lang.UnsupportedOperationException if
0N/A * the target virtual machine does not support this
0N/A * operation - see
0N/A * {@link VirtualMachine#canGetClassFileVersion() canGetClassFileVersion()}
0N/A *
0N/A * @since 1.6
0N/A */
0N/A int minorVersion();
0N/A
0N/A /**
0N/A * Returns the number of entries in the constant pool plus one.
0N/A * This corresponds to the constant_pool_count item of the Class File Format
0N/A * in the Java Virtual Machine Specification.
0N/A *
0N/A * For arrays ({@link ArrayType}) and primitive classes,
0N/A * the returned constant pool count value is zero.
0N/A *
0N/A * Not all target virtual machines support this operation.
0N/A * Use {@link VirtualMachine#canGetConstantPool()}
0N/A * to determine if the operation is supported.
0N/A *
0N/A * @return total number of constant pool entries for a class plus one.
0N/A *
0N/A * @throws java.lang.UnsupportedOperationException if
0N/A * the target virtual machine does not support this
0N/A * operation - see
0N/A * {@link VirtualMachine#canGetConstantPool() canGetConstantPool()}
0N/A *
0N/A * @see #constantPool()
0N/A * @since 1.6
0N/A */
0N/A int constantPoolCount();
0N/A
0N/A /**
0N/A * Returns the raw bytes of the constant pool in the format of the
0N/A * constant_pool item of the Class File Format in the Java Virtual
0N/A * Machine Specification. The format of the constant pool may
0N/A * differ between versions of the Class File Format, so, the
0N/A * minor and major class version numbers should be checked for
0N/A * compatibility.
0N/A *
0N/A * For arrays ({@link ArrayType}) and primitive classes,
0N/A * a zero length byte array is returned.
0N/A *
0N/A * Not all target virtual machines support this operation.
0N/A * Use {@link VirtualMachine#canGetConstantPool()}
0N/A * to determine if the operation is supported.
0N/A *
0N/A * @return the raw bytes of constant pool.
0N/A *
0N/A * @throws java.lang.UnsupportedOperationException if
0N/A * the target virtual machine does not support this
0N/A * operation - see
0N/A * {@link VirtualMachine#canGetConstantPool() canGetConstantPool()}
0N/A *
0N/A * @see #constantPoolCount()
0N/A * @since 1.6
0N/A */
0N/A byte[] constantPool();
0N/A
0N/A}