EclipseWtpFacet (Gradle API 2.14.1)

Package: org.gradle.plugins.ide.eclipse.model

## [Java] Class EclipseWtpFacet

- org.gradle.plugins.ide.eclipse.model.EclipseWtpFacet

- Enables fine-tuning wtp facet details of the Eclipse plugin

  Advanced configuration closures beforeMerged and whenMerged receive WtpFacet object as parameter.

       apply plugin: 'java'
       apply plugin: 'war'
       apply plugin: 'eclipse-wtp'

       eclipse {
         wtp {
           facet {
             //you can add some extra wtp facets; mandatory keys: 'name', 'version':
             facet name: 'someCoolFacet', version: '1.3'

             file {
               //if you want to mess with the resulting XML in whatever way you fancy
               withXml {
                 def node = it.asNode()
                 node.appendNode('xml', 'is what I love')
               }

               //beforeMerged and whenMerged closures are the highest voodoo for the tricky edge cases.
               //the type passed to the closures is WtpFacet

               //closure executed after wtp facet file content is loaded from existing file
               //but before gradle build information is merged
               beforeMerged { wtpFacet ->
                 //tinker with WtpFacet here
               }

               //closure executed after wtp facet file content is loaded from existing file
               //and after gradle build information is merged
               whenMerged { wtpFacet ->
                 //you can tinker with the WtpFacet here
               }
             }
           }
         }
       }

- - ### Constructor Summary

    Constructors
    Constructor and description
    `EclipseWtpFacet (XmlFileContentMerger file)`

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `void` | `facet(Map<String, ?> args)` Adds a facet.
    `void` | `file(groovy.lang.Closure closure)` Enables advanced configuration like tinkering with the output XML or affecting the way existing wtp facet file content is merged with gradle build information
    `List<Facet>` | `getFacets()` The facets to be added as elements.
    `XmlFileContentMerger` | `getFile()` See file(Closure)
    `void` | `mergeXmlFacet(WtpFacet xmlFacet)`
    `void` | `setFacets(List<Facet> facets)`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class groovy.lang.GroovyObjectSupport` | `groovy.lang.GroovyObjectSupport#setProperty(java.lang.String, java.lang.Object), groovy.lang.GroovyObjectSupport#getProperty(java.lang.String), groovy.lang.GroovyObjectSupport#invokeMethod(java.lang.String, java.lang.Object), groovy.lang.GroovyObjectSupport#setMetaClass(groovy.lang.MetaClass), groovy.lang.GroovyObjectSupport#getMetaClass(), groovy.lang.GroovyObjectSupport#wait(long, int), groovy.lang.GroovyObjectSupport#wait(long), groovy.lang.GroovyObjectSupport#wait(), groovy.lang.GroovyObjectSupport#equals(java.lang.Object), groovy.lang.GroovyObjectSupport#toString(), groovy.lang.GroovyObjectSupport#hashCode(), groovy.lang.GroovyObjectSupport#getClass(), groovy.lang.GroovyObjectSupport#notify(), groovy.lang.GroovyObjectSupport#notifyAll()`
    `class Object` | `wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll`

- - ### Constructor Detail

    - #### public EclipseWtpFacet(XmlFileContentMerger file)

  - ### Method Detail

    - #### public void facet(Map<String, ?> args)

      Adds a facet.

      For examples see docs for EclipseWtpFacet

      Parameters:
        `args` - A map that must contain a 'name' and 'version' key with corresponding values.

    - #### public void file(groovy.lang.Closure closure)

      Enables advanced configuration like tinkering with the output XML or affecting the way existing wtp facet file content is merged with gradle build information

      The object passed to whenMerged{} and beforeMerged{} closures is of type WtpFacet

      For example see docs for EclipseWtpFacet

    - #### public List<Facet> getFacets()

      The facets to be added as elements.

      For examples see docs for EclipseWtpFacet

    - #### public XmlFileContentMerger getFile()

      See file(Closure)

    - #### public void mergeXmlFacet(WtpFacet xmlFacet)

    - #### public void setFacets(List<Facet> facets)