001: /*******************************************************************************
002: * Copyright (c) 2000, 2006 IBM Corporation and others.
003: * All rights reserved. This program and the accompanying materials
004: * are made available under the terms of the Eclipse Public License v1.0
005: * which accompanies this distribution, and is available at
006: * http://www.eclipse.org/legal/epl-v10.html
007: *
008: * Contributors:
009: * IBM Corporation - initial API and implementation
010: *******************************************************************************/package org.eclipse.jdt.debug.core;
011:
012: import org.eclipse.debug.core.DebugException;
013:
014: /**
015: * Represents the type of an object in a virtual machine - including classes,
016: * interfaces and array types.
017: * <p>
018: * Clients are not intended to implement this interface.
019: * </p>
020: * @since 3.0
021: */
022: public interface IJavaReferenceType extends IJavaType {
023:
024: /**
025: * Returns a variable representing the static field in this type
026: * with the given name, or <code>null</code> if there is no
027: * field with the given name, or the name is ambiguous.
028: *
029: * @param name field name
030: * @return the variable representing the static field, or <code>null</code>
031: * @exception DebugException if this method fails. Reasons include:
032: * <ul><li>Failure communicating with the VM. The DebugException's
033: * status code contains the underlying exception responsible for
034: * the failure.</li>
035: * </ul>
036: */
037: public IJavaFieldVariable getField(String name)
038: throws DebugException;
039:
040: /**
041: * Returns the class object associated with this type.
042: *
043: * @return the class object associated with this type
044: * @exception DebugException if this method fails. Reasons include:
045: * <ul><li>Failure communicating with the VM. The DebugException's
046: * status code contains the underlying exception responsible for
047: * the failure.</li>
048: * </ul>
049: */
050: public IJavaClassObject getClassObject() throws DebugException;
051:
052: /**
053: * Returns a collection of strata available for this type.
054: *
055: * @return a collection of strata available for this type
056: * @throws DebugException if unable to retrieve available strata
057: */
058: public String[] getAvailableStrata() throws DebugException;
059:
060: /**
061: * Returns the default stratum for this type.
062: *
063: * @return the default stratum for this type
064: * @throws DebugException if unable to retrieve the default stratum
065: */
066: public String getDefaultStratum() throws DebugException;
067:
068: /**
069: * Returns a collection of the names of the fields declared in this type.
070: *
071: * @return a collection of the names of the field declared in this type
072: * @throws DebugException if unable to retrieve declared field names
073: */
074: public String[] getDeclaredFieldNames() throws DebugException;
075:
076: /**
077: * Returns a collection of the names of all of the fields declared in this
078: * type, all of its super classes, implemented interfaces and super interfaces.
079: *
080: * @return a collection of the names of all of the fields declared in this
081: * type, all of its super classes, implemented interfaces and super interfaces
082: * @throws DebugException if unable to retrieve field names
083: */
084: public String[] getAllFieldNames() throws DebugException;
085:
086: /**
087: * Returns the class loader object that loaded the class corresponding to this
088: * type, or <code>null</code> if this type was loaded by the bootstrap loader.
089: *
090: * @return the class loader object that loaded the class corresponding to this
091: * type or <code>null</code>
092: * @throws DebugException
093: * @since 3.1
094: */
095: public IJavaObject getClassLoaderObject() throws DebugException;
096:
097: /**
098: * Returns the generic signature as defined in the JVM
099: * specification for this type.
100: * Returns <code>null</code> if this type is not a generic type.
101: *
102: * @return signature, or <code>null</code> if generic signature not available
103: * @exception DebugException if this method fails. Reasons include:
104: * <ul><li>Failure communicating with the VM. The DebugException's
105: * status code contains the underlying exception responsible for
106: * the failure.</li><ul>
107: * @since 3.1
108: */
109: public String getGenericSignature() throws DebugException;
110:
111: /**
112: * Returns the unqualified name of the source file corresponding to this type,
113: * or <code>null</code> if source name debug attribute is not present.
114: * The source name returned is based on this target's default stratum.
115: *
116: * @return unqualified source file name or <code>null</code>
117: * @throws DebugException if an exception occurs retrieving the source name
118: * @since 3.2
119: */
120: public String getSourceName() throws DebugException;
121:
122: /**
123: * Returns the unqualified names of the source files corresponding to this type in
124: * the specified stratum, or <code>null</code> if the source name debug attribute is
125: * not present.
126: *
127: * @return unqualified source file names or <code>null</code>
128: * @throws DebugException if an exception occurs retrieving the source name
129: * @since 3.2
130: */
131: public String[] getSourceNames(String stratum)
132: throws DebugException;
133:
134: /**
135: * Returns the qualified names of the source files corresponding to this type in
136: * the specified stratum, or <code>null</code> if the source name debug attribute is
137: * not present.
138: *
139: * @return qualified source file names or <code>null</code>
140: * @throws DebugException if an exception occurs retrieving the source name
141: * @since 3.2
142: */
143: public String[] getSourcePaths(String stratum)
144: throws DebugException;
145:
146: /**
147: * Retrieves and returns instances of this reference type.
148: *
149: * @param max the maximum number of instances to retrieve or 0 to retrieve all instances
150: * @return instances of this reference type
151: * @throws DebugException on failure
152: * @since 3.3
153: */
154: public IJavaObject[] getInstances(long max) throws DebugException;
155:
156: }
|