Set the node compiler for a given node class name.

@param string                       $className node class name
@param NodeCompilerInterface|string $handler   handler

@return $this
487291
public function setNodeCompiler($className, $handler)
    {
        if (!is_subclass_of($handler, NodeCompilerInterface::class)) {
            throw new \InvalidArgumentException(
                'Passed node compiler needs to implement '.
                NodeCompilerInterface::class.'. '.
                (is_object($handler) ? get_class($handler) : $handler).
                ' given.'
            );
        }

        $this->nodeCompilers[$className] = $handler;

        return $this;
    }
1300683
protected function getClassNodeTransfer(ClassNode $node): ClassNodeTransfer
    {
        $className = $node->getName();
        $classNamespace = $node->getNamespaceName();
        $classFilePath = $node->getFileName();
        $classModuleName = $this->getFacade()->getModuleName($node);

        $pathTransfer = $this->getFacade()->getPath($classFilePath);
        $reflectionNodeClass = $this->getFacade()->getReflectionClassByNode($node);

        $classNodeTransfer = new ClassNodeTransfer();

        $classNodeTransfer->setClassName($className);
        $classNodeTransfer->setClassNamespace($classNamespace);
        $classNodeTransfer->setClassFilePath($classFilePath);
        $classNodeTransfer->setClassModuleName($classModuleName);
        $classNodeTransfer->setNode($node);
        $classNodeTransfer->setReflectionClass($reflectionNodeClass);
        $classNodeTransfer->setPathTransfer($pathTransfer);

        return $classNodeTransfer;
    }
294494
public Class<? extends Supplier<RoutingHandler>> compileClass()
    {
        try {
            this.generateRoutes();

            log.debug("\n\nGenerated Class Source:\n\n" + this.sourceString);

            return CompilerUtils.CACHED_COMPILER.loadFromJava(packageName + "." + className, this.sourceString);

        } catch (Exception e) {
            log.error(e.getMessage(), e);
            return null;
        }
    }
408879
public function setClass($className)
    {
        $this->attributes->removeAttributeClass($this->iconPrefixClass . '-*');
        $this->attributes->addAttributeClass($this->iconPrefixClass . '-' . $className);

        return $this;
    }
85470
private function fromDotNotation($handler)
    {
        $parts = explode(self::CHAR_DOT, $handler);
        if (count($parts) != 2) {
            throw new \InvalidArgumentException('Invalid Class Method format from "dot" notation.');
        }
        $this->class = $parts[0];
        $this->method = $parts[1];
    }
193471
public function addNode(string $className): void
    {
        if (isset($this->nodes[$className])) {
            return;
        }

        $this->nodes[$className] = new DocumentGraphNode($className);
    }
436270
public function buildNodeEntityMetadata(\SimpleXMLElement $node, $className)
    {
        $reflection = new \ReflectionClass($className);

        return new NodeEntityMetadata(
            $className,
            $reflection,
            $this->buildNodeMetadata($node, $className),
            $this->idXmlMetadataFactory->buildEntityIdMetadata($node, $className, $reflection),
            $this->propertyXmlMetadataFactory->buildPropertiesMetadata($node, $className, $reflection),
            $this->relationshipXmlMetadataFactory->buildRelationshipsMetadata($node, $className, $reflection)
        );
    }
28876
private function fromClassMethodArray($handler)
    {
        if (count($handler) != 2) {
            throw new \InvalidArgumentException('Class method array constructor can only contain 2 elements.');
        }
        $this->class = $handler[0];
        $this->method = $handler[1];
    }
579467
private function compileContextNode(Compiler $compiler): void
    {
        $contextNode = null;
        if ($this->hasNode('context')) {
            $contextNode = $this->getNode('context');
        }

        if ($contextNode instanceof Node) {
            $compiler
                ->write('$ngbmContext = ')
                    ->subcompile($this->getNode('context'))
                ->write(';' . PHP_EOL);

            return;
        }

        $compiler->write('$ngbmContext = ' . ViewInterface::class . '::CONTEXT_DEFAULT;' . PHP_EOL);
    }
1257868
public function setFormClassName($className) {
        if ($this->configured) throw new IllegalStateException('Configuration is frozen');
        $name = $this->name ? ' name="'.$this->name.'"':'';
        $path = $this->path ? ' path="'.$this->path.'"':'';

        if (!is_subclass_of($className, ACTION_FORM_BASE_CLASS)) throw new StrutsConfigException('<mapping'.$name.$path.' form="'.$className.'": Not a subclass of '.ACTION_FORM_BASE_CLASS.'.');

        $this->formClassName = $className;
        return $this;
    }
486412
protected function register_handler(moodle1_handler $handler, array $elements) {

        // first iteration, push them to new array, indexed by name
        // to detect duplicates in names or paths
        $names = array();
        $paths = array();
        foreach($elements as $element) {
            if (!$element instanceof convert_path) {
                throw new convert_exception('path_element_wrong_class', get_class($element));
            }
            if (array_key_exists($element->get_name(), $names)) {
                throw new convert_exception('path_element_name_alreadyexists', $element->get_name());
            }
            if (array_key_exists($element->get_path(), $paths)) {
                throw new convert_exception('path_element_path_alreadyexists', $element->get_path());
            }
            $names[$element->get_name()] = true;
            $paths[$element->get_path()] = $element;
        }

        // now, for each element not having a processing object yet, assign the handler
        // if the element is not a memeber of a group
        foreach($paths as $key => $element) {
            if (is_null($element->get_processing_object()) and !$this->grouped_parent_exists($element, $paths)) {
                $paths[$key]->set_processing_object($handler);
            }
            // add the element path to the processor
            $this->xmlprocessor->add_path($element->get_path(), $element->is_grouped());
        }

        // done, store the paths (duplicates by path are discarded)
        $this->pathelements = array_merge($this->pathelements, $paths);

        // remove the injected plugin name element from the MOD and BLOCK paths
        // and register such collapsed path, too
        foreach ($elements as $element) {
            $path = $element->get_path();
            $path = preg_replace('/^\/MOODLE_BACKUP\/COURSE\/MODULES\/MOD\/(\w+)\//', '/MOODLE_BACKUP/COURSE/MODULES/MOD/', $path);
            $path = preg_replace('/^\/MOODLE_BACKUP\/COURSE\/BLOCKS\/BLOCK\/(\w+)\//', '/MOODLE_BACKUP/COURSE/BLOCKS/BLOCK/', $path);
            if (!empty($path) and $path != $element->get_path()) {
                $this->xmlprocessor->add_path($path, false);
            }
        }
    }
892928
protected function getNodeValueAsObject($xquery, $className)
    {
      $nodeList = $this->document->getXPath()->query($xquery, $this->node);

      if($nodeList->length == 0)
        throw new Exception(__METHOD__ . '; ' . $xquery . ' node is missing');

      return new $className(utf8_decode($nodeList->item(0)->nodeValue));
    }
225158
protected function setRequestProcessorClass($className) {
        if ($this->configured)                                            throw new IllegalStateException('Configuration is frozen');
        if (!is_subclass_of($className, DEFAULT_REQUEST_PROCESSOR_CLASS)) throw new StrutsConfigException('Not a subclass of '.DEFAULT_REQUEST_PROCESSOR_CLASS.': '.$className);
        $this->requestProcessorClass = $className;
    }
1025785
public function setHandler($handler = null)
    {
        $this->handler = null !== $handler ? (string)$handler: $handler;

        return $this;
    }
581820
public function addFormHandler($formName, $handler) {
			if (!is_callable($handler))
				throw new \Exception('$handler must be a callable, ' .
					(is_object($handler) ? get_class($handler) : gettype($handler)) . 'given');

			$this->formHandlers[$formName] = $handler;

			return $this;
		}
507561
public function setClassName($class_name)
    {
        if ($class_name === null) {
            throw new ENabuCoreException(
                    ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
                    array("\$class_name")
            );
        }

        $implements_list = class_implements($class_name, true);

        if (is_array($implements_list) &&
            array_search('nabu\http\interfaces\INabuHTTPResponseRender', $implements_list)
        ) {
            $this->setValue("nb_http_render_descriptor_class_name", $class_name);
        } else {
            throw new ENabuCoreException(ENabuCoreException::ERROR_INVALID_RENDER_DESCRIPTOR_CLASS);
        }

        return $this;
    }
498820
public function setClassName($className)
    {
        Assert::stringNotEmpty($className, 'The class name must be a non-empty string. Got: %s');

        $pos = strrpos($className, '\\');

        if (false === $pos) {
            $this->namespaceName = '';
            $this->shortClassName = $className;
        } else {
            $this->namespaceName = substr($className, 0, $pos);
            $this->shortClassName = substr($className, $pos + 1);
        }

        return $this;
    }