FileDocCategorySizeDatePackage
Contains.javaAPI DocApache Ant 1.702294Wed Dec 13 06:16:22 GMT 2006org.apache.tools.ant.taskdefs.condition

Contains

public class Contains extends Object implements Condition
Is one string part of another string?
since
Ant 1.5

Fields Summary
private String
string
private String
subString
private boolean
caseSensitive
Constructors Summary
Methods Summary
public booleaneval()

since
Ant 1.5
return
true if the substring is within the string
exception
BuildException if the attributes are not set correctly

        if (string == null || subString == null) {
            throw new BuildException("both string and substring are required "
                                     + "in contains");
        }

        return caseSensitive
            ? string.indexOf(subString) > -1
            : string.toLowerCase().indexOf(subString.toLowerCase()) > -1;
    
public voidsetCasesensitive(boolean b)
Whether to search ignoring case or not.

param
b if false, ignore case
since
Ant 1.5

        caseSensitive = b;
    
public voidsetString(java.lang.String string)
The string to search in.

param
string the string to search in
since
Ant 1.5


                        
        
        this.string = string;
    
public voidsetSubstring(java.lang.String subString)
The string to search for.

param
subString the string to search for
since
Ant 1.5

        this.subString = subString;