2
* Licensed to the Apache Software Foundation (ASF) under one
3
* or more contributor license agreements. See the NOTICE file
4
* distributed with this work for additional information
5
* regarding copyright ownership. The ASF licenses this file
6
* to you under the Apache License, Version 2.0 (the
7
* "License"); you may not use this file except in compliance
8
* with the License. You may obtain a copy of the License at
10
* http://www.apache.org/licenses/LICENSE-2.0
12
* Unless required by applicable law or agreed to in writing,
13
* software distributed under the License is distributed on an
14
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
* KIND, either express or implied. See the License for the
16
* specific language governing permissions and limitations
19
package org.apache.maven.plugins.enforcer.utils;
21
import org.apache.maven.execution.MavenSession;
22
import org.apache.maven.plugins.enforcer.EnforcerExpressionEvaluator;
23
import org.apache.maven.project.MavenProject;
24
import org.apache.maven.project.path.PathTranslator;
25
import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException;
27
// TODO: Auto-generated Javadoc
29
* The Class MockEnforcerExpressionEvaluator.
31
public class MockEnforcerExpressionEvaluator
32
extends EnforcerExpressionEvaluator
36
* Instantiates a new mock enforcer expression evaluator.
38
* @param theContext the the context
39
* @param thePathTranslator the the path translator
40
* @param theProject the the project
42
public MockEnforcerExpressionEvaluator( MavenSession theContext, PathTranslator thePathTranslator,
43
MavenProject theProject )
45
super( theContext, thePathTranslator, theProject );
46
// TODO Auto-generated constructor stub
52
* @see org.apache.maven.plugin.PluginParameterExpressionEvaluator#evaluate(java.lang.String)
54
public Object evaluate( String expr )
55
throws ExpressionEvaluationException
59
// just remove the ${ } and return the name as the value
60
return expr.replaceAll( "\\$\\{|}", "" );