01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: *
17: */
18: package org.apache.ivy.plugins.matcher;
19:
20: /**
21: * An interface that defines a string matcher.
22: */
23: public interface Matcher {
24:
25: /**
26: * Check whether a given string is matched by this matcher.
27: *
28: * @param input
29: * the string to be matched. Cannot be null.
30: * @return true if the input string is matched, false otherwise.
31: */
32: public boolean matches(/* @NotNull */String input);
33:
34: /**
35: * Return if the matcher will match *only* if the expression equals the input. <i> WARN: This is
36: * used only as a performance trick, to avoid scanning for things when you already know exactly
37: * what you want. In the install task where it used it avoid scanning the repository to list all
38: * modules to find that only one matches, and that it has the name requested. </i>
39: *
40: * @return true if the matcher only matches when the expression is equals to the input, false
41: * otherwise.
42: */
43: public boolean isExact();
44: }
|