Home / Function/ getCollectionElementType() — spring-boot Function Reference

getCollectionElementType() — spring-boot Function Reference

Architecture documentation for the getCollectionElementType() function in TypeUtils.java from the spring-boot codebase.

Function java GradlePlugin RunTasks calls 3 called by 1

Entity Profile

Dependency Diagram

graph TD
  cdcc1898_f1cb_cd4e_a380_4fdb96472203["getCollectionElementType()"]
  89068211_cc71_6ddc_d6c2_6a80d39ae94d["extractElementType()"]
  89068211_cc71_6ddc_d6c2_6a80d39ae94d -->|calls| cdcc1898_f1cb_cd4e_a380_4fdb96472203
  72b8e2e5_8024_2c27_43ec_48063cecdcab["asElement()"]
  cdcc1898_f1cb_cd4e_a380_4fdb96472203 -->|calls| 72b8e2e5_8024_2c27_43ec_48063cecdcab
  3ca39c67_f86e_1695_1e5e_f9d8c7cf6c1d["getDeclaredType()"]
  cdcc1898_f1cb_cd4e_a380_4fdb96472203 -->|calls| 3ca39c67_f86e_1695_1e5e_f9d8c7cf6c1d
  d14a3110_dc6a_85bd_3b75_074431daedac["getQualifiedName()"]
  cdcc1898_f1cb_cd4e_a380_4fdb96472203 -->|calls| d14a3110_dc6a_85bd_3b75_074431daedac
  style cdcc1898_f1cb_cd4e_a380_4fdb96472203 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

configuration-metadata/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/TypeUtils.java lines 154–172

	private TypeMirror getCollectionElementType(TypeMirror type) {
		if (((TypeElement) this.types.asElement(type)).getQualifiedName().contentEquals(Collection.class.getName())) {
			DeclaredType declaredType = (DeclaredType) type;
			// raw type, just "Collection"
			if (declaredType.getTypeArguments().isEmpty()) {
				return this.types.getDeclaredType(this.env.getElementUtils().getTypeElement(Object.class.getName()));
			}
			// return type argument to Collection<...>
			return declaredType.getTypeArguments().get(0);
		}

		// recursively walk the supertypes, looking for Collection<...>
		for (TypeMirror superType : this.env.getTypeUtils().directSupertypes(type)) {
			if (this.types.isAssignable(superType, this.collectionType)) {
				return getCollectionElementType(superType);
			}
		}
		return null;
	}

Domain

Subdomains

Calls

Called By

  • extractElementType()

Frequently Asked Questions

What does getCollectionElementType() do?
getCollectionElementType() is a function in the spring-boot codebase.
What does getCollectionElementType() call?
getCollectionElementType() calls 3 function(s): asElement, getDeclaredType, getQualifiedName.
What calls getCollectionElementType()?
getCollectionElementType() is called by 1 function(s): extractElementType.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free