org.codehaus.plexus.metadata.merge.support

## Class DescriptorTag

- java.lang.Object
- - org.codehaus.plexus.metadata.merge.support.DescriptorTag

Direct Known Subclasses:
  PlexusXmlTag

    public class DescriptorTag
    extends java.lang.Object

Represents the various top-level tags in a deployment descriptor as a typesafe enumeration.

Version:
  $Id: DescriptorTag.java 7689 2008-08-23 16:09:20Z jvanzyl $

### Constructor Summary

Constructors
Constructor and Description
`DescriptorTag(java.lang.String tagName)` Constructor.
`DescriptorTag(java.lang.String tagName, boolean isMultipleAllowed)` Deprecated. Use `DescriptorTag(String,boolean,Class)` instead
`DescriptorTag(java.lang.String tagName, boolean isMultipleAllowed, java.lang.Class mergeableClass)` Constructor.

### Method Summary

Methods
`Mergeable` `createMergeable(org.jdom.Element element)` Creates an `Mergeable` instance from the registered class for this tag instance.
`boolean` `equals(java.lang.Object other)`
`java.lang.String` `getTagName()`
`int` `hashCode()`
`boolean` `isMergeable()` Determines if a particular Tag is mergeable or not.
`boolean` `isMultipleAllowed()` Returns whether the tag may occur multiple times in the descriptor.
`java.lang.String` `toString()`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

### Constructor Detail

#### DescriptorTag

    public DescriptorTag(java.lang.String tagName)

Constructor.

Parameters:
  `tagName` - The tag name of the element

#### DescriptorTag

    public DescriptorTag(java.lang.String tagName,
                 boolean isMultipleAllowed)

Deprecated. Use `DescriptorTag(String,boolean,Class)` instead
Constructor.

Parameters:
  `tagName` - The tag name of the element
  `isMultipleAllowed` - Whether the element may occur multiple times in the descriptor

#### DescriptorTag

    public DescriptorTag(java.lang.String tagName,
                 boolean isMultipleAllowed,
                 java.lang.Class mergeableClass)

Constructor.

Parameters:
  `tagName` - The tag name of the element
  `isMultipleAllowed` - Whether the element may occur multiple times in the descriptor
  `mergeableClass` - Concrete implementation of `Mergeable` that is bound this tag.

### Method Detail

#### equals

    public boolean equals(java.lang.Object other)

Overrides:
  `equals` in class `java.lang.Object`

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `java.lang.Object`

#### getTagName

    public java.lang.String getTagName()

#### isMultipleAllowed

    public boolean isMultipleAllowed()

Returns whether the tag may occur multiple times in the descriptor.

Returns:
  Whether multiple occurrences are allowed

#### isMergeable

    public boolean isMergeable()

Determines if a particular Tag is mergeable or not.

Basically means if we have a `Mergeable` class registered for a tag instance.

Returns:
  `true` if this tag is mergeable.

#### toString

    public java.lang.String toString()

Overrides:
  `toString` in class `java.lang.Object`

#### createMergeable

    public Mergeable createMergeable(org.jdom.Element element)
                              throws java.lang.Exception

Creates an `Mergeable` instance from the registered class for this tag instance.

Returns:
  instance of `Mergeable`.
Throws:
  `java.lang.Exception` - if there was an error creating an instance.