Class Matches
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.taskdefs.condition.Matches
Simple regular expression condition.
- Since:
- Ant 1.7
-
Field Summary
Fields inherited from class ProjectComponent
description, location, project -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddRegexp(RegularExpression regularExpression) A regular expression.booleaneval()Is this condition true?voidsetCasesensitive(boolean b) Whether to ignore case or not.voidsetMultiline(boolean b) Whether to match should be multiline.voidsetPattern(String pattern) Set the regular expression to match againstvoidsetSingleLine(boolean b) Whether to treat input as singleline ('.' matches newline).voidSet the stringMethods inherited from class ProjectComponent
clone, getDescription, getLocation, getProject, log, log, setDescription, setLocation, setProjectModifier and TypeMethodDescriptionclone()Returns the description of the current action.Returns the file/location where this task was defined.Returns the project to which this component belongs.voidLogs a message with the default (INFO) priority.voidLogs a message with the given priority.voidsetDescription(String desc) Sets a description of the current action.voidsetLocation(Location location) Sets the file/location where this task was defined.voidsetProject(Project project) Sets the project object of this component.
-
Constructor Details
-
Matches
public Matches()
-
-
Method Details
-
setString
-
setPattern
Set the regular expression to match against- Parameters:
pattern- the regular expression pattern
-
addRegexp
A regular expression. You can use this element to refer to a previously defined regular expression datatype instance- Parameters:
regularExpression- the regular expression object to be configured as an element
-
setCasesensitive
public void setCasesensitive(boolean b) Whether to ignore case or not.- Parameters:
b- if false, ignore case.- Since:
- Ant 1.7
-
setMultiline
public void setMultiline(boolean b) Whether to match should be multiline.- Parameters:
b- the value to set.
-
setSingleLine
public void setSingleLine(boolean b) Whether to treat input as singleline ('.' matches newline). Corresponds to java.util.regex.Pattern.DOTALL.- Parameters:
b- the value to set.
-
eval
Description copied from interface:ConditionIs this condition true?- Specified by:
evalin interfaceCondition- Returns:
- true if the string matches the regular expression pattern
- Throws:
BuildException- if the attributes are not set correctly
-