Exemplo n.º 1
0
 /**
  * Reference to a classpath to use when loading the files.
  *
  * @param Reference $r
  *
  * @throws BuildException
  */
 public function setClasspathRef(Reference $r)
 {
     if ($this->isReference()) {
         throw $this->tooManyAttributes();
     }
     $this->classpathId = $r->getRefId();
     $this->createClasspath()->setRefid($r);
 }
Exemplo n.º 2
0
 /**
  * Performs the check for circular references and returns the referenced object.
  *
  * @param $requiredClass
  * @param $dataTypeName
  *
  * @throws BuildException
  *
  * @return mixed
  */
 public function getCheckedRef($requiredClass, $dataTypeName)
 {
     if (!$this->checked) {
         // should be in stack
         $stk = array();
         $stk[] = $this;
         $this->dieOnCircularReference($stk, $this->getProject());
     }
     $o = $this->ref->getReferencedObject($this->getProject());
     if (!$o instanceof $requiredClass) {
         throw new BuildException($this->ref->getRefId() . " doesn't denote a " . $dataTypeName);
     } else {
         return $o;
     }
 }
Exemplo n.º 3
0
 /**
  * Reference to a classpath to use when loading the files.
  */
 public function setClasspathRef(Reference $r)
 {
     $this->classpathId = $r->getRefId();
     $this->createClasspath()->setRefid($r);
 }
Exemplo n.º 4
0
 /**
  * @param Reference $r
  * @throws BuildException
  */
 public function setRefid(Reference $r)
 {
     if (count($this->parameters) !== 0 || $this->className !== null) {
         throw $this->tooManyAttributes();
     }
     $o = $r->getReferencedObject($this->getProject());
     if ($o instanceof PhingFilterReader) {
         $this->setClassName($o->getClassName());
         $this->setClasspath($o->getClassPath());
         foreach ($o->getParams() as $p) {
             $this->addParam($p);
         }
     } else {
         $msg = $r->getRefId() . " doesn\\'t refer to a PhingFilterReader";
         throw new BuildException($msg);
     }
     parent::setRefid($r);
 }
Exemplo n.º 5
0
 function setRefid(Reference $r)
 {
     if (count($this->filterReaders) !== 0) {
         throw $this->tooManyAttributes();
     }
     // change this to get the objects from the other reference
     $o = $r->getReferencedObject($this->getProject());
     if ($o instanceof FilterChain) {
         $this->filterReaders = $o->getFilterReaders();
     } else {
         throw new BuildException($r->getRefId() . " doesn't refer to a FilterChain");
     }
     parent::setRefid($r);
 }