Selector that filters files based on their size.
It provides support for gathering the parameters together as well as for assigning an error message and throwing a build exception if an error is detected.
author |
Hans Lellelid hans@xmpl.org (Phing) |
---|---|
author |
Bruce Atherton bruce@callenish.com (Ant) |
package |
phing.types.selectors |
toString()
setValue($size)
This will be further modified by the multiplier to get an actual size limit.
setUnits(mixed $units) : void
<
p> To get around this complexity, a number of standards bodies have proposed the 2^10 standard, and at least one has adopted it. But we are still left with a populace that isn't clear on how capitalization should work.
<
p> We therefore ignore capitalization as much as possible. Completely mixed case is not possible, but all upper and lower forms are accepted for all long and short forms. Since we have no need to work with the 0.001 case, this practice works here.
<
p> This function translates all the long and short forms that a unit prefix can occur in and translates them into a single multiplier.
mixed
The units to compare the size to.
setWhen($cmp)
setParameters($parameters)
verifySettings()
isSelected(\PhingFile $basedir, $filename, \PhingFile $file) : \whether
\whether
the file should be selected or not
getParameters() : \the
\the
set of parameters defined for this selector
setError($msg)
getError() : \the
\the
error condition
validate()
setDescription($desc)
getDescription()
isReference()
setRefid(\Reference $r) : void
Subclasses may need to check whether any other attributes have been set as well or child elements have been created and thus override this method. if they do they must call parent::setRefid()
dieOnCircularReference($stk, \Project $p)
If one is included, throw a BuildException created by circularReference
This implementation is appropriate only for a DataType that cannot hold other DataTypes as children.
The general contract of this method is that it shouldn't do anything if checked is true and set it to true on exit.
getCheckedRef($requiredClass, $dataTypeName)
tooManyAttributes()
noChildrenAllowed()
circularReference()
parsingComplete() : void
setProject(\Project $project)
getProject() : \Project
log(string $msg, integer $level = \Project::MSG_INFO)
string
The message to be logged.
integer
The message's priority at this message should have
SIZE_KEY
UNITS_KEY
WHEN_KEY
size :
multiplier :
sizelimit :
cmp :
sizeComparisons :
byteUnits :
parameters :
errmsg :
description :
ref :
checked : boolean
Subclasses are responsible for setting this value to false if we'd need to investigate this condition (usually because a child element has been added that is a subclass of DataType).
var |
---|
boolean
project : \Project