api / org.gradle.tooling.provider.model

Package org.gradle.tooling.provider.model



interface ParameterizedToolingModelBuilder<T : Any> : ToolingModelBuilder

A ToolingModelBuilder which can be parametrized by the client.

The parameter type T does not need to implement the interface defined in the client side, but it does need to have the same structure. The Tooling API will create a view from the client side parameter type to the one defined in this model builder, and deal automatically with missing methods in order to allow evolution of the models.

All classes implementing this interface should also implement methods from ToolingModelBuilder, which will be used to determine if a model can be built by the current builder and to generate the model in case no parameter is passed from the client. The parameter type should be bound to the model type.


interface ToolingModelBuilder

Responsible for building tooling models to return to the tooling API client.

The #buildAll(String, Project) method is called to create a model for a given project. The model is serialized to the client process and passed to the client application.

The model object is adapted to the Java type that is used by the client by generating a view, or wrapper object, over the model object. The model object does not need to implement the client Java type, but it does need to have the same structure as the client type. This means that the model object should have the same properties and methods as those defined on the client type. The tooling API deals with missing properties and methods, to allow evolution of the models. It will also adapt the values returned by the methods of the model object to the types used by the client.

Although it is not enforced, the model object should be immutable, as the tooling API will do some caching and other performance optimizations on the assumption that the model is effectively immutable. The tooling API does not make any guarantees about how the client application will use the model object.


interface ToolingModelBuilderRegistry

A registry of tooling model builders. Adding a builder to this registry makes a model (or models) available via the tooling API.



open class UnknownModelException : GradleException

Thrown when an unknown tooling model is requested.