org.apache.maven.util
Class MavenTool

java.lang.Object
  extended byorg.apache.maven.util.MavenTool

public class MavenTool
extends java.lang.Object

Context/pull tool for use in MavenSession templates.

Author:
Daniel Rall

Constructor Summary
MavenTool()
          Creates a new instance.
 
Method Summary
 void addToCount(java.lang.Object object)
          Add an object to the list of counted items.
 java.util.Map getCount()
          get a list of counted items with the key being the number of times counted and the value any arbitrary item that was counted
 java.util.Map getCountDescending()
          get a list of counted items with the key being the number of times counted (in descending order) and the value any arbitrary item that was counted
 Project getProject()
          Accessor for the project property.
 void resetCount()
          Clear the counter so that there are zero items
 java.lang.String resolvePathFragment(java.lang.String baseDir, java.lang.String resource, org.apache.tools.ant.types.Path directories)
          Resolves a path fragment for the first resource found in directories.
protected  java.lang.String resolvePathFragment(java.lang.String baseDir, java.lang.String resource, java.lang.String[] paths)
          Called by resolvePathFragment(String, String, Path).
 java.lang.Integer toInteger(java.lang.String s)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MavenTool

public MavenTool()
Creates a new instance.

Method Detail

getProject

public Project getProject()
Accessor for the project property.

Returns:
the maven project being processed

resolvePathFragment

public java.lang.String resolvePathFragment(java.lang.String baseDir,
                                            java.lang.String resource,
                                            org.apache.tools.ant.types.Path directories)
Resolves a path fragment for the first resource found in directories.
 #set ($pathFragment =
 $maven.resolvePathFragment($context.toolbox.string.basedir, "foo/bar",
 ${src.set}))
 

Parameters:
baseDir - The directory to which directories are relative.
resource - The path to the resource to find in directories.
directories - The list of paths to search for resource in..
Returns:
The path fragment to resource.

resolvePathFragment

protected final java.lang.String resolvePathFragment(java.lang.String baseDir,
                                                     java.lang.String resource,
                                                     java.lang.String[] paths)
Called by resolvePathFragment(String, String, Path).

See Also:
resolvePathFragment(String, String, Path)

resetCount

public void resetCount()
Clear the counter so that there are zero items


addToCount

public void addToCount(java.lang.Object object)
Add an object to the list of counted items.

Parameters:
object - the item to be added.

getCountDescending

public java.util.Map getCountDescending()
get a list of counted items with the key being the number of times counted (in descending order) and the value any arbitrary item that was counted

Returns:
a sorted map of #times counted -> list of objects

getCount

public java.util.Map getCount()
get a list of counted items with the key being the number of times counted and the value any arbitrary item that was counted

Returns:
a sorted map of #times counted -> list of objects

toInteger

public java.lang.Integer toInteger(java.lang.String s)


Copyright © 2001-2008 Apache Software Foundation. All Rights Reserved.