GenericArrayType
Stay organized with collections
Save and categorize content based on your preferences.
GenericArrayType
represents an array type whose component
type is either a parameterized type or a type variable.
Public Methods
public
abstract
Type
getGenericComponentType
()
Returns a Type
object representing the component type
of this array. This method creates the component type of the
array. See the declaration of ParameterizedType
for the
semantics of the creation process for parameterized types and
see TypeVariable
for the
creation process for type variables.
Returns
- a
Type
object representing the component type
of this array
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-07-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-07-10 UTC."],[[["\u003cp\u003e\u003ccode\u003eGenericArrayType\u003c/code\u003e represents array types with parameterized or type variable components.\u003c/p\u003e\n"],["\u003cp\u003eIt provides a method, \u003ccode\u003egetGenericComponentType()\u003c/code\u003e, to access the component type of the array.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003egetGenericComponentType()\u003c/code\u003e can throw exceptions if the component type is invalid or not found.\u003c/p\u003e\n"]]],["`GenericArrayType` represents an array with a component type that is either a parameterized type or a type variable. It has one main method, `getGenericComponentType()`, which returns a `Type` object representing the component type of the array. This method can throw `TypeNotPresentException` if the component type is non-existent, or `MalformedParameterizedTypeException` if the component type is an invalid parameterized type. The method will create the component type of the array.\n"],null,["# GenericArrayType\n\npublic interface **GenericArrayType** implements [Type](../../../../reference/java/lang/reflect/Type.html) \n`GenericArrayType` represents an array type whose component\ntype is either a parameterized type or a type variable. \n\n### Public Method Summary\n\n|--------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Type](../../../../reference/java/lang/reflect/Type.html) | [getGenericComponentType](../../../../reference/java/lang/reflect/GenericArrayType.html#getGenericComponentType())() Returns a `Type` object representing the component type of this array. |\n\nPublic Methods\n--------------\n\n#### public abstract [Type](../../../../reference/java/lang/reflect/Type.html)\n**getGenericComponentType**\n()\n\nReturns a `Type` object representing the component type\nof this array. This method creates the component type of the\narray. See the declaration of [ParameterizedType](../../../../reference/java/lang/reflect/ParameterizedType.html) for the\nsemantics of the creation process for parameterized types and\nsee [TypeVariable](../../../../reference/java/lang/reflect/TypeVariable.html) for the\ncreation process for type variables. \n\n##### Returns\n\n- a `Type` object representing the component type of this array \n\n##### Throws\n\n| [TypeNotPresentException](../../../../reference/java/lang/TypeNotPresentException.html) | if the underlying array type's component type refers to a non-existent type declaration |\n| [MalformedParameterizedTypeException](../../../../reference/java/lang/reflect/MalformedParameterizedTypeException.html) | if the underlying array type's component type refers to a parameterized type that cannot be instantiated for any reason |\n|-------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------|"]]