This selector is here just to shake up your thinking a bit. Don't get too caught up in boolean, there are other ways you can evaluate a collection of selectors. This one takes a vote of the selectors it contains, and majority wins. You could also have an "all-but-one" selector, a "weighted-average" selector, and so on. These are left as exercises for the reader (as are the usecases where this would be necessary).
This class handles the common description attribute and provides a default implementation for reference handling and checking for circular references that is appropriate for types that can not be nested inside elements of the same type (i.e. patternset but not path)
author |
Hans Lellelid hans@xmpl.org (Phing) |
---|---|
author |
Bruce Atherton bruce@callenish.com (Ant) |
package |
phing.types.selectors |
circularReference() : \BuildException
createAnd()
createContains()
createContainsRegexp()
createCustom()
createDate()
createDepend()
createDepth()
createFilename()
createMajority()
createNone()
createNot()
createOr()
createPresent()
createSelector()
createSize()
createType()
dieOnCircularReference( &$stk, \Project $p) : void
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.
throws |
---|
\Project
getCheckedRef( $requiredClass, $dataTypeName) : mixed
throws |
---|
mixed
getDescription()
retujrn |
string |
---|---|
getError() : string
string
the error condition
getProject() : \Project
getSelectors(\Project $p) : array
hasSelectors() : boolean
boolean
whether any selectors are in this container
isReference() : boolean
boolean
isSelected(\PhingFile $basedir, string $filename, \PhingFile $file) : \whether
string
is the name of the file to check
\whether
the file should be selected or not
log(string $msg, integer $level = \Project::MSG_INFO) : void
string
The message to be logged.
integer
The message's priority at this message should have
noChildrenAllowed() : \BuildException
parsingComplete() : void
{@inheritdoc}
selectorCount() : integer
integer
the number of selectors in this container
selectorElements() : \an
\an
enumerator that goes through each of the selectors
setAllowtie( $tiebreaker)
setDescription(string $desc) : void
string
setError(string $msg) : void
string
The error message any BuildException should throw.
setProject(\Project $project) : void
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()
\Reference
tooManyAttributes() : \BuildException
toString() : string
string
comma separated list of Selectors contained in this one
validate()
throws | |
---|---|
verifySettings()
allowtie :
selectorsList :
errmsg : string
var |
---|
string
description : string
var |
---|
string
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