001package org.apache.maven.enforcer.rule.api; 002 003/* 004 * Licensed to the Apache Software Foundation (ASF) under one 005 * or more contributor license agreements. See the NOTICE file 006 * distributed with this work for additional information 007 * regarding copyright ownership. The ASF licenses this file 008 * to you under the Apache License, Version 2.0 (the 009 * "License"); you may not use this file except in compliance 010 * with the License. You may obtain a copy of the License at 011 * 012 * http://www.apache.org/licenses/LICENSE-2.0 013 * 014 * Unless required by applicable law or agreed to in writing, 015 * software distributed under the License is distributed on an 016 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 017 * KIND, either express or implied. See the License for the 018 * specific language governing permissions and limitations 019 * under the License. 020 */ 021 022import java.util.List; 023import java.util.Map; 024 025import org.apache.maven.plugin.logging.Log; 026import org.codehaus.plexus.PlexusContainer; 027import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluator; 028import org.codehaus.plexus.component.repository.exception.ComponentLookupException; 029 030 031/** 032 * This is the interface that all helpers will use. This 033 * provides access to the log, session and components to the 034 * rules. 035 * 036 * @author <a href="mailto:brianf@apache.org">Brian Fox</a> 037 */ 038public interface EnforcerRuleHelper 039 extends ExpressionEvaluator 040{ 041 042 /** 043 * Gets the log. 044 * 045 * @return the log 046 */ 047 Log getLog (); 048 049 /** 050 * Gets the component. 051 * 052 * @param clazz the clazz 053 * 054 * @return the component 055 * 056 * @throws ComponentLookupException the component lookup exception 057 */ 058 Object getComponent ( Class clazz ) 059 throws ComponentLookupException; 060 061 /** 062 * Gets the component. 063 * 064 * @param componentKey the component key 065 * 066 * @return the component 067 * 068 * @throws ComponentLookupException the component lookup exception 069 */ 070 Object getComponent ( String componentKey ) 071 throws ComponentLookupException; 072 073 /** 074 * Gets the component. 075 * 076 * @param role the role 077 * @param roleHint the role hint 078 * 079 * @return the component 080 * 081 * @throws ComponentLookupException the component lookup exception 082 */ 083 Object getComponent ( String role, String roleHint ) 084 throws ComponentLookupException; 085 086 /** 087 * Gets the component map. 088 * 089 * @param role the role 090 * 091 * @return the component map 092 * 093 * @throws ComponentLookupException the component lookup exception 094 */ 095 Map getComponentMap ( String role ) 096 throws ComponentLookupException; 097 098 /** 099 * Gets the component list. 100 * 101 * @param role the role 102 * 103 * @return the component list 104 * 105 * @throws ComponentLookupException the component lookup exception 106 */ 107 List getComponentList ( String role ) 108 throws ComponentLookupException; 109 110 /** 111 * Gets the container. 112 * 113 * @return the container 114 */ 115 PlexusContainer getContainer(); 116}