org.apache.maven.plugins.enforcer
Class DefaultEnforcementRuleHelper

java.lang.Object
  extended by org.apache.maven.plugins.enforcer.DefaultEnforcementRuleHelper
All Implemented Interfaces:
EnforcerRuleHelper, org.codehaus.plexus.component.configurator.expression.ExpressionEvaluator

public class DefaultEnforcementRuleHelper
extends Object
implements EnforcerRuleHelper

Default implementation of the EnforcementRuleHelper interface. This is used to help retrieve information from the session and provide useful elements like the log.

Version:
$Id: DefaultEnforcementRuleHelper.java 805190 2009-08-17 22:30:49Z hboutemy $
Author:
Brian Fox

Constructor Summary
DefaultEnforcementRuleHelper(org.apache.maven.execution.MavenSession session, org.codehaus.plexus.component.configurator.expression.ExpressionEvaluator evaluator, org.apache.maven.plugin.logging.Log log, org.codehaus.plexus.PlexusContainer container)
          Instantiates a new default enforcement rule helper.
 
Method Summary
 File alignToBaseDirectory(File theFile)
           
 Object evaluate(String theExpression)
           
 Object getComponent(Class clazz)
          Gets the component.
 Object getComponent(String theComponentKey)
          Gets the component.
 Object getComponent(String theRole, String theRoleHint)
          Gets the component.
 List getComponentList(String theRole)
          Gets the component list.
 Map getComponentMap(String theRole)
          Gets the component map.
 org.codehaus.plexus.PlexusContainer getContainer()
          Gets the container.
 org.apache.maven.plugin.logging.Log getLog()
          Gets the log.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultEnforcementRuleHelper

public DefaultEnforcementRuleHelper(org.apache.maven.execution.MavenSession session,
                                    org.codehaus.plexus.component.configurator.expression.ExpressionEvaluator evaluator,
                                    org.apache.maven.plugin.logging.Log log,
                                    org.codehaus.plexus.PlexusContainer container)
Instantiates a new default enforcement rule helper.

Parameters:
session - the session
evaluator - the evaluator
log - the log
container - the container
Method Detail

getLog

public org.apache.maven.plugin.logging.Log getLog()
Description copied from interface: EnforcerRuleHelper
Gets the log.

Specified by:
getLog in interface EnforcerRuleHelper
Returns:
the log

alignToBaseDirectory

public File alignToBaseDirectory(File theFile)
Specified by:
alignToBaseDirectory in interface org.codehaus.plexus.component.configurator.expression.ExpressionEvaluator

evaluate

public Object evaluate(String theExpression)
                throws org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException
Specified by:
evaluate in interface org.codehaus.plexus.component.configurator.expression.ExpressionEvaluator
Throws:
org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException

getComponent

public Object getComponent(Class clazz)
                    throws org.codehaus.plexus.component.repository.exception.ComponentLookupException
Description copied from interface: EnforcerRuleHelper
Gets the component.

Specified by:
getComponent in interface EnforcerRuleHelper
Parameters:
clazz - the clazz
Returns:
the component
Throws:
org.codehaus.plexus.component.repository.exception.ComponentLookupException - the component lookup exception

getComponent

public Object getComponent(String theComponentKey)
                    throws org.codehaus.plexus.component.repository.exception.ComponentLookupException
Description copied from interface: EnforcerRuleHelper
Gets the component.

Specified by:
getComponent in interface EnforcerRuleHelper
Parameters:
theComponentKey - the component key
Returns:
the component
Throws:
org.codehaus.plexus.component.repository.exception.ComponentLookupException - the component lookup exception

getComponent

public Object getComponent(String theRole,
                           String theRoleHint)
                    throws org.codehaus.plexus.component.repository.exception.ComponentLookupException
Description copied from interface: EnforcerRuleHelper
Gets the component.

Specified by:
getComponent in interface EnforcerRuleHelper
Parameters:
theRole - the role
theRoleHint - the role hint
Returns:
the component
Throws:
org.codehaus.plexus.component.repository.exception.ComponentLookupException - the component lookup exception

getComponentList

public List getComponentList(String theRole)
                      throws org.codehaus.plexus.component.repository.exception.ComponentLookupException
Description copied from interface: EnforcerRuleHelper
Gets the component list.

Specified by:
getComponentList in interface EnforcerRuleHelper
Parameters:
theRole - the role
Returns:
the component list
Throws:
org.codehaus.plexus.component.repository.exception.ComponentLookupException - the component lookup exception

getComponentMap

public Map getComponentMap(String theRole)
                    throws org.codehaus.plexus.component.repository.exception.ComponentLookupException
Description copied from interface: EnforcerRuleHelper
Gets the component map.

Specified by:
getComponentMap in interface EnforcerRuleHelper
Parameters:
theRole - the role
Returns:
the component map
Throws:
org.codehaus.plexus.component.repository.exception.ComponentLookupException - the component lookup exception

getContainer

public org.codehaus.plexus.PlexusContainer getContainer()
Description copied from interface: EnforcerRuleHelper
Gets the container.

Specified by:
getContainer in interface EnforcerRuleHelper
Returns:
the container


Copyright © 2007-2012 Apache Software Foundation. All Rights Reserved.