1 package org.codehaus.plexus.interpolation.fixed;
2
3 /*
4 * Copyright 2014 The Codehaus Foundation.
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 * http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 */
18
19 import java.util.List;
20
21 /**
22 * Wraps an arbitrary object with an {@link org.codehaus.plexus.interpolation.fixed.ObjectBasedValueSource} instance, then
23 * wraps that source with a {@link org.codehaus.plexus.interpolation.fixed.PrefixedValueSourceWrapper} instance, to which
24 * this class delegates all of its calls.
25 */
26 public class PrefixedObjectValueSource extends AbstractDelegatingValueSource {
27
28 /**
29 * Wrap the specified root object, allowing the specified expression prefix.
30 * @param prefix the prefix.
31 * @param root The root of the graph.
32 */
33 public PrefixedObjectValueSource(String prefix, Object root) {
34 super(new PrefixedValueSourceWrapper(new ObjectBasedValueSource(root), prefix));
35 }
36
37 /**
38 * Wrap the specified root object, allowing the specified list of expression
39 * prefixes and setting whether the {@link org.codehaus.plexus.interpolation.PrefixedValueSourceWrapper} allows
40 * unprefixed expressions.
41 * @param possiblePrefixes The list of possible prefixed.
42 * @param root The root of the graph.
43 * @param allowUnprefixedExpressions allow unrefixed expressions or not.
44 */
45 public PrefixedObjectValueSource(List<String> possiblePrefixes, Object root, boolean allowUnprefixedExpressions) {
46 super(new PrefixedValueSourceWrapper(
47 new ObjectBasedValueSource(root), possiblePrefixes, allowUnprefixedExpressions));
48 }
49 }