Class 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.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      Mergeable createMergeable​(org.jdom2.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.
        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.jdom2.Element element)
                                  throws java.lang.Exception
        Creates an Mergeable instance from the registered class for this tag instance.
        Parameters:
        element - Element.
        Returns:
        instance of Mergeable.
        Throws:
        java.lang.Exception - if there was an error creating an instance.