Interface ArrayType
- All Superinterfaces:
Accessible, Comparable<ReferenceType>, Mirror, ReferenceType, Type
public interface ArrayType extends ReferenceType
- Since:
- 1.3
- See Also:
Method Summary
| Modifier and Type | Method | Description |
|---|---|---|
String |
componentSignature() |
Gets the JNI signature of the components of this array class. |
Type |
componentType() |
Returns the component type of this array, as specified in the array declaration. |
String |
componentTypeName() |
Returns a text representation of the component type of this array. |
ArrayReference |
newInstance |
Creates a new instance of this array class in the target VM. |
Methods declared in interface Accessible
isPackagePrivate, isPrivate, isProtected, isPublic, modifiers | Modifier and Type | Method | Description |
|---|---|---|
boolean |
isPackagePrivate() |
Determines if this object mirrors a package private item. |
boolean |
isPrivate() |
Determines if this object mirrors a private item. |
boolean |
isProtected() |
Determines if this object mirrors a protected item. |
boolean |
isPublic() |
Determines if this object mirrors a public item. |
int |
modifiers() |
Returns the Java programming language modifiers, encoded in an integer. |
Methods declared in interface Comparable
compareTo | Modifier and Type | Method | Description |
|---|---|---|
int |
compareTo |
Compares this object with the specified object for order. |
Methods declared in interface Mirror
toString, virtualMachine | Modifier and Type | Method | Description |
|---|---|---|
String |
toString() |
Returns a String describing this mirror |
VirtualMachine |
virtualMachine() |
Gets the VirtualMachine to which this Mirror belongs. |
Methods declared in interface ReferenceType
allFields, allLineLocations, allLineLocations, allMethods, availableStrata, classLoader, classObject, constantPool, constantPoolCount, defaultStratum, equals, failedToInitialize, fieldByName, fields, genericSignature, getValue, getValues, hashCode, instances, isAbstract, isFinal, isInitialized, isPrepared, isStatic, isVerified, locationsOfLine, locationsOfLine, majorVersion, methods, methodsByName, methodsByName, minorVersion, module, name, nestedTypes, sourceDebugExtension, sourceName, sourceNames, sourcePaths, visibleFields, visibleMethods | Modifier and Type | Method | Description |
|---|---|---|
List |
allFields() |
Returns a list containing each Field declared in this type, and its superclasses, implemented interfaces, and/or superinterfaces. |
List |
allLineLocations() |
Returns a list containing a Location object for each executable source line in this reference type. |
List |
allLineLocations |
Returns a list containing a Location object for each executable source line in this reference type. |
List |
allMethods() |
Returns a list containing each Method declared in this type, and its superclasses, implemented interfaces, and/or superinterfaces. |
List |
availableStrata() |
Return the available strata for this reference type. |
ClassLoaderReference |
classLoader() |
Gets the classloader object which loaded the class corresponding to this type. |
ClassObjectReference |
classObject() |
Returns the class object that corresponds to this type in the target VM. |
byte[] |
constantPool() |
Returns the raw bytes of the constant pool in the format of the constant_pool item of the Class File Format in the Java Virtual Machine Specification. |
int |
constantPoolCount() |
Returns the number of entries in the constant pool plus one. |
String |
defaultStratum() |
Returns the default stratum for this reference type. |
boolean |
equals |
Compares the specified Object with this ReferenceType for equality. |
boolean |
failedToInitialize() |
Determines if initialization failed for this class. |
Field |
fieldByName |
Finds the visible Field with the given non-ambiguous name. |
List |
fields() |
Returns a list containing each Field declared in this type. |
String |
genericSignature() |
Gets the generic signature for this type if there is one. |
Value |
getValue |
|
Map |
getValues |
|
int |
hashCode() |
Returns the hash code value for this ObjectReference. |
List |
instances |
Returns instances of this ReferenceType. |
boolean |
isAbstract() |
Determines if this type was declared abstract. |
boolean |
isFinal() |
Determines if this type was declared final. |
boolean |
isInitialized() |
Determines if this type has been initialized. |
boolean |
isPrepared() |
Determines if this type has been prepared. |
boolean |
isStatic() |
Determines if this type was declared static. |
boolean |
isVerified() |
Determines if this type has been verified. |
List |
locationsOfLine |
Returns a List containing all Location objects that map to the given line number. |
List |
locationsOfLine |
Returns a List containing all Location objects that map to the given line number. |
int |
majorVersion() |
Returns the class major version number, as defined in the class file format of the Java Virtual Machine Specification. |
List |
methods() |
Returns a list containing each Method declared directly in this type. |
List |
methodsByName |
Returns a List containing each visible Method that has the given name. |
List |
methodsByName |
Returns a List containing each visible Method that has the given name and signature. |
int |
minorVersion() |
Returns the class minor version number, as defined in the class file format of the Java Virtual Machine Specification. |
default ModuleReference |
module() |
Gets the module object which contains the class corresponding to this type. |
String |
name() |
Returns the name of this ReferenceType object. |
List |
nestedTypes() |
Returns a List containing ReferenceType objects that are declared within this type and are currently loaded into the Virtual Machine. |
String |
sourceDebugExtension() |
Get the source debug extension of this type. |
String |
sourceName() |
Gets an identifying name for the source corresponding to the declaration of this type. |
List |
sourceNames |
Gets the identifying names for all the source corresponding to the declaration of this type. |
List |
sourcePaths |
Gets the paths to the source corresponding to the declaration of this type. |
List |
visibleFields() |
Returns a list containing each unhidden and unambiguous Field in this type. |
List |
visibleMethods() |
Returns a list containing each Method declared or inherited by this type. |
Method Details
newInstance
ArrayReference newInstance(int length)
- Parameters:
-
length- the number of components in the new array - Returns:
- the newly created
ArrayReferencemirroring the new object in the target VM. - Throws:
-
VMCannotBeModifiedException- if the VirtualMachine is read-only - seeVirtualMachine.canBeModified().
componentSignature
String componentSignature()
- Returns:
- a string containing the JNI signature of array components.
componentTypeName
String componentTypeName()
- Returns:
- a text representation of the component type.
componentType
Type componentType() throws ClassNotLoadedException
Note: The component type of a array will always be created or loaded before the array - see The Java Virtual Machine Specification, section 5.3.3 - Creating Array Classes. However, although the component type will be loaded it may not yet be prepared, in which case the type will be returned but attempts to perform some operations on the returned type (e.g. fields()) will throw a ClassNotPreparedException. Use ReferenceType.isPrepared() to determine if a reference type is prepared.
- Returns:
- the
Typeof this array's components. - Throws:
ClassNotLoadedException- See Also:
© 1993, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.