C:\xampp\php\pear\PHP\UML\Output\Eclipse\BuilderImpl2.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
<?php
/**
 * PHP_UML (PHP_UML_Output_Eclipse_BuilderImpl2)
 *
 * 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: 176 $
 * @link     http://pear.php.net/package/PHP_UML
 * @since    $Date: 2011-09-19 00:03:11 +0200 (lun., 19 sept. 2011) $
 */

/**
 * Implementation class to create XMI in version 2, adapted for importation into Eclipse
 * 
 * See the interface PHP_UML_Output_Eclipse_Builder for the comments.
 *
 * @category   PHP
 * @package    PHP_UML
 * @subpackage Output
 * @subpackage Xmi
 * @see        PHP_UML_Output_Xmi_Builder
 * @author     Baptiste Autin <ohlesbeauxjours@yahoo.fr> 
 * @license    http://www.gnu.org/licenses/lgpl.html LGPL License 3
 */
class PHP_UML_Output_Eclipse_BuilderImpl2 extends PHP_UML_Output_Xmi_BuilderImpl2
{
    const 
XMI_VERSION '2.1';
    const 
UML_VERSION '2.1.2';

    const 
DEFAULT_CLASSIFIER_ATT ' visibility="public" ';

    public function 
getXmiHeaderOpen()
    {
        return 
'';
    }

    public function 
getModelOpen(PHP_UML_Metamodel_Package $model)
    {
        return 
'<uml:Model xmi:type="uml:Model" name="'.$model->name.'"
            xmi:version="2.1" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1"
            xmlns:uml="http://www.eclipse.org/uml2/2.1.0/UML"
            xmi:id="'
.$model->id.'" '.self::DEFAULT_CLASSIFIER_ATT.'>';
    }
    
    public function 
getXmiHeaderClose()
    {
        return 
'';
    }
    
    public function 
getRealizations(PHP_UML_Metamodel_Class $client)
    {
        
$str '';
        foreach (
$client->implements as &$rclass) {
            if (
is_object($rclass)) {
                
$str .= '<packagedElement xmi:type="uml:Realization" '.
                
'xmi:id="'.self::getUID().'" '.
                
'client="'.$client->id.'" '.
                
'supplier="'.$rclass->id.'" />';
            }
        }
        return 
$str;
    }
}
?>
x

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