org.ops4j.pax.construct.inherit
Class PluginXml

java.lang.Object
  extended by org.ops4j.pax.construct.inherit.PluginXml

public class PluginXml
extends java.lang.Object

Plugin metadata, usually stored in META-INF/maven/plugin.xml


Constructor Summary
PluginXml(java.io.File file)
          Parses a file presumed to contain plugin metadata
 
Method Summary
 org.codehaus.plexus.util.xml.Xpp3Dom findMojo(java.lang.String goal)
          Finds a mojo descriptor with a named goal
 org.codehaus.plexus.util.xml.Xpp3Dom[] getMojos()
          Gets all mojo descriptors
static void mergeMojo(org.codehaus.plexus.util.xml.Xpp3Dom mojo, org.codehaus.plexus.util.xml.Xpp3Dom superMojo)
          Merges a mojo descriptor with its super-mojo (inherit from it) The local mojo is considered the dominant one - if any parameters, configuration or requirements match then the local version is kept.
 java.lang.String toString()
          
 void write()
          Writes the plugin metadata back to the file where it was loaded from
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PluginXml

public PluginXml(java.io.File file)
          throws org.codehaus.plexus.util.xml.pull.XmlPullParserException,
                 java.io.IOException
Parses a file presumed to contain plugin metadata

Parameters:
file - file containing plugin metadata
Throws:
org.codehaus.plexus.util.xml.pull.XmlPullParserException
java.io.IOException
Method Detail

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object

getMojos

public org.codehaus.plexus.util.xml.Xpp3Dom[] getMojos()
Gets all mojo descriptors

Returns:
an array of mojo descriptors

findMojo

public org.codehaus.plexus.util.xml.Xpp3Dom findMojo(java.lang.String goal)
Finds a mojo descriptor with a named goal

Parameters:
goal - mojo goal
Returns:
first matching mojo descriptor, null if not found

mergeMojo

public static void mergeMojo(org.codehaus.plexus.util.xml.Xpp3Dom mojo,
                             org.codehaus.plexus.util.xml.Xpp3Dom superMojo)
Merges a mojo descriptor with its super-mojo (inherit from it) The local mojo is considered the dominant one - if any parameters, configuration or requirements match then the local version is kept. Any parameters, configuration or requirements not in the local mojo are appended to its descriptor

Parameters:
mojo - local mojo inheriting from superMojo
superMojo - mojo being extended

write

public void write()
           throws java.io.IOException
Writes the plugin metadata back to the file where it was loaded from

Throws:
java.io.IOException


Copyright © 2008. All Rights Reserved.