Changeset 115

Show
Ignore:
Timestamp:
11/11/07 15:24:40 (10 months ago)
Author:
mikey
Message:

ported to PHP 5.3.0-dev using namespaces
examples, integration tests and star build do not work at the moment

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/XJConf/DefinedTag.php

    r94 r115  
    66 * @author  Frank Kleine <frank.kleine@schlund.de> 
    77 */ 
    8 XJConfLoader::load('Tag', 
    9                    'definitions.TagDefinition' 
    10 ); 
     8namespace net::xjconf; 
     9use net::xjconf::Tag; 
     10use net::xjconf::definitions::ConcreteTagDefinition; 
     11use net::xjconf::definitions::TagDefinition; 
    1112/** 
    1213 * Contains data of tag in the default namespace. 
  • trunk/XJConf/DefinitionParser.php

    r98 r115  
    66 * @author  Frank Kleine <frank.kleine@schlund.de> 
    77 */ 
    8 XJConfLoader::load('definitions.AttributeDefinition', 
    9                    'definitions.CDataDefinition', 
    10                    'definitions.ChildDefinition', 
    11                    'definitions.ConstructorDefinition', 
    12                    'definitions.FactoryMethodDefinition', 
    13                    'definitions.MethodCallTagDefinition', 
    14                    'definitions.NamespaceDefinition', 
    15                    'definitions.NamespaceDefinitions', 
    16                    'definitions.TagDefinition', 
    17                    'definitions.handler.DefinitionHandlerFactory', 
    18                    'exceptions.InvalidNamespaceDefinitionException' 
    19 )
     8namespace net::xjconf; 
     9use net::xjconf::definitions::AttributeDefinition; 
     10use net::xjconf::definitions::CDataDefinition; 
     11use net::xjconf::definitions::ChildDefinition; 
     12use net::xjconf::definitions::ConstructorDefinition; 
     13use net::xjconf::definitions::FactoryMethodDefinition; 
     14use net::xjconf::definitions::MethodCallTagDefinition; 
     15use net::xjconf::definitions::NamespaceDefinition; 
     16use net::xjconf::definitions::NamespaceDefinitions; 
     17use net::xjconf::definitions::TagDefinition; 
     18use net::xjconf::definitions::handler.DefinitionHandlerFactory; 
     19use net::xjconf::exceptions::InvalidNamespaceDefinitionException
    2020/** 
    2121 * Parse tag definitions files. 
     
    9393        $this->currentNamespace = self::DEFAULT_NAMESPACE; 
    9494        $this->classLoaders     = $classLoaders; 
    95  
    96         if (!defined('XMLREADER_ELEMENT')) { 
    97             $this->nodeTypes = array('startTag' => XMLReader::ELEMENT, 
    98                                      'text'     => XMLReader::TEXT, 
    99                                      'endTag'   => XMLReader::END_ELEMENT 
    100                                ); 
    101         } else { 
    102             $this->nodeTypes = array('startTag' => XMLREADER_ELEMENT, 
    103                                      'text'     => XMLREADER_TEXT, 
    104                                      'endTag'   => XMLREADER_END_ELEMENT 
    105                                ); 
    106         } 
     95        $this->nodeTypes        = array('startTag' => XMLReader::ELEMENT, 
     96                                        'text'     => XMLReader::TEXT, 
     97                                        'endTag'   => XMLReader::END_ELEMENT 
     98                                  ); 
    10799    } 
    108100 
     
    173165    { 
    174166        if (null == $this->reader) { 
    175             $this->reader = new XMLReader(); 
     167            $this->reader = new ::XMLReader(); 
    176168        } 
    177169    } 
  • trunk/XJConf/GenericTag.php

    r94 r115  
    66 * @author Stephan Schmidt <me@schst.net> 
    77 */ 
    8 XJConfLoader::load('Tag')
     8namespace net::xjconf
    99/** 
    1010 * Generic Tag wrapper that can be used by extensions to dynamically add 
  • trunk/XJConf/Tag.php

    r94 r115  
    66 * @author  Frank Kleine <frank.kleine@schlund.de> 
    77 */ 
     8namespace net::xjconf; 
    89/** 
    910 * Interface for holding tag data. 
     
    124125        public function getSetterMethod(); 
    125126 
     127        /** 
     128         * returns the definition for this tag 
     129         * 
     130         * @return  Definition 
     131         */ 
    126132        public function getDefinition(); 
    127133 
  • trunk/XJConf/XJConfClassLoader.php

    r46 r115  
    55 * @author  Frank Kleine <mikey@xjconf.net> 
    66 */ 
     7namespace net::xjconf; 
    78/** 
    89 * Interface for class loaders that can be used to load classes at runtime. 
  • trunk/XJConf/XJConfFacade.php

    r102 r115  
    66 * @package     XJConf 
    77 */ 
    8 XJConfLoader::load('DefinitionParser', 
    9                    'XmlParser', 
    10                    'ext.Extension', 
    11                    'definitions.NamespaceDefinitions' 
    12 ); 
     8namespace net::xjconf; 
     9use net::xjconf::definitions::NamespaceDefinitions; 
     10use net::xjconf::ext::Extension; 
    1311/** 
    1412 * Facade for XJConf. 
     
    7977    public function enableXIncludes() 
    8078    { 
    81         XJConfLoader::load('ext.xinc.XInclude'); 
    82         $xincludeExtension = new XInclude(); 
     79        $xincludeExtension = new net::xjeconf::ext::xinc::XInclude(); 
    8380        $this->addExtension($xincludeExtension); 
    8481    } 
  • trunk/XJConf/XJConfLoader.php

    r101 r115  
    33 * Class loader for all XJConf classes. 
    44 * 
    5  * @author  Frank Kleine <frank.kleine@schlund.de> 
     5 * @author   Frank Kleine <frank.kleine@schlund.de> 
     6 * @package  XJConf 
    67 */ 
     8namespace net::xjconf; 
    79/** 
    810 * Class loader for all XJConf classes. 
     
    1719{ 
    1820    /** 
    19      * list of loaded files 
    20      * 
    21      * @var  array<String> 
    22      */ 
    23     private static $loadedClasses = array(); 
    24  
    25     /** 
    2621     * method to load files from source path 
    27      * 
    28      * Usage: XJConfLoader::load('path.to.Classfile'); 
    29      * or load more than one at once: 
    30      * XJConfLoader::load('path.to.first.Class', 
    31                           'path.to.second.Class' 
    32        ); 
    33      * You may name as many files as you like, there is no restriction 
    34      * on the number of arguments. 
    3522     * 
    3623     * @param   string  list of file names to load 
    3724     */ 
    38     public static function load(
     25    public static function load($className
    3926    { 
    40         $classes = func_get_args(); 
    41         if (count($classes) == 0) { 
    42             // its ok to call this without any arguments, this won't cause any harm 
     27        if (self::providesClass($className) === false) { 
    4328            return; 
    4429        } 
     30         
     31        if (substr(__FILE__, 0, 7) === 'star://') { 
     32            include str_replace('net::xjconf::XJConfLoader', '', __FILE__) . $className; 
     33        } 
    4534 
    46         $realFiles = array(); 
    47         foreach ($classes as $className) { 
    48             if (in_array(str_replace('net.xjconf.', '', $className), self::$loadedClasses) == TRUE) { 
    49                 continue; // step to next file if file is already loaded 
    50             } 
    51  
    52             $uri = null; 
    53             array_push(self::$loadedClasses, str_replace('net.xjconf.', '', $className)); 
    54             if (class_exists('StarClassRegistry', false) === true) { 
    55                 if (substr($className, 0, 11) != 'net.xjconf.') { 
    56                     $uri = StarClassRegistry::getUriForClass('net.xjconf.' . $className); 
    57                 } else { 
    58                     $uri = StarClassRegistry::getUriForClass($className); 
    59                 } 
    60             } 
    61             if ($uri === null) { 
    62                 $uri = dirname(__FILE__) . '/' . self::mapClassname($className); 
    63             } 
    64              
    65             require $uri; 
    66         } 
     35        include dirname(__FILE__) . '/' . self::mapClassname($className); 
    6736    } 
    6837 
     
    7342     * @return  bool 
    7443     */ 
    75     public static function classFileExists($className) 
     44    public static function providesClass($className) 
    7645    { 
    77         if (class_exists('StarClassRegistry') == false) { 
    78             return file_exists(dirname(__FILE__) . '/' . self::mapClassname($className)); 
    79         } 
    80  
    81         if (substr($className, 0, 11) != 'net.xjconf.') { 
    82             $fqClassName = 'net.xjconf.' . $className; 
    83         } else { 
    84             $fqClassName = $className; 
    85         } 
    86          
    87         if (StarClassRegistry::getFileForClass($fqClassName) != null) { 
    88             return true; 
    89         } 
    90         if (substr(dirname(__FILE__), 0, 7) == 'star://') { 
    91             return false; 
     46        if (substr(__FILE__, 0, 7) === 'star://') { 
     47            return file_exists(str_replace('net::xjconf::XJConfLoader', '', __FILE__) . $className); 
    9248        } 
    9349         
     
    10359    private static function mapClassname($classname) 
    10460    { 
    105         return str_replace('.', '/', $classname) . '.php'; 
     61        return str_replace('::', '/', str_replace('net::xjconf::', '', $classname)) . '.php'; 
    10662    } 
    10763} 
     64/** 
     65 * register with __autoload() 
     66 */ 
     67spl_autoload_register(array('net::xjconf::XJConfLoader', 'load')); 
    10868?> 
  • trunk/XJConf/XmlParser.php

    r99 r115  
    66 * @author  Frank Kleine <frank.kleine@schlund.de> 
    77 */ 
    8 XJConfLoader::load('DefinedTag', 
    9                    'GenericTag', 
    10                    'definitions.NamespaceDefinition', 
    11                    'definitions.NamespaceDefinitions', 
    12                    'exceptions.UnknownNamespaceException', 
    13                    'exceptions.UnknownTagException' 
    14 ); 
     8namespace net::xjconf; 
     9use net::xjconf::definitions::NamespaceDefinition; 
     10use net::xjconf::definitions::NamespaceDefinitions; 
     11use net::xjconf::exceptions::UnknownNamespaceException; 
     12use net::xjconf::exceptions::UnknownTagException; 
     13use net::xjconf::ext::Extension; 
    1514/** 
    1615 * Parser that reads xml files and generates the data structure. 
     
    8281    public function __construct() 
    8382    { 
    84         if (!defined('XMLREADER_ELEMENT')) { 
    85             $this->nodeTypes = array('startTag' => XMLReader::ELEMENT, 
    86                                      'text'     => XMLReader::TEXT, 
    87                                      'endTag'   => XMLReader::END_ELEMENT 
    88                                ); 
    89         } else { 
    90             $this->nodeTypes = array('startTag' => XMLREADER_ELEMENT, 
    91                                      'text'     => XMLREADER_TEXT, 
    92                                      'endTag'   => XMLREADER_END_ELEMENT 
    93                                ); 
    94         } 
     83        $this->nodeTypes = array('startTag' => XMLReader::ELEMENT, 
     84                                 'text'     => XMLReader::TEXT, 
     85                                 'endTag'   => XMLReader::END_ELEMENT 
     86                           ); 
    9587    } 
    9688 
     
    232224    private function initParser() 
    233225    { 
    234         $reader = new XMLReader(); 
     226        $reader = new ::XMLReader(); 
    235227        return $reader; 
    236228    } 
     
    242234     * onto the stack. 
    243235     * 
    244      * @param  string  $namespaceURI  namespace of start tag 
    245      * @param  string  $sName         name of start tag 
    246      * @param  array   $atts          attributes of tag 
     236     * @param   string  $namespaceURI  namespace of start tag 
     237     * @param   string  $sName         name of start tag 
     238     * @param   array   $atts          attributes of tag 
     239     * @throws  UnknownNamespaceException 
     240     * @throws  UnknownTagException 
    247241     */ 
    248242    private function startElement($namespaceURI, $sName, $atts) 
  • trunk/XJConf/converters/AbstractObjectValueConverter.php

    r110 r115  
    33 * Base class to convert a value to an object. 
    44 * 
    5  * @author  Stephan Schmidt <stephan.schmidt@schlund.de> 
    6  * @author  Frank Kleine <frank.kleine@schlund.de> 
     5 * @author      Stephan Schmidt <stephan.schmidt@schlund.de> 
     6 * @author      Frank Kleine <frank.kleine@schlund.de> 
     7 * @package     XJConf 
     8 * @subpackage  converters 
    79 */ 
    8 XJConfLoader::load('converters.ValueConverter', 
    9                    'exceptions.ValueConversionException' 
    10 ); 
     10namespace net::xjconf::converters; 
     11use net::xjconf::Tag; 
     12use net::xjconf::definitions::Definition; 
     13use net::xjconf::definitions::TagDefinition; 
     14use net::xjconf::definitions::ValueModifier; 
     15use net::xjconf::exceptions::ValueConversionException; 
    1116/** 
    1217 * Base class to convert a value to an object. 
     
    5055    protected function addAttributesToValue(Tag $tag, TagDefinition $def, $instance) 
    5156    { 
    52         $class = new ReflectionClass(get_class($instance)); 
     57        $class = new ::ReflectionClass(get_class($instance)); 
    5358        // set all attributes 
    5459        foreach ($def->getAttributes() as $att) { 
     
    8287                    $method->invokeArgs($instance, array($att->getName(), $val)); 
    8388                } 
    84             } catch (ReflectionException $re) { 
     89            } catch (::ReflectionException $re) { 
    8590                throw new ValueConversionException('Could not set attribute "' . $att->getName() . '" of "' . $this->getType() . '" using "' . $att->getSetterMethod($tag) . '()" or "__set()" or public property "' . $att->getName() . '", exception message: "' . $re->getMessage() . '".'); 
    8691            } 
     
    104109        } 
    105110 
    106         $class = new ReflectionClass(get_class($instance)); 
     111        $class = new ::ReflectionClass(get_class($instance)); 
    107112        foreach ($children as $child) { 
    108113 
     
    141146                    $method->invokeArgs($instance, array($child->getName(), $child->getConvertedValue())); 
    142147                } 
    143             } catch (ReflectionException $re) { 
     148            } catch (::ReflectionException $re) { 
    144149                throw new ValueConversionException('Could not add child "' . $child->getKey() . '" to "' . $this->getType() . '" using "' . $child->getSetterMethod() . '()" or "' . $child->getKey() . '" or "__set()" or public property "' . $child->getKey() . '", exception message: "' . $re->getMessage() . '".'); 
    145150            } 
     
    164169        $value = $cDataDefinition->convertValue($tag); 
    165170        try { 
    166             $class = new ReflectionClass(get_class($instance)); 
     171            $class = new ::ReflectionClass(get_class($instance)); 
    167172            $class->getMethod($cDataDefinition->getSetterMethod($tag))->invoke($instance, $value); 
    168         } catch (ReflectionException $re) { 
     173        } catch (::ReflectionException $re) { 
    169174            throw new ValueConversionException('Could not add cdata to "' . $this->getType() . '" using "' . $cDataDefinition->getSetterMethod($tag) . '()", exception message: "' . $re->getMessage() . '".'); 
    170175        } 
  • trunk/XJConf/converters/ArrayValueConverter.php

    r62 r115  
    33 * Converter to convert a value to an array. 
    44 * 
    5  * @author  Frank Kleine <frank.kleine@schlund.de> 
     5 * @author      Frank Kleine <frank.kleine@schlund.de> 
     6 * @package     XJConf 
     7 * @subpackage  converters 
    68 */ 
    7 XJConfLoader::load('converters.ValueConverter', 
    8                    'definitions.Definition', 
    9                    'definitions.TagDefinition' 
    10 )
     9namespace net::xjconf::converters; 
     10use net::xjconf::Tag; 
     11use net::xjconf::definitions::Definition; 
     12use net::xjconf::definitions::TagDefinition
    1113/** 
    1214 * Converter to convert a value to an array. 
  • trunk/XJConf/converters/AutoPrimitiveValueConverter.php

    r91 r115  
    44 * by trying to guess its type 
    55 * 
    6  * @package XJConf 
    7  * @author  Stephan Schmidt <schst@xjconf.net> 
     6 * @author      Stephan Schmidt <stephan.schmidt@schlund.de> 
     7 * @author      Frank Kleine <frank.kleine@schlund.de> 
     8 * @package     XJConf 
     9 * @subpackage  converters 
    810 */ 
    9 XJConfLoader::load('converters.ValueConverter', 
    10                    'exceptions.ValueConversionException' 
    11 )
     11namespace net::xjconf::converters; 
     12use net::xjconf::Tag; 
     13use net::xjconf::definitions::Definition
    1214/** 
    1315 * Converter to convert a value into a primitive 
    1416 * by trying to guess its type 
    1517 * 
    16  * @package XJConf 
     18 * @package     XJConf 
     19 * @subpackage  converters 
    1720 */ 
    1821class AutoPrimitiveValueConverter implements ValueConverter { 
     
    2326     * @param   array  $values  list of values to convert 
    2427     * @return  mixed  the converted value 
    25      * @throws  ValueConversionException 
    2628     */ 
    2729    public function convertValue(Tag $tag, Definition $def) { 
  • trunk/XJConf/converters/ConstructorValueConverter.php

    r100 r115  
    33 * Class to convert a value to an object using the constructor of the object. 
    44 * 
    5  * @author  Stephan Schmidt <stephan.schmidt@schlund.de> 
    6  * @author  Frank Kleine <frank.kleine@schlund.de> 
     5 * @author      Stephan Schmidt <stephan.schmidt@schlund.de> 
     6 * @author      Frank Kleine <frank.kleine@schlund.de> 
     7 * @package     XJConf 
     8 * @subpackage  converters 
    79 */ 
    8 XJConfLoader::load('converters.ValueConverter', 
    9                    'converters.AbstractObjectValueConverter', 
    10                    'exceptions.ValueConversionException' 
    11 ); 
     10namespace net::xjconf::converters; 
     11use net::xjconf::Tag; 
     12use net::xjconf::definitions::Definition; 
     13use net::xjconf::definitions::TagDefinition; 
     14use net::xjconf::exceptions::ValueConversionException; 
    1215/** 
    1316 * Class to convert a value to an object using the constructor of the object. 
     
    5154        // try to create a new instance 
    5255        try { 
    53             $refClass  = new ReflectionClass($this->className); 
     56            $refClass  = new ::ReflectionClass($this->className); 
    5457            if (count($cParams) > 1 && method_exists($refClass, 'newInstanceArgs') == true) { 
    5558                $instance = $refClass->newInstanceArgs($cParams); 
     
    7376                try { 
    7477                    $instance = $refClass->newInstance($cParams[0]); 
    75                 } catch (ReflectionException $re) { 
     78                } catch (::ReflectionException $re) { 
    7679                    $instance = $refClass->newInstance(); 
    7780                } 
     
    8184                throw new ValueConversionException('Could not create instance of "' . $this->className . '" as Reflection does not support newInstanceArgs().'); 
    8285            } 
    83         } catch (ReflectionException $re) { 
     86        } catch (::ReflectionException $re) { 
    8487            throw new ValueConversionException('Could not create instance of "' . $this->className . '": ' . $re->getMessage()); 
    8588        } 
  • trunk/XJConf/converters/FactoryMethodValueConverter.php

    r75 r115  
    33 * Value converter that uses a factory method to create an object. 
    44 * 
    5  * @author  Stephan Schmidt <me@schst.net> 
    6  * @author  Frank Kleine <frank.kleine@schlund.de> 
     5 * @author      Stephan Schmidt <me@schst.net> 
     6 * @author      Frank Kleine <frank.kleine@schlund.de> 
     7 * @package     XJConf 
     8 * @subpackage  converters 
    79 */ 
    8 XJConfLoader::load('converters.ValueConverter', 
    9                    'converters.AbstractObjectValueConverter', 
    10                    'exceptions.ValueConversionException' 
    11 ); 
     10namespace net::xjconf::converters; 
     11use net::xjconf::Tag; 
     12use net::xjconf::definitions::Definition; 
     13use net::xjconf::definitions::TagDefinition; 
     14use net::xjconf::exceptions::ValueConversionException; 
    1215/** 
    1316 * Value converter that uses a factory method to create an object. 
     
    5962 
    6063        try { 
    61             $refClass  = new ReflectionClass($this->className); 
     64            $refClass  = new ::ReflectionClass($this->className); 
    6265            $refMethod = $refClass->getMethod($this->methodName); 
    6366            if (!$refMethod->isStatic()) { 
    6467                throw new ValueConversionException('Could not create instance of "' . $this->className . '" using the factory method "' . $this->methodName . '" as it is no static method.'); 
    6568            } 
     69             
    6670            if (method_exists($refMethod, 'invokeArgs') == true) { 
    6771                    $instance = $refMethod->invokeArgs(null, $cParams); 
     
    7377                    throw new ValueConversionException('Could not create instance of "' . $this->className . '" as Reflection does not support invokeArgs().'); 
    7478                } 
    75         } catch (ReflectionException $re) { 
     79        } catch (::ReflectionException $re) { 
    7680                throw new ValueConversionException('Could not create instance of "' . $this->className . '" using the factory method "' . $this->methodName . '": ' . $re->getMessage()); 
    7781        } 
  • trunk/XJConf/converters/PrimitiveValueConverter.php

    r36 r115  
    11<?php 
    2 XJConfLoader::load('converters.ValueConverter', 
    3                    'converters.PrimitiveValueConverter', 
    4                    'exceptions.ValueConversionException' 
    5 ); 
    62/** 
    7  * Converter to convert a value to a primitive type 
     3 * Converter to convert a value to a primitive type. 
    84 * 
    9  * @author Stephan Schmidt <stephan.schmidt@schlund.de> 
     5 * @author      Stephan Schmidt <stephan.schmidt@schlund.de> 
     6 * @author      Frank Kleine <mikey@xjconf.net> 
     7 * @package     XJConf 
     8 * @subpackage  converters 
     9 */ 
     10namespace net::xjconf::converters; 
     11use net::xjconf::Tag; 
     12use net::xjconf::definitions::Definition; 
     13 
     14/** 
     15 * Converter to convert a value to a primitive type. 
     16 * 
     17 * @package     XJConf 
     18 * @subpackage  converters 
    1019 */ 
    1120class PrimitiveValueConverter implements ValueConverter 
    1221{ 
    13  
    1422    /** 
    1523     * Type of the primitive 
     
    3341     * @param   array  $values  list of values to convert 
    3442     * @return  mixed  the converted value 
    35      * @throws  ValueConversionException 
    3643     */ 
    3744    public function convertValue(Tag $tag, Definition $def) { 
  • trunk/XJConf/converters/StaticClassValueConverter.php

    r88 r115  
    88 * @subpackage  converters 
    99 */ 
    10 XJConfLoader::load('converters.ValueConverter', 
    11                    'exceptions.ValueConversionException' 
    12 ); 
     10namespace net::xjconf::converters; 
     11use net::xjconf::Tag; 
     12use net::xjconf::definitions::Definition; 
     13use net::xjconf::definitions::TagDefinition; 
     14use net::xjconf::exceptions::ValueConversionException; 
    1315/** 
    1416 * Class to convert a value to an object using the constructor of the object. 
     
    5658    } 
    5759 
     60    /** 
     61     * returns the type 
     62     * 
     63     * @return  string 
     64     */ 
    5865    public function getType() { 
    5966        return null; 
     
    7077    protected function addAttributesToValue(Tag $tag, TagDefinition $def) 
    7178    { 
    72         $class = new ReflectionClass($this->className); 
     79        $class = new ::ReflectionClass($this->className); 
    7380        // set all attributes 
    7481        foreach ($def->getAttributes() as $att) { 
     
    8592                    throw new ValueConversionException('Could not set attribute "' . $att->getName() . '" of "' . $this->getType() . '" using "' . $att->getSetterMethod() . '()" as the method is not static.'); 
    8693                } 
     94                 
    8795                $method->invoke(null, $val); 
    88             } catch (ReflectionException $re) { 
     96            } catch (::ReflectionException $re) { 
    8997                throw new ValueConversionException('Could not set attribute "' . $att->getName() . '" of "' . $this->getType() . '" using "' . $att->getSetterMethod() . '()", exception message: "' . $re->getMessage() . '".'); 
    9098            } 
     
    108116        } 
    109117 
    110         $class = new ReflectionClass($this->className); 
     118        $class = new ::ReflectionClass($this->className); 
    111119        foreach ($children as $child) { 
    112120            try { 
     
    116124                } 
    117125                $method->invoke(null, $child->getConvertedValue()); 
    118             } catch (ReflectionException $re) { 
     126            } catch (::ReflectionException $re) { 
    119127                throw new ValueConversionException('Could not add child "' . $child->getKey() . '" to "' . $this->getType() . '" using "' . $child->getSetterMethod() . '()", exception message: "' . $re->getMessage() . '".'); 
    120128            } 
  • trunk/XJConf/converters/ValueConverter.php

    r14 r115  
    11<?php 
    22/** 
    3  * @author Stephan Schmidt <stephan.schmidt@schlund.de> 
     3 * Interface for a value converter. 
     4 * 
     5 * @author      Stephan Schmidt <stephan.schmidt@schlund.de> 
     6 * @author      Frank Kleine <frank.kleine@schlund.de> 
     7 * @package     XJConf 
     8 * @subpackage  converters 
     9 */ 
     10namespace net::xjconf::converters; 
     11use net::xjconf::Tag; 
     12use net::xjconf::definitions::Definition; 
     13/** 
     14 * Interface for a value converter. 
     15 * 
     16 * @package     XJConf 
     17 * @subpackage  converters 
    418 */ 
    519interface ValueConverter 
  • trunk/XJConf/converters/factories/ArrayValueConverterFactory.php

    r12 r115  
    33 * Factory to create an ArrayValueConverter. 
    44 *  
    5  * @author  Frank Kleine <frank.kleine@schlund.de> 
     5 * @author      Frank Kleine <frank.kleine@schlund.de> 
     6 * @package     XJConf 
     7 * @subpackage  converters_factories 
    68 */ 
    7 XJConfLoader::load('converters.factories.ValueConverterFactory', 
    8                    'converters.ArrayValueConverter' 
    9 )
     9namespace net::xjconf::converters::factories; 
     10use net::xjconf::converters::ArrayValueConverter; 
     11use net::xjconf::definitions::Definition
    1012/** 
    1113 * Factory to create an ArrayValueConverter. 
    1214 *  
    1315 * @package     XJConf 
    14  * @subpackage  converters 
     16 * @subpackage  converters_factories 
    1517 */ 
    1618class ArrayValueConverterFactory implements ValueConverterFactory 
  • trunk/XJConf/converters/factories/AutoPrimitiveValueConverterFactory.php

    r91 r115  
    11<?php 
    22/** 
    3  * Factory for AutoPrimitiveValueConverter objects 
     3 * Factory for AutoPrimitiveValueConverter objects. 
    44 * 
    5  * @author  Stephan Schmidt <schst@xjconf.net> 
    6  * @package XJConf 
     5 * @author      Stephan Schmidt <schst@xjconf.net> 
     6 * @author      Frank Kleine <frank.kleine@schlund.de> 
     7 * @package     XJConf 
     8 * @subpackage  converters_factories 
    79 */ 
    8 XJConfLoader::load('converters.factories.ValueConverterFactory', 
    9                    'converters.AutoPrimitiveValueConverter')
    10  
     10namespace net::xjconf::converters::factories; 
     11use net::xjconf::converters::AutoPrimitiveValueConverter
     12use net::xjconf::definitions::Definition; 
    1113/** 
    12  * Factory for AutoPrimitiveValueConverter objects 
     14 * Factory for AutoPrimitiveValueConverter objects. 
    1315 * 
    14  * @package XJConf 
     16 * @package     XJConf 
     17 * @subpackage  converters_factories 
    1518 */ 
    16 class AutoPrimitiveValueConverterFactory implements ValueConverterFactory { 
    17  
     19class AutoPrimitiveValueConverterFactory implements ValueConverterFactory 
     20
    1821    /** 
    1922     * This factory is only responsible, if the type 
    2023     * is set to "xjconf:auto-primitive" 
    2124     * 
    22      * @param Definition $def 
    23      * @return boolean 
     25     * @param   Definition $def 
     26     * @return boolean 
    2427     */ 
    25     public function isResponsible(Definition $def) { 
     28    public function isResponsible(Definition $def) 
     29    { 
    2630        return 'xjconf:auto-primitive' === $def->getType(); 
    2731    } 
     
    3034     * Create a value converter 
    3135     * 
    32      * @param Definition $def 
    33      * @return ValueConverter 
     36     * @param   Definition $def 
     37     * @return ValueConverter 
    3438     */ 
    35     public function createValueConverter(Definition $def) { 
     39    public function createValueConverter(Definition $def) 
     40    { 
    3641        $converter = new AutoPrimitiveValueConverter(); 
    3742        return $converter; 
  • trunk/XJConf/converters/factories/ConstructorValueConverterFactory.php

    r22 r115  
    33 * Factory to create a ConstructorValueConverter. 
    44 * 
    5  * @author  Stephan Schmidt <stephan.schmidt@schlund.de> 
    6  * @author  Frank Kleine <frank.kleine@schlund.de> 
     5 * @author      Stephan Schmidt <stephan.schmidt@schlund.de> 
     6 * @author      Frank Kleine <frank.kleine@schlund.de> 
     7 * @package     XJConf 
     8 * @subpackage  converters_factories 
    79 */ 
    8 XJConfLoader::load('converters.factories.ValueConverterFactory', 
    9                    'converters.ConstructorValueConverter'); 
     10namespace net::xjconf::converters::factories; 
     11use net::xjconf::converters::ConstructorValueConverter; 
     12use net::xjconf::definitions::Definition; 
    1013/** 
    1114 * Factory to create an ConstructorValueConverter. 
    12  *  
     15 * 
    1316 * @package     XJConf 
    14  * @subpackage  converters 
     17 * @subpackage  converters_factories 
    1518 */ 
    1619class ConstructorValueConverterFactory implements ValueConverterFactory 
    1720{ 
    18  
    1921    /** 
    2022     * Decides whether the ConstructorValueConverter is responsible for the given Definition. 
  • trunk/XJConf/converters/factories/FactoryMethodValueConverterFactory.php

    r22 r115  
    33 * Factory to create a FactoryMethodValueConverter. 
    44 * 
    5  * @author  Stephan Schmidt <stephan.schmidt@schlund.de> 
    6