org.apache.maven.tools.plugin.util
Class PluginUtils

java.lang.Object
  extended by org.apache.maven.tools.plugin.util.PluginUtils

public final class PluginUtils
extends java.lang.Object

Convenience methods to play with Maven plugins.

Version:
$Id: PluginUtils.java 690403 2008-08-29 22:08:31Z vsiveton $
Author:
jdcasey

Method Summary
static void element(org.codehaus.plexus.util.xml.XMLWriter w, java.lang.String name, java.lang.String value)
           
static java.lang.String[] findSources(java.lang.String basedir, java.lang.String include)
           
static java.lang.String[] findSources(java.lang.String basedir, java.lang.String include, java.lang.String exclude)
           
static boolean isMavenReport(java.lang.String impl, org.apache.maven.project.MavenProject project)
           
static java.lang.String makeHtmlValid(java.lang.String description)
          Fixes some javadoc comment to become a valid XHTML snippet.
static void sortMojoParameters(java.util.List parameters)
          Sorts the specified mojo parameters by name.
static void sortMojos(java.util.List mojoDescriptors)
          Sorts the specified mojo descriptors by goal name.
static java.util.List toComponentDependencies(java.util.List dependencies)
           
static java.lang.String toText(java.lang.String html)
          Converts a HTML fragment as extracted from a javadoc comment to a plain text string.
static void writeDependencies(org.codehaus.plexus.util.xml.XMLWriter w, org.apache.maven.plugin.descriptor.PluginDescriptor pluginDescriptor)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

findSources

public static java.lang.String[] findSources(java.lang.String basedir,
                                             java.lang.String include)
Parameters:
basedir - not null
include - not null
Returns:
list of included files with default SCM excluded files

findSources

public static java.lang.String[] findSources(java.lang.String basedir,
                                             java.lang.String include,
                                             java.lang.String exclude)
Parameters:
basedir - not null
include - not null
exclude - could be null
Returns:
list of included files

writeDependencies

public static void writeDependencies(org.codehaus.plexus.util.xml.XMLWriter w,
                                     org.apache.maven.plugin.descriptor.PluginDescriptor pluginDescriptor)
Parameters:
w - not null writer
pluginDescriptor - not null

toComponentDependencies

public static java.util.List toComponentDependencies(java.util.List dependencies)
Parameters:
dependencies - not null list of Dependency
Returns:
list of component dependencies

element

public static void element(org.codehaus.plexus.util.xml.XMLWriter w,
                           java.lang.String name,
                           java.lang.String value)
Parameters:
w - not null writer
name - not null
value - could be null

isMavenReport

public static boolean isMavenReport(java.lang.String impl,
                                    org.apache.maven.project.MavenProject project)
                             throws java.lang.IllegalArgumentException
Parameters:
impl - a Mojo implementation, not null
project - a MavenProject instance, could be null
Returns:
true is the Mojo implementation implements MavenReport, false otherwise.
Throws:
java.lang.IllegalArgumentException - if any

makeHtmlValid

public static java.lang.String makeHtmlValid(java.lang.String description)
Fixes some javadoc comment to become a valid XHTML snippet.

Parameters:
description - Javadoc description with HTML tags, may be null.
Returns:
The description with valid XHTML tags, never null.

sortMojos

public static void sortMojos(java.util.List mojoDescriptors)
Sorts the specified mojo descriptors by goal name.

Parameters:
mojoDescriptors - The mojo descriptors to sort, may be null.
See Also:
MojoDescriptor.getGoal()

sortMojoParameters

public static void sortMojoParameters(java.util.List parameters)
Sorts the specified mojo parameters by name.

Parameters:
parameters - The mojo parameters to sort, may be null.
Since:
2.4.4
See Also:
Parameter.getName()

toText

public static java.lang.String toText(java.lang.String html)
Converts a HTML fragment as extracted from a javadoc comment to a plain text string. This method tries to retain as much of the text formatting as possible by means of the following transformations:

Parameters:
html - The HTML fragment to convert to plain text, may be null.
Returns:
A string with HTML tags converted into pure text, never null.
Since:
2.4.3


Copyright © 2004-2010 The Apache Software Foundation. All Rights Reserved.