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

process() — spring-boot Function Reference

Architecture documentation for the process() function in ConfigurationMetadataAnnotationProcessor.java from the spring-boot codebase.

Entity Profile

Dependency Diagram

graph TD
  196a9cf5_3a28_ecb0_f088_06da291eb5c4["process()"]
  0de6256e_c783_0189_36b9_bc233108210a["processElement()"]
  196a9cf5_3a28_ecb0_f088_06da291eb5c4 -->|calls| 0de6256e_c783_0189_36b9_bc233108210a
  5a22f795_7cff_419f_1137_b3a02350b6ed["processSourceElement()"]
  196a9cf5_3a28_ecb0_f088_06da291eb5c4 -->|calls| 5a22f795_7cff_419f_1137_b3a02350b6ed
  d9131efe_6b7b_90d0_406c_0c0eb0c2346b["getElementsAnnotatedOrMetaAnnotatedWith()"]
  196a9cf5_3a28_ecb0_f088_06da291eb5c4 -->|calls| d9131efe_6b7b_90d0_406c_0c0eb0c2346b
  44c23dac_6535_919c_a11b_c6e8c2825474["writeSourceMetadata()"]
  196a9cf5_3a28_ecb0_f088_06da291eb5c4 -->|calls| 44c23dac_6535_919c_a11b_c6e8c2825474
  180197ca_8042_db1a_8956_57c96d9a7062["writeMetadata()"]
  196a9cf5_3a28_ecb0_f088_06da291eb5c4 -->|calls| 180197ca_8042_db1a_8956_57c96d9a7062
  style 196a9cf5_3a28_ecb0_f088_06da291eb5c4 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

configuration-metadata/spring-boot-configuration-processor/src/main/java/org/springframework/boot/configurationprocessor/ConfigurationMetadataAnnotationProcessor.java lines 194–228

	@Override
	public boolean process(Set<? extends TypeElement> annotations, RoundEnvironment roundEnv) {
		this.metadataCollectors.processing(roundEnv);
		TypeElement annotationType = this.metadataEnv.getConfigurationPropertiesAnnotationElement();
		if (annotationType != null) { // Is @ConfigurationProperties available
			for (Element element : roundEnv.getElementsAnnotatedWith(annotationType)) {
				processElement(element);
			}
		}
		TypeElement sourceAnnotationType = this.metadataEnv.getConfigurationPropertiesSourceAnnotationElement();
		if (sourceAnnotationType != null) { // Is @ConfigurationPropertiesSource available
			for (Element element : roundEnv.getElementsAnnotatedWith(sourceAnnotationType)) {
				if (element instanceof TypeElement typeElement) {
					MetadataCollector metadataCollector = this.metadataCollectors.getMetadataCollector(typeElement);
					processSourceElement(metadataCollector, "", typeElement);
				}
			}
		}
		Set<TypeElement> endpointTypes = this.metadataEnv.getEndpointAnnotationElements();
		if (!endpointTypes.isEmpty()) { // Are endpoint annotations available
			for (TypeElement endpointType : endpointTypes) {
				getElementsAnnotatedOrMetaAnnotatedWith(roundEnv, endpointType).forEach(this::processEndpoint);
			}
		}
		if (roundEnv.processingOver()) {
			try {
				writeSourceMetadata();
				writeMetadata();
			}
			catch (Exception ex) {
				throw new IllegalStateException("Failed to write metadata", ex);
			}
		}
		return false;
	}

Domain

Subdomains

Frequently Asked Questions

What does process() do?
process() is a function in the spring-boot codebase.
What does process() call?
process() calls 5 function(s): getElementsAnnotatedOrMetaAnnotatedWith, processElement, processSourceElement, writeMetadata, writeSourceMetadata.

Analyze Your Own Codebase

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

Try Supermodel Free