Top Description Inners Fields Constructors Methods
org.springframework.context.aot

public abstract Class AbstractAotProcessor<T>

extends Object
Class Inheritance
Known Direct Subclasses
org.springframework.context.aot.ContextAotProcessor
Type Parameters
<T>
the type of the processing result
Imports
java.io.IOException, java.nio.file.Path, org.springframework.aot.generate.FileSystemGeneratedFiles, .GeneratedFiles.Kind, org.springframework.aot.hint.RuntimeHints, org.springframework.aot.nativex.FileNativeConfigurationWriter, org.springframework.lang.Nullable, org.springframework.util.Assert, .FileSystemUtils

Abstract base class for filesystem-based ahead-of-time (AOT) processing.

Concrete implementations should override doProcess() that kicks off the optimization of the target, usually an application.

Authors
Stephane Nicoll, Andy Wilkinson, Phillip Webb, Sam Brannen
Since
6.0
See Also
FileSystemGeneratedFiles, FileNativeConfigurationWriter, org.springframework.context.aot.ContextAotProcessor, org.springframework.test.context.aot.TestAotProcessor

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
AbstractAotProcessor.Settings

Common settings for AOT processors.

Field Summary

Modifier and TypeField and Description
private static final String
AOT_PROCESSING

The name of a system property that is made available when the processor runs.

private final AbstractAotProcessor.Settings

Constructor Summary

AccessConstructor and Description
protected
AbstractAotProcessor(AbstractAotProcessor.Settings settings)

Create a new processor instance with the supplied settings.

Method Summary

Modifier and TypeMethod and Description
protected FileSystemGeneratedFiles
protected void
deleteExistingOutput()

Delete the source, resource, and class output directories.

private void
protected abstract T
private Path
protected AbstractAotProcessor.Settings
getSettings()

Get the settings for this AOT processor.

public final T

Returns:

the result of the processing.
process
()

Run AOT processing.

protected void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

AOT_PROCESSINGback to summary
private static final String AOT_PROCESSING

The name of a system property that is made available when the processor runs.

See Also
doProcess()
settingsback to summary
private final AbstractAotProcessor.Settings settings

Constructor Detail

AbstractAotProcessorback to summary
protected AbstractAotProcessor(AbstractAotProcessor.Settings settings)

Create a new processor instance with the supplied settings.

See Also
Settings#builder()

Method Detail

createFileSystemGeneratedFilesback to summary
protected FileSystemGeneratedFiles createFileSystemGeneratedFiles()
deleteExistingOutputback to summary
protected void deleteExistingOutput()

Delete the source, resource, and class output directories.

deleteExistingOutputback to summary
private void deleteExistingOutput(Path... paths)
doProcessback to summary
protected abstract T doProcess()
getRootback to summary
private Path getRoot(GeneratedFiles.Kind kind)
getSettingsback to summary
protected AbstractAotProcessor.Settings getSettings()

Get the settings for this AOT processor.

processback to summary
public final T process()

Run AOT processing.

Returns:T

the result of the processing.

writeHintsback to summary
protected void writeHints(RuntimeHints hints)
org.springframework.context.aot back to summary

public final Class AbstractAotProcessor.Settings

extends Object
Class Inheritance
  • java.lang.Object
  • org.springframework.context.aot.AbstractAotProcessor.Settings

Common settings for AOT processors.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class

Field Summary

Modifier and TypeField and Description
private final String
private final Path
private final String
private final Path
private final Path

Constructor Summary

AccessConstructor and Description
private
Settings(Path sourceOutput, Path resourceOutput, Path classOutput, String groupId, String artifactId)

Method Summary

Modifier and TypeMethod and Description
public static AbstractAotProcessor.Settings.Builder
builder()

Create a new Builder for Settings.

public String
getArtifactId()

Get the artifact ID of the application.

public Path
getClassOutput()

Get the output directory for generated classes.

public String
getGroupId()

Get the group ID of the application.

public Path
getResourceOutput()

Get the output directory for generated resources.

public Path
getSourceOutput()

Get the output directory for generated sources.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

artifactIdback to summary
private final String artifactId
classOutputback to summary
private final Path classOutput
groupIdback to summary
private final String groupId
resourceOutputback to summary
private final Path resourceOutput
sourceOutputback to summary
private final Path sourceOutput

Constructor Detail

Settingsback to summary
private Settings(Path sourceOutput, Path resourceOutput, Path classOutput, String groupId, String artifactId)

Method Detail

builderback to summary
public static AbstractAotProcessor.Settings.Builder builder()

Create a new Builder for Settings.

getArtifactIdback to summary
public String getArtifactId()

Get the artifact ID of the application.

getClassOutputback to summary
public Path getClassOutput()

Get the output directory for generated classes.

getGroupIdback to summary
public String getGroupId()

Get the group ID of the application.

getResourceOutputback to summary
public Path getResourceOutput()

Get the output directory for generated resources.

getSourceOutputback to summary
public Path getSourceOutput()

Get the output directory for generated sources.

org.springframework.context.aot back to summary

public final Class AbstractAotProcessor.Settings.Builder

extends Object
Class Inheritance
  • java.lang.Object
  • org.springframework.context.aot.AbstractAotProcessor.Settings.Builder

Fluent builder API for Settings.

Field Summary

Modifier and TypeField and Description
private String
private Path
private String
private Path
private Path

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public AbstractAotProcessor.Settings.Builder

Returns:

this builder for method chaining
artifactId
(String
the artifact ID of the application, used to locate native-image.properties
artifactId
)

Set the artifact ID of the application.

public AbstractAotProcessor.Settings
build()

Build the Settings configured in this Builder.

public AbstractAotProcessor.Settings.Builder

Returns:

this builder for method chaining
classOutput
(Path
the location of generated classes
classOutput
)

Set the output directory for generated classes.

public AbstractAotProcessor.Settings.Builder

Returns:

this builder for method chaining
groupId
(String
the group ID of the application, used to locate native-image.properties
groupId
)

Set the group ID of the application.

public AbstractAotProcessor.Settings.Builder

Returns:

this builder for method chaining
resourceOutput
(Path
the location of generated resources
resourceOutput
)

Set the output directory for generated resources.

public AbstractAotProcessor.Settings.Builder

Returns:

this builder for method chaining
sourceOutput
(Path
the location of generated sources
sourceOutput
)

Set the output directory for generated sources.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

artifactIdback to summary
private String artifactId
Annotations
@Nullable
classOutputback to summary
private Path classOutput
Annotations
@Nullable
groupIdback to summary
private String groupId
Annotations
@Nullable
resourceOutputback to summary
private Path resourceOutput
Annotations
@Nullable
sourceOutputback to summary
private Path sourceOutput
Annotations
@Nullable

Constructor Detail

Builderback to summary
private Builder()

Method Detail

artifactIdback to summary
public AbstractAotProcessor.Settings.Builder artifactId(String artifactId)

Set the artifact ID of the application.

Parameters
artifactId:String

the artifact ID of the application, used to locate native-image.properties

Returns:AbstractAotProcessor.Settings.Builder

this builder for method chaining

buildback to summary
public AbstractAotProcessor.Settings build()

Build the Settings configured in this Builder.

classOutputback to summary
public AbstractAotProcessor.Settings.Builder classOutput(Path classOutput)

Set the output directory for generated classes.

Parameters
classOutput:Path

the location of generated classes

Returns:AbstractAotProcessor.Settings.Builder

this builder for method chaining

groupIdback to summary
public AbstractAotProcessor.Settings.Builder groupId(String groupId)

Set the group ID of the application.

Parameters
groupId:String

the group ID of the application, used to locate native-image.properties

Returns:AbstractAotProcessor.Settings.Builder

this builder for method chaining

resourceOutputback to summary
public AbstractAotProcessor.Settings.Builder resourceOutput(Path resourceOutput)

Set the output directory for generated resources.

Parameters
resourceOutput:Path

the location of generated resources

Returns:AbstractAotProcessor.Settings.Builder

this builder for method chaining

sourceOutputback to summary
public AbstractAotProcessor.Settings.Builder sourceOutput(Path sourceOutput)

Set the output directory for generated sources.

Parameters
sourceOutput:Path

the location of generated sources

Returns:AbstractAotProcessor.Settings.Builder

this builder for method chaining