Top Description Fields Constructors Methods
org.apache.tools.ant.util.regexp

public Class Jdk14RegexpMatcher

extends Object
implements RegexpMatcher
Class Inheritance
All Implemented Interfaces
org.apache.tools.ant.util.regexp.RegexpMatcher
Known Direct Subclasses
org.apache.tools.ant.util.regexp.Jdk14RegexpRegexp
Imports
java.util.Vector, java.util.regex.Matcher, .Pattern, .PatternSyntaxException, org.apache.tools.ant.BuildException

Implementation of RegexpMatcher for the built-in regexp matcher of JDK 1.4. UNIX_LINES option is enabled as a default.

Field Summary

Modifier and TypeField and Description
private String

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected Pattern

Returns:

the compiled pattern
getCompiledPattern
(int
the options
options
)

Get a compiled representation of the regexp pattern

protected int

Returns:

the specific options
getCompilerOptions
(int
the generic options
options
)

Convert the generic options to the regex compiler specific options.

public Vector<String>

Returns:

the vector of groups
getGroups
(String
the string to match against
argument
)

Implements org.apache.tools.ant.util.regexp.RegexpMatcher.getGroups.

Returns a Vector of matched groups found in the argument using default options.
public Vector<String>

Returns:

the vector of groups
getGroups
(String
the string to match against
input
,
int
the regex options to use
options
)

Implements org.apache.tools.ant.util.regexp.RegexpMatcher.getGroups.

Returns a Vector of matched groups found in the argument.
public String

Returns:

the pattern
getPattern
()

Implements org.apache.tools.ant.util.regexp.RegexpMatcher.getPattern.

Get a String representation of the regexp pattern
public boolean

Returns:

true if the pattern matches
matches
(String
the string to match against
argument
)

Implements org.apache.tools.ant.util.regexp.RegexpMatcher.matches.

Does the given argument match the pattern using default options?
public boolean

Returns:

true if the pattern matches
matches
(String
the string to match against
input
,
int
the regex options to use
options
)

Implements org.apache.tools.ant.util.regexp.RegexpMatcher.matches.

Does the given argument match the pattern?
public void
setPattern(String
the pattern to match
pattern
)

Implements org.apache.tools.ant.util.regexp.RegexpMatcher.setPattern.

Set the regexp pattern from the String description.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

patternback to summary
private String pattern

Constructor Detail

Jdk14RegexpMatcherback to summary
public Jdk14RegexpMatcher()

Method Detail

getCompiledPatternback to summary
protected Pattern getCompiledPattern(int options) throws BuildException

Get a compiled representation of the regexp pattern

Parameters
options:int

the options

Returns:Pattern

the compiled pattern

Exceptions
BuildException:
on error
getCompilerOptionsback to summary
protected int getCompilerOptions(int options)

Convert the generic options to the regex compiler specific options.

Parameters
options:int

the generic options

Returns:int

the specific options

getGroupsback to summary
public Vector<String> getGroups(String argument) throws BuildException

Implements org.apache.tools.ant.util.regexp.RegexpMatcher.getGroups.

Returns a Vector of matched groups found in the argument using default options.

Group 0 will be the full match, the rest are the parenthesized subexpressions

.
Parameters
argument:String

the string to match against

Returns:Vector<String>

the vector of groups

Annotations
@Override
Exceptions
BuildException:
on error
getGroupsback to summary
public Vector<String> getGroups(String input, int options) throws BuildException

Implements org.apache.tools.ant.util.regexp.RegexpMatcher.getGroups.

Returns a Vector of matched groups found in the argument.

Group 0 will be the full match, the rest are the parenthesized subexpressions

.
Parameters
input:String

the string to match against

options:int

the regex options to use

Returns:Vector<String>

the vector of groups

Annotations
@Override
Exceptions
BuildException:
on error
getPatternback to summary
public String getPattern()

Implements org.apache.tools.ant.util.regexp.RegexpMatcher.getPattern.

Get a String representation of the regexp pattern

Returns:String

the pattern

Annotations
@Override
Exceptions
BuildException:
on error
matchesback to summary
public boolean matches(String argument) throws BuildException

Implements org.apache.tools.ant.util.regexp.RegexpMatcher.matches.

Does the given argument match the pattern using default options?

Parameters
argument:String

the string to match against

Returns:boolean

true if the pattern matches

Annotations
@Override
Exceptions
BuildException:
on error
matchesback to summary
public boolean matches(String input, int options) throws BuildException

Implements org.apache.tools.ant.util.regexp.RegexpMatcher.matches.

Does the given argument match the pattern?

Parameters
input:String

the string to match against

options:int

the regex options to use

Returns:boolean

true if the pattern matches

Annotations
@Override
Exceptions
BuildException:
on error
setPatternback to summary
public void setPattern(String pattern)

Implements org.apache.tools.ant.util.regexp.RegexpMatcher.setPattern.

Set the regexp pattern from the String description.

Parameters
pattern:String

the pattern to match

Annotations
@Override