org.codehaus.plexus.cdc.merge.support

Class DescriptorTag

public class DescriptorTag extends 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(String tagName)
Constructor.
DescriptorTag(String tagName, boolean isMultipleAllowed)
Constructor.
DescriptorTag(String tagName, boolean isMultipleAllowed, Class mergeableClass)
Constructor.
Method Summary
MergeablecreateMergeable(Element element)
Creates an Mergeable instance from the registered class for this tag instance.
booleanequals(Object other)
StringgetTagName()
inthashCode()
booleanisMergeable()
Determines if a particular Tag is mergeable or not.
booleanisMultipleAllowed()
Returns whether the tag may occur multiple times in the descriptor.
StringtoString()

Constructor Detail

DescriptorTag

public DescriptorTag(String tagName)
Constructor.

Parameters: tagName The tag name of the element

DescriptorTag

public DescriptorTag(String tagName, boolean isMultipleAllowed)

Deprecated: Use DescriptorTag instead

Constructor.

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

DescriptorTag

public DescriptorTag(String tagName, boolean isMultipleAllowed, 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

createMergeable

public Mergeable createMergeable(Element element)
Creates an Mergeable instance from the registered class for this tag instance.

Returns: instance of Mergeable.

Throws: Exception if there was an error creating an instance.

equals

public boolean equals(Object other)

getTagName

public String getTagName()

hashCode

public int hashCode()

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.

isMultipleAllowed

public boolean isMultipleAllowed()
Returns whether the tag may occur multiple times in the descriptor.

Returns: Whether multiple occurrences are allowed

toString

public String toString()
Copyright © 2001-2010 Codehaus. All Rights Reserved.