C:\xampp\php\pear\PHP\UML\Output\Exporter.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<?php
/**
 * PHP_UML
 *
 * PHP version 5
 *
 * @category PHP
 * @package  PHP_UML
 * @author   Baptiste Autin <ohlesbeauxjours@yahoo.fr> 
 * @license  http://www.gnu.org/licenses/lgpl.html LGPL License 3
 * @version  SVN: $Revision: 179 $
 * @link     http://pear.php.net/package/PHP_UML
 * @since    $Date: 2011-09-19 16:09:54 +0200 (lun., 19 sept. 2011) $
 */

/**
 * This class is a set of various data/switches that can be used by the
 * implementations of the exporter
 * 
 * @category   PHP
 * @package    PHP_UML
 * @subpackage Output
 * @author     Baptiste Autin <ohlesbeauxjours@yahoo.fr> 
 * @license    http://www.gnu.org/licenses/lgpl.html LGPL License 3
 */
abstract class PHP_UML_Output_Exporter
{
    const 
APP_NAME 'PHP_UML';
    
    
/**
     * A UML model
     * @var PHP_UML_Metamodel_Superstructure
     */
    
protected $structure;
   
    
/**
     * Constructor
     *
     * @param string $format Usual format name
     */
    
public function __construct()
    {
    }
    
    
/**
     * Setter for the model.
     * 
     * @param PHP_UML_Metamodel_Superstructure $model A UML model
     */
    
public function setModel(PHP_UML_Metamodel_Superstructure $model)
    {
        
$this->structure $model;
    }
    
    
    
/**
     * Export the current model to a particular output format.
     * 
     * @param string $outDir Directory where the resulting output must be stored
     */
    
abstract public function export($outDir);
    
    
/**
     * Factory method to retrieve an implementation of an exporter, given the "common name" of
     * a format.
     * 
     * @param string $format Common name of the desired export format
     * 
     * @return PHP_UML_Output_Exporter
     */
    
static function getInstance($format)
    {
        if (empty(
$format))
            
$format 'xmi';
        
        
$format strtolower($format);
        
        
$ucf ucfirst($format);
        if (
$ucf == "Htmlnew")
            
$ucf "HtmlNew";
        
        
$className 'PHP_UML_Output_'.$ucf.'_Exporter';
        
        if (!
class_exists($className)) {
            throw new 
PHP_UML_Exception('Unknown export format: "'.$format.'"');
        }
        
        
$instance = new $className();

        return 
$instance;
    }
}
?>
x

Windows NT KPTV 6.2 build 9200 (Windows Server 2012 Datacenter Edition) i586