Package: org.gradle.runtime.base

## [Java] Annotation Type ComponentModel

- org.gradle.runtime.base.ComponentModel

- Declares that the associated class declares a ComponentModel The following example demonstrates how to register a custom component using a plugin with a ComponentModel annotation. Furthermore the plugin creates an instance of SampleLibrary named 'sampleLib'.

       import org.gradle.model.*
       import org.gradle.model.collection.*

       interface SampleLibrary extends LibrarySpec {}
       class DefaultSampleLibrary extends DefaultLibrarySpec implements SampleLibrary {}

       apply plugin: MySamplePlugin

       class MySamplePlugin implements Plugin {
           void apply(final Project project) {}RuleSource:@ComponentModel(type = SampleLibrary.class, implementation = DefaultSampleLibrary.class)
           static class Rules {Mutate:void createSampleLibraryComponents(NamedItemCollectionBuilder componentSpecs) {
                   componentSpecs.create("sampleLib")
               }
           }
       }

- - ### Element Summary

    Required Element Summary
    Type | Name and Description
    --- | ---
    `Class<? extends LibrarySpec>` | `implementation` Denotes the implementation class of the LibrarySpec.
    `Class<? extends LibrarySpec>` | `type` Denotes the type of the LibrarySpec.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll`

- - ### Element Detail

    - #### public Class<? extends LibrarySpec> implementation

      Denotes the implementation class of the LibrarySpec.

    - #### public Class<? extends LibrarySpec> type

      Denotes the type of the LibrarySpec.