phing-types-selectors
[ class tree: phing-types-selectors ] [ index: phing-types-selectors ] [ all elements ]

Class: BaseSelector

Source Location: /types/selectors/BaseSelector.php

Class Overview

ProjectComponent
   |
   --DataType
      |
      --BaseSelector

A convenience base class that you can subclass Selectors from. It provides some helpful common behaviour. Note that there is no need for Selectors to inherit from this class, it is only necessary that they implement FileSelector.


Author(s):

Version:

  • $Revision: 526 $

Implements interfaces:

Methods


Child classes:

PresentSelector
Selector that filters files based on whether they appear in another directory tree. It can contain a mapper element, so isn't available as an ExtendSelector (since those parameters can't hold other elements).
BaseExtendSelector
Convenience base class for all selectors accessed through ExtendSelector.
DependSelector
Selector that filters files based on whether they are newer than a matching file in another directory tree. It can contain a mapper element, so isn't available as an ExtendSelector (since those parameters can't hold other elements).
BaseSelectorContainer
This is the base class for selectors that can contain other selectors.
ExtendSelector
Selector that selects files by forwarding the request on to other classes.

Inherited Variables

Inherited Methods

Class: DataType

DataType::circularReference()
Creates an exception that indicates the user has generated a loop of data types referencing each other.
DataType::dieOnCircularReference()
Check to see whether any DataType we hold references to is included in the Stack (which holds all DataType instances that directly or indirectly reference this instance, including this instance itself).
DataType::getCheckedRef()
Performs the check for circular references and returns the referenced object.
DataType::getDescription()
Return the description for the current data type.
DataType::isReference()
Has the refid attribute of this element been set?
DataType::noChildrenAllowed()
Creates an exception that indicates that this XML element must not have child elements if the refid attribute is set.
DataType::parsingComplete()
Template method being called when the data type has been parsed completely.
DataType::setDescription()
Sets a description of the current data type. It will be useful in commenting what we are doing.
DataType::setRefid()
Set the value of the refid attribute.
DataType::tooManyAttributes()
Creates an exception that indicates that refid has to be the only attribute if it is set.

Class: ProjectComponent

ProjectComponent::getProject()
Returns a reference to current project
ProjectComponent::log()
Logs a message with the given priority.
ProjectComponent::setProject()
References the project to the current component.

Class Details

[line 33]
A convenience base class that you can subclass Selectors from. It provides some helpful common behaviour. Note that there is no need for Selectors to inherit from this class, it is only necessary that they implement FileSelector.



Tags:

author:  <href="mailto:bruce@callenish.com" a href="mailto:bruce@callenish.com">Bruce Atherton</a>
version:  $Revision: 526 $
abstract:  


[ Top ]


Class Methods


method getError [line 54]

the getError( )

Returns any error messages that have been set.



Tags:

return:  error condition
access:  public


[ Top ]

method setError [line 43]

void setError( msg $msg)

Allows all selectors to indicate a setup error. Note that only the first error message is recorded.



Tags:

access:  public


Parameters:

msg   $msg   The error message any BuildException should throw.

[ Top ]

method validate [line 73]

void validate( )

Subclasses can use this to throw the requisite exception in isSelected() in the case of an error condition.



Tags:

access:  public


Overridden in child classes as:

BaseSelectorContainer::validate()
<p>This implementation validates the container by calling verifySettings() and then validates each contained selector provided that the selector implements the validate interface.

[ Top ]

method verifySettings [line 66]

void verifySettings( )

<p>Subclasses can override this method to provide checking of their

state. So long as they call validate() from isSelected(), this will be called automatically (unless they override validate()).</p> <p>Implementations should check for incorrect settings and call setError() as necessary.</p>




Tags:

access:  public


Overridden in child classes as:

PresentSelector::verifySettings()
Checks to make sure all settings are kosher. In this case, it means that the targetdir attribute has been set and we have a mapper.
ContainsSelector::verifySettings()
Checks to make sure all settings are kosher. In this case, it means that the pattern attribute has been set.
DateSelector::verifySettings()
This is a consistency check to ensure the selector's required values have been set.
DepthSelector::verifySettings()
Checks to make sure all settings are kosher. In this case, it means that the max depth is not lower than the min depth.
TypeSelector::verifySettings()
Checks to make sure all settings are kosher. In this case, it means that the pattern attribute has been set.
FilenameSelector::verifySettings()
Checks to make sure all settings are kosher. In this case, it means that the name attribute has been set.
SizeSelector::verifySettings()
<p>Checks to make sure all settings are kosher. In this case, it
ContainsRegexpSelector::verifySettings()
Checks to make sure all settings are kosher. In this case, it means that the pattern attribute has been set.
DependSelector::verifySettings()
Checks to make sure all settings are kosher. In this case, it means that the dest attribute has been set and we have a mapper.
SelectSelector::verifySettings()
Makes sure that there is only one entry, sets an error message if not.
NotSelector::verifySettings()
Makes sure that there is only one entry, sets an error message if not.
ExtendSelector::verifySettings()
These are errors specific to ExtendSelector only. If there are errors in the custom selector, it should throw a BuildException when isSelected() is called.

[ Top ]


Documentation generated on Mon, 19 Oct 2009 10:50:24 +0200 by phpDocumentor 1.4.3