Overview | Package | Class | Deprecated | Index | Help
| Groovy Documentation
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | METHOD | DETAIL: FIELD | METHOD

## org.gradle.plugins.ear.descriptor
[Java] Interface DeploymentDescriptor

    public interface DeploymentDescriptor

A deployment descriptor such as application.xml.

Authors:
  David Gileadi

Method Summary
`java.lang.String` | `getApplicationName()` The application name.
`java.lang.String` | `getDescription()` The application description.
`java.lang.String` | `getDisplayName()` The application display name.
`java.lang.String` | `getFileName()` The name of the descriptor file, typically "application.xml"
`java.lang.Boolean` | `getInitializeInOrder()` Whether to initialize modules in the order they appear in the descriptor, with the exception of client modules.
`java.lang.String` | `getLibraryDirectory()` The name of the directory to look for libraries in.
`java.util.Map` | `getModuleTypeMappings()` Mapping of module paths to module types.
`java.util.Set` | `getModules()` List of module descriptors.
`java.util.Set` | `getSecurityRoles()` List of security roles.
`java.lang.String` | `getVersion()` The version of application.xml.
`DeploymentDescriptor` | `module(EarModule module, java.lang.String type)` Add a module to the deployment descriptor.
`DeploymentDescriptor` | `module(java.lang.String path, java.lang.String type)` Add a module to the deployment descriptor.
`DeploymentDescriptor` | `readFrom(java.io.Reader reader)` Reads the deployment descriptor from a reader.
`boolean` | `readFrom(java.lang.Object path)` Reads the deployment descriptor from a file.
`DeploymentDescriptor` | `securityRole(EarSecurityRole role)` Add a security role to the deployment descriptor.
`DeploymentDescriptor` | `securityRole(java.lang.String role)` Add a security role to the deployment descriptor.
`void` | `setApplicationName(java.lang.String applicationName)`
`void` | `setDescription(java.lang.String description)`
`void` | `setDisplayName(java.lang.String displayName)`
`void` | `setFileName(java.lang.String fileName)`
`void` | `setInitializeInOrder(java.lang.Boolean initializeInOrder)`
`void` | `setLibraryDirectory(java.lang.String libraryDirectory)`
`void` | `setModuleTypeMappings(java.util.Map moduleTypeMappings)`
`void` | `setModules(java.util.Set modules)`
`void` | `setSecurityRoles(java.util.Set securityRoles)`
`void` | `setVersion(java.lang.String version)`
`DeploymentDescriptor` | `webModule(java.lang.String path, java.lang.String contextRoot)` Add a web module to the deployment descriptor.
`DeploymentDescriptor` | `withXml(groovy.lang.Closure closure)` Adds a closure to be called when the XML document has been created.
`DeploymentDescriptor` | `withXml(Action action)` Adds an action to be called when the XML document has been created.
`DeploymentDescriptor` | `writeTo(java.io.Writer writer)` Writes the deployment descriptor into a writer.
`DeploymentDescriptor` | `writeTo(java.lang.Object path)` Writes the deployment descriptor into a file.

Method Detail

### getApplicationName

    public java.lang.String getApplicationName()

  The application name. Optional. Only valid with version 6.

### getDescription

    public java.lang.String getDescription()

  The application description. Optional.

### getDisplayName

    public java.lang.String getDisplayName()

  The application display name. Optional.

### getFileName

    public java.lang.String getFileName()

  The name of the descriptor file, typically "application.xml"

### getInitializeInOrder

    public java.lang.Boolean getInitializeInOrder()

  Whether to initialize modules in the order they appear in the descriptor, with the exception of client modules. Optional. Only valid with version 6.

### getLibraryDirectory

    public java.lang.String getLibraryDirectory()

  The name of the directory to look for libraries in. Optional. If not specified then "lib" is assumed. Typically this should be set via EarPluginConvention.setLibDirName instead of this property.

### getModuleTypeMappings

    public java.util.Map getModuleTypeMappings()

  Mapping of module paths to module types. Non-null by default. For example, to specify that a module is a java module, set `moduleTypeMappings["myJavaModule.jar"] = "java"`.

### getModules

    public java.util.Set getModules()

  List of module descriptors. Must not be empty. Non-null and order-maintaining by default. Must maintain order if initializeInOrder is `true`.

### getSecurityRoles

    public java.util.Set getSecurityRoles()

  List of security roles. Optional. Non-null and order-maintaining by default.

### getVersion

    public java.lang.String getVersion()

  The version of application.xml. Required. Valid versions are "1.3", "1.4", "5" and "6". Defaults to "6".

### module

    public DeploymentDescriptor module(EarModule module, java.lang.String type)

  Add a module to the deployment descriptor.
  Parameters:
    `module` - The module to add.
    `type` - The type of the module, such as "ejb", "java", etc.
  Returns:
    this.

### module

    public DeploymentDescriptor module(java.lang.String path, java.lang.String type)

  Add a module to the deployment descriptor.
  Parameters:
    `path` - The path of the module to add.
    `type` - The type of the module, such as "ejb", "java", etc.
  Returns:
    this.

### readFrom

    public DeploymentDescriptor readFrom(java.io.Reader reader)

  Reads the deployment descriptor from a reader.
  Parameters:
    `reader` - The reader to read the deployment descriptor from
  Returns:
    this

### readFrom

    public boolean readFrom(java.lang.Object path)

  Reads the deployment descriptor from a file. The paths are resolved as defined by Project.files
  Parameters:
    `path` - The path of the file to read the deployment descriptor from
  Returns:
    whether the descriptor could be read from the given path

### securityRole

    public DeploymentDescriptor securityRole(EarSecurityRole role)

  Add a security role to the deployment descriptor.
  Parameters:
    `role` - The security role to add.
  Returns:
    this.

### securityRole

    public DeploymentDescriptor securityRole(java.lang.String role)

  Add a security role to the deployment descriptor.
  Parameters:
    `role` - The name of the security role to add.
  Returns:
    this.

### setApplicationName

    public void setApplicationName(java.lang.String applicationName)

### setDescription

    public void setDescription(java.lang.String description)

### setDisplayName

    public void setDisplayName(java.lang.String displayName)

### setFileName

    public void setFileName(java.lang.String fileName)

### setInitializeInOrder

    public void setInitializeInOrder(java.lang.Boolean initializeInOrder)

### setLibraryDirectory

    public void setLibraryDirectory(java.lang.String libraryDirectory)

### setModuleTypeMappings

    public void setModuleTypeMappings(java.util.Map moduleTypeMappings)

### setModules

    public void setModules(java.util.Set modules)

### setSecurityRoles

    public void setSecurityRoles(java.util.Set securityRoles)

### setVersion

    public void setVersion(java.lang.String version)

### webModule

    public DeploymentDescriptor webModule(java.lang.String path, java.lang.String contextRoot)

  Add a web module to the deployment descriptor.
  Parameters:
    `path` - The path of the module to add.
    `contextRoot` - The context root type of the web module.
  Returns:
    this.

### withXml

    public DeploymentDescriptor withXml(groovy.lang.Closure closure)

  Adds a closure to be called when the XML document has been created. The XML is passed to the closure as a parameter in form of a groovy.util.Node. The closure can modify the XML before it is written to the output file. This allows additional JavaEE version 6 elements like "data-source" or "resource-ref" to be included.
  Parameters:
    `closure` - The closure to execute when the XML has been created
  Returns:
    this

### withXml

    public DeploymentDescriptor withXml(Action action)

  Adds an action to be called when the XML document has been created. The XML is passed to the action as a parameter in form of a groovy.util.Node. The action can modify the XML before it is written to the output file. This allows additional JavaEE version 6 elements like "data-source" or "resource-ref" to be included.
  Parameters:
    `action` - The action to execute when the XML has been created
  Returns:
    this

### writeTo

    public DeploymentDescriptor writeTo(java.io.Writer writer)

  Writes the deployment descriptor into a writer.
  Parameters:
    `writer` - The writer to write the deployment descriptor to
  Returns:
    this

### writeTo

    public DeploymentDescriptor writeTo(java.lang.Object path)

  Writes the deployment descriptor into a file. The paths are resolved as defined by Project.files
  Parameters:
    `path` - The path of the file to write the deployment descriptor into.
  Returns:
    this

Groovy Documentation