View Javadoc
1   package org.codehaus.plexus.metadata.merge.support;
2   
3   /**
4    * All allowable tags in <code>components.xml</code> and their bindings to
5    * {@link org.codehaus.plexus.metadata.merge.support.Mergeable} counterparts (if required).
6    * <p>
7    * <em>This implementation may change.</em></p>
8    * <p>
9    * TODO Might be an idea factor and set up the list of allowed tags here itself.</p>
10   *
11   * @author <a href='mailto:rahul.thakur.xdev@gmail.com'>Rahul Thakur</a>
12   */
13  public class PlexusXmlTag extends DescriptorTag {
14      public static final PlexusXmlTag COMPONENT_SET =
15              new PlexusXmlTag("component-set", false, ComponentSetElement.class);
16  
17      public static final PlexusXmlTag COMPONENTS = new PlexusXmlTag("components", true, ComponentsElement.class);
18  
19      public static final PlexusXmlTag COMPONENT = new PlexusXmlTag("component", true, ComponentElement.class);
20  
21      public static final PlexusXmlTag ROLE = new PlexusXmlTag("role");
22  
23      public static final PlexusXmlTag ROLE_HINT = new PlexusXmlTag("role-hint");
24  
25      public static final PlexusXmlTag FIELD_NAME = new PlexusXmlTag("field-name");
26  
27      public static final PlexusXmlTag IMPLEMENTATION = new PlexusXmlTag("implementation");
28  
29      public static final PlexusXmlTag LIFECYCLE_HANDLER = new PlexusXmlTag("lifecycle-handler", false, null);
30  
31      public static final PlexusXmlTag REQUIREMENTS = new PlexusXmlTag("requirements", true, RequirementsElement.class);
32  
33      public static final PlexusXmlTag CONFIGURATION =
34              new PlexusXmlTag("configuration", true, ConfigurationElement.class);
35  
36      public static final PlexusXmlTag REQUIREMENT = new PlexusXmlTag("requirement", true, RequirementElement.class);
37  
38      /**
39       * @param tagName
40       * @param isMultipleAllowed
41       * @param mergeableClass Class that wraps this tag (as JDom element) and provides for merging same tags.
42       */
43      private PlexusXmlTag(String tagName, boolean isMultipleAllowed, Class mergeableClass) {
44          super(tagName, isMultipleAllowed, mergeableClass);
45      }
46  
47      /**
48       * By default we don't allow multiples of same tag names.
49       *
50       * @param tagName
51       */
52      private PlexusXmlTag(String tagName) {
53          super(tagName, false, null);
54      }
55  }