Package org.eclipse.sisu.space
Enum GlobberStrategy
- java.lang.Object
-
- java.lang.Enum<GlobberStrategy>
-
- org.eclipse.sisu.space.GlobberStrategy
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<GlobberStrategy>
enum GlobberStrategy extends java.lang.Enum<GlobberStrategy>
Enumerates various optimized filename globbing strategies.
-
-
Constructor Summary
Constructors Modifier Constructor Description private
GlobberStrategy()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description (package private) static java.lang.String
basename(java.lang.String filename)
Extracts the basename segment from the given filename.(package private) abstract java.lang.Object
compile(java.lang.String glob)
Compiles the given plain-text glob into an optimized pattern.(package private) abstract boolean
matches(java.lang.Object globPattern, java.lang.String filename)
Attempts to match the given compiled glob pattern against a filename.(package private) static GlobberStrategy
selectFor(java.lang.String glob)
Selects the optimal globber strategy for the given plain-text glob.static GlobberStrategy
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static GlobberStrategy[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
ANYTHING
public static final GlobberStrategy ANYTHING
-
SUFFIX
public static final GlobberStrategy SUFFIX
-
PREFIX
public static final GlobberStrategy PREFIX
-
EXACT
public static final GlobberStrategy EXACT
-
PATTERN
public static final GlobberStrategy PATTERN
-
-
Method Detail
-
values
public static GlobberStrategy[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (GlobberStrategy c : GlobberStrategy.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static GlobberStrategy valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
selectFor
static final GlobberStrategy selectFor(java.lang.String glob)
Selects the optimal globber strategy for the given plain-text glob.- Parameters:
glob
- The plain-text glob- Returns:
- Optimal globber strategy
-
compile
abstract java.lang.Object compile(java.lang.String glob)
Compiles the given plain-text glob into an optimized pattern.- Parameters:
glob
- The plain-text glob- Returns:
- Compiled glob pattern
-
matches
abstract boolean matches(java.lang.Object globPattern, java.lang.String filename)
Attempts to match the given compiled glob pattern against a filename.- Parameters:
globPattern
- The compiled glob patternfilename
- The candidate filename- Returns:
true
if the pattern matches; otherwisefalse
-
basename
static final java.lang.String basename(java.lang.String filename)
Extracts the basename segment from the given filename.- Parameters:
filename
- The filename- Returns:
- Basename segment
-
-