Class DescriptorTag

java.lang.Object
org.codehaus.plexus.metadata.merge.support.DescriptorTag
Direct Known Subclasses:
PlexusXmlTag

public class DescriptorTag extends Object
Represents the various top-level tags in a deployment descriptor as a typesafe enumeration.
  • Field Details

    • tagName

      private String tagName
      The tag name.
    • multipleAllowed

      private boolean multipleAllowed
      Whether multiple occurrences of the tag in the descriptor are allowed.
    • mergeableClass

      private Class mergeableClass
      Class that wraps this tag and provides for merging same tags.
  • Constructor Details

    • DescriptorTag

      public DescriptorTag(String tagName)
      Constructor.
      Parameters:
      tagName - The tag name of the element
    • DescriptorTag

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

    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getTagName

      public 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 String toString()
      Overrides:
      toString in class Object
    • createMergeable

      public Mergeable createMergeable(org.jdom2.Element element) throws Exception
      Creates an Mergeable instance from the registered class for this tag instance.
      Parameters:
      element - Element.
      Returns:
      instance of Mergeable.
      Throws:
      Exception - if there was an error creating an instance.