org.apache.tools.ant.types
public class: RegularExpression [javadoc |
source]
java.lang.Object
org.apache.tools.ant.ProjectComponent
org.apache.tools.ant.types.DataType
org.apache.tools.ant.types.RegularExpression
All Implemented Interfaces:
Cloneable
A regular expression datatype. Keeps an instance of the
compiled expression for speed purposes. This compiled
expression is lazily evaluated (it is compiled the first
time it is needed). The syntax is the dependent on which
regular expression type you are using. The system property
"ant.regexp.regexpimpl" will be the classname of the implementation
that will be used.
For jdk <= 1.3, there are two available implementations:
org.apache.tools.ant.util.regexp.JakartaOroRegexp (the default)
Based on the jakarta-oro package
org.apache.tools.ant.util.regexp.JakartaRegexpRegexp
Based on the jakarta-regexp package
For jdk >= 1.4 an additional implementation is available:
org.apache.tools.ant.util.regexp.Jdk14RegexpRegexp
Based on the jdk 1.4 built in regular expression package.
<regexp [ [id="id"] pattern="expression" | refid="id" ]
/>
| Field Summary |
|---|
| public static final String | DATA_TYPE_NAME | Name of this data type |
| Methods from org.apache.tools.ant.types.DataType: |
|---|
|
checkAttributesAllowed, checkChildrenAllowed, circularReference, clone, dieOnCircularReference, dieOnCircularReference, dieOnCircularReference, getCheckedRef, getCheckedRef, getCheckedRef, getCheckedRef, getDataTypeName, getRefid, invokeCircularReferenceCheck, isChecked, isReference, noChildrenAllowed, setChecked, setRefid, toString, tooManyAttributes |
| Method from org.apache.tools.ant.types.RegularExpression Detail: |
public String getPattern(Project p) {
init(p);
if (isReference()) {
return getRef(p).getPattern(p);
}
setPattern();
return regexp.getPattern();
}
Gets the pattern string for this RegularExpression in the
given project. |
public RegularExpression getRef(Project p) {
return (RegularExpression) getCheckedRef(p);
}
Get the RegularExpression this reference refers to in
the given project. Check for circular references too |
public Regexp getRegexp(Project p) {
init(p);
if (isReference()) {
return getRef(p).getRegexp(p);
}
setPattern();
return this.regexp;
}
provides a reference to the Regexp contained in this |
public void setPattern(String pattern) {
if (regexp == null) {
myPattern = pattern;
setPatternPending = true;
} else {
regexp.setPattern(pattern);
}
}
sets the regular expression pattern |