UnknownElement.php
Wrapper class that holds all information necessary to create a task that did not exist when Phing started.
This has something to do with phing encountering an task XML element it is not aware of at start time. This is a situation where special steps need to be taken so that the element is then known.
- Author
- Andreas Aderhold
- Author
- Hans Lellelid
- Package
- phing
- Version
- $Id$
\UnknownElement
Wrapper class that holds all information necessary to create a task that did not exist when Phing started.
This has something to do with phing encountering an task XML element it is not aware of at start time. This is a situation where special steps need to be taken so that the element is then known.
- Parent(s)
- \Task < \ProjectComponent
- Author
- Andreas Aderhold
- Author
- Hans Lellelid
- Copyright
- 2001,2002 THYRELL. All rights reserved
- Version
- $Id$
Properties


\Project
$project= 'null'
Holds a reference to the project that a project component (a task, a target, etc.) belongs to
A reference to the current project instanceInherited from: \ProjectComponent::$$project\Task::$$projectnull
Details- Type
- \Project
- Inherited_from
- \ProjectComponent::$$project
- Inherited_from
- \Task::$$project
Methods


__construct(
string $elementName
)
:
void
Constructs a UnknownElement object
Name | Type | Description |
---|---|---|
$elementName | string | The XML element name that is unknown |
- Access
- public


addChild(
object $child
)
:
void
Add a child element to the unknown element
Name | Type | Description |
---|---|---|
$child | object | The object representing the child element |


getLocation(
)
:
\Location
Returns the location within the buildfile this task occurs. Used by {@link BuildException} to give detailed error messages.
Inherited from: \Task::getLocation()Type | Description |
---|---|
\Location | The location object describing the position of this task within the buildfile. |


getProject(
)
:
\Project
Returns a reference to current project
Inherited from: \ProjectComponent::getProject()\Task::getProject()Type | Description |
---|---|
\Project | Reference to current porject object |


getRuntimeConfigurableWrapper(
)
:
\RuntimeConfigurable
Returns the wrapper object for runtime configuration
Inherited from: \Task::getRuntimeConfigurableWrapper()Type | Description |
---|---|
\RuntimeConfigurable | The wrapper object used by this task |


getTag(
)
:
string
Return the XML element name that this UnnownElement
handles.
Type | Description |
---|---|
string | The XML element name that is unknown |


getTaskName(
)
:
string
Get the name of the task to use in logging messages.
@return string The task's name
Type | Description |
---|---|
string | Name of this task |


getTaskType(
)
:
string
Returns the name of the task under which it was invoked, usually the XML tagname
Inherited from: \Task::getTaskType()Type | Description |
---|---|
string | The type of this task (XML Tag) |


handleChildren(
object $parent, $parentWrapper
)
:
void
Handle child elemets of the unknown element, if any.
@param ProjectComponent The parent object the unkown element belongs to
Name | Type | Description |
---|---|---|
$parent | object | The parent wrapper object |
$parentWrapper |


init(
)
:
void
Should throw a BuildException if something goes wrong with the build
This is abstract here, but may not be overloaded by subclasses.
Exception | Description |
---|---|
\BuildException |


log(
string $msg, integer $level
=
Project::MSG_INFO
)
:
void
Name | Type | Description |
---|---|---|
$msg | string | The message to log |
$level | integer | The priority of the message |
- See
- \BuildEvent
- See
- \BuildListener


main(
)
:
void
Called when the real task has been configured for the first time.
Should throw a BuildException if someting goes wrong with the build
This is abstract here. Must be overloaded by real tasks.
Exception | Description |
---|---|
\BuildException | if the task can not be created |


makeObject(
\UnknownElement $ue, \RuntimeConfigurable $w
)
:
object
Creates a named task or data type. If the real object is a task, it is configured up to the init() stage.
Name | Type | Description |
---|---|---|
$ue | \UnknownElement | The unknown element to create the real object for. Must not be |
$w | \RuntimeConfigurable | Ignored in this implementation. |
Type | Description |
---|---|
object | The Task or DataType represented by the given unknown element. |


makeTask(
\UnknownElement $ue, \RuntimeConfigurable $w, boolean $onTopLevel
=
false
)
:
\Task
Create a named task and configure it up to the init() stage.
Name | Type | Description |
---|---|---|
$ue | \UnknownElement | The unknwon element to create a task from |
$w | \RuntimeConfigurable | The wrapper object |
$onTopLevel | boolean | Whether to treat this task as if it is top-level. |
Type | Description |
---|---|
\Task | The freshly created task |


maybeConfigure(
)
:
void
Tries to configure the unknown element
Exception | Description |
---|---|
\BuildException | if the element can not be configured |


setDescription(
string $desc
)
:
void
Name | Type | Description |
---|---|---|
$desc | string | The text describing the task |


setLocation(
\Location $location
)
:
void
Sets the location within the buildfile this task occurs. Called by the parser to set location information.
Inherited from: \Task::setLocation()Name | Type | Description |
---|---|---|
$location | \Location | The location object describing the position of this task within the buildfile. |


setOwningTarget(
\Target $target
)
:
void
Name | Type | Description |
---|---|---|
$target | \Target | Reference to owning target |


setProject(
\Project $project
)
:
void
References the project to the current component.
Inherited from: \ProjectComponent::setProject()\Task::setProject()Name | Type | Description |
---|---|---|
$project | \Project | The reference to the current project |


setRuntimeConfigurableWrapper(
\RuntimeConfigurable $wrapper
)
:
void
Sets the wrapper object this task should use for runtime configurable elements.
Inherited from: \Task::setRuntimeConfigurableWrapper()Name | Type | Description |
---|---|---|
$wrapper | \RuntimeConfigurable | The wrapper object this task should use |


setTaskName(
string $name
)
:
string
Name | Type | Description |
---|---|---|
$name | string |
Type | Description |
---|---|
string | A string representing the name of this task for log |


setTaskType(
string $name
)
:
void
Sets the type of the task. Usually this is the name of the XML tag
Inherited from: \Task::setTaskType()Name | Type | Description |
---|---|---|
$name | string | The type of this task (XML Tag) |