Package: org.gradle.platform.base

## [Java] Annotation Type ComponentType

- org.gradle.platform.base.ComponentType

- Declares that a custom ComponentSpec type. The following example demonstrates how to register a custom component type using a plugin with a ComponentType annotation. Furthermore the plugin creates an instance of SampleComponent named 'sampleComponent'.

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

       interface SampleComponent extends ComponentSpec {}
       class DefaultSampleComponent extends BaseComponentSpec implements SampleComponent {}

       apply plugin: MySamplePlugin

       class MySamplePlugin implements Plugin {
           void apply(final Project project) {}

           @RuleSource
           static class Rules {
               @ComponentType
               void register(ComponentTypeBuilder builder) {
                   builder.defaultImplementation(DefaultSampleComponent)
               }

               @Mutate
               void createSampleLibraryComponents(CollectionBuilder componentSpecs) {
                   componentSpecs.create("sampleComponent")
               }
           }
       }

- - ### Inherited Methods Summary

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