org.codehaus.plexus.cdc.merge.support
Class DescriptorTag

java.lang.Object
  extended by org.codehaus.plexus.cdc.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 3522 2006-07-12 15:06:21Z brett $

Constructor Summary
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
 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.


Copyright © 2001-2008 Codehaus. All Rights Reserved.