UmlSequenceDiagramPrinterToXml Class Reference

Inheritance diagram for UmlSequenceDiagramPrinterToXml:

UmlSequenceDiagramPrinterInterface

List of all members.

Public Member Functions

 getHeader ()
 perform (UmlSequenceDiagram $objUmlSequenceDiagram)
 createXml ()
 createXmlHeader ()
 createXmlFooter ()
 createXmlActors ()
 createXmlMessages ()
 setConfiguration (UmlSequenceDiagramPrinterConfigurationInterface $objConfiguration)
 getConfiguration ()

Static Public Member Functions

static getInstance ()

Protected Attributes

 $objUmlSequenceDiagram
 $objConfiguration

Static Protected Attributes

static $objInstance


Detailed Description

Generate a Xml from the Uml Sequence Diagram object
Author:
Thiago Henrique Ramos da Mata <thiago.henrique.mata@gmail.com>

Definition at line 12 of file UmlSequenceDiagramPrinterToXml.class.php.


Member Function Documentation

createXml (  ) 

Create and return the xml of the sequence diagram object

See also:
UmlSequenceDiagramPrinterToXml::createXmlHeader()

UmlSequenceDiagramPrinterToXml::createXmlActors()

UmlSequenceDiagramPrinterToXml::createXmlFooter()

Returns:
string

Definition at line 82 of file UmlSequenceDiagramPrinterToXml.class.php.

References $strXml, createXmlActors(), createXmlFooter(), createXmlHeader(), and createXmlMessages().

Referenced by perform().

00083     {
00084         $strXml = '';
00085         $strXml .= $this->createXmlHeader();
00086         $strXml .= $this->createXmlActors();
00087         $strXml .= $this->createXmlMessages();
00088         $strXml .= $this->createXmlFooter();
00089         return $strXml;
00090     }

createXmlActors (  ) 

Create and return the actors slice of the xml

Returns:
string

$objActor UmlSequenceDiagramActor

Definition at line 117 of file UmlSequenceDiagramPrinterToXml.class.php.

Referenced by createXml().

00118     {
00119         $arrActors = $this->objUmlSequenceDiagram->getActors();
00120         
00121         $strXmlActors = "\t<actors>\n";
00122         foreach( $arrActors as $objActor )
00123         {
00125             $strXmlActors .= "\t\t";
00126             $strXmlActors .= "<actor ";
00127             $strXmlActors .= 'id="' . $objActor->getId() . '" ';
00128             $strXmlActors .= 'type="' . $objActor->getType() . '" ';
00129             $strXmlActors .= '>';
00130             $strXmlActors .= $objActor->getName() . ':' . $objActor->getClassName();
00131             $strXmlActors .= "</actor>\n";
00132         }
00133         $strXmlActors .= "\t</actors>\n";
00134         return $strXmlActors;
00135     }

createXmlFooter (  ) 

Create and return the footer slice of the xml

Returns:
string

Definition at line 107 of file UmlSequenceDiagramPrinterToXml.class.php.

Referenced by createXml().

00108     {
00109         return "</sequence>\n";
00110     }

createXmlHeader (  ) 

Create and return the header slice of the xml

Returns:
string

Definition at line 97 of file UmlSequenceDiagramPrinterToXml.class.php.

Referenced by createXml().

00098     {
00099         return "<sequence>\n";
00100     }

createXmlMessages (  ) 

Create and return the messages slice of the xml

Returns:
string

$objMessage UmlSequenceDiagramMessage

$objValue UmlSequenceDiagramValue

Definition at line 142 of file UmlSequenceDiagramPrinterToXml.class.php.

Referenced by createXml().

00143     {
00144         $arrMessages = $this->objUmlSequenceDiagram->getMessages();
00145         
00146         $strXmlMessages = "\t<messages>\n";
00147         foreach( $arrMessages as $objMessage )
00148         {
00150 
00151             $strXmlMessages .= "\t\t";
00152             $strXmlMessages .= "<message ";
00153             $strXmlMessages .= 'type="' . $objMessage->getType() . '" ';
00154             $strXmlMessages .= 'from="' . $objMessage->getActorFrom()->getId() . '" ';
00155             $strXmlMessages .= 'to="' . $objMessage->getActorTo()->getId() . '" ';
00156             $strXmlMessages .= 'text="' . htmlentities( $objMessage->getText() ) . '" ';
00157             $strXmlMessages .= '>' . "\n";
00158 
00159             $strXmlMessages .= "\t\t\t";
00160             $strXmlMessages .= "<values>\n";
00161 
00162             $arrValues = $objMessage->getValues();
00163             foreach($arrValues as $objValue )
00164             {
00166                 $strXmlMessages .= "\t\t\t\t";
00167                 $strXmlMessages .= "<value ";
00168                 $strXmlMessages .= 'name = "' . $objValue->getName() . '" ';
00169                 $strXmlMessages .= 'value = "' . $objValue->getValue() . '" ';
00170                 $strXmlMessages .= "/>\n";
00171             }
00172 
00173             $strXmlMessages .= "\t\t\t";
00174             $strXmlMessages .= "</values>\n";
00175 
00176             $strXmlMessages .= "\t\t";
00177             $strXmlMessages .= "</message>\n";
00178         }
00179         $strXmlMessages .= "\t</messages>\n";
00180         return $strXmlMessages;
00181     }

getConfiguration (  ) 

Todo:
Create the configuration class to the xml printer

use the configuration class of the xml printer

Implements UmlSequenceDiagramPrinterInterface.

Definition at line 196 of file UmlSequenceDiagramPrinterToXml.class.php.

00197     {
00198         return $this->objConfiguration;
00199     }

getHeader (  ) 

Get the header of the xml printer type

Implements UmlSequenceDiagramPrinterInterface.

Definition at line 56 of file UmlSequenceDiagramPrinterToXml.class.php.

00057     {
00058         header( "Content-type: text/xml" );
00059     }

static getInstance (  )  [static]

Return the singleton of the UmlSequenceDiagramPrinterToXml

See also:
UmlSequenceDiagramPrinterInterface::getInstance
Returns:
UmlSequenceDiagramPrinterToXml

Implements UmlSequenceDiagramPrinterInterface.

Definition at line 44 of file UmlSequenceDiagramPrinterToXml.class.php.

Referenced by UmlSequenceDiagramPrinterConfigurationToXml::perform(), and CodeToDiagram::setPrinterType().

00045         {
00046                 if( self::$objInstance == null )
00047                 {
00048                         self::$objInstance = new UmlSequenceDiagramPrinterToXml();
00049                 }
00050                 return self::$objInstance;
00051         }

perform ( UmlSequenceDiagram objUmlSequenceDiagram  ) 

Perfom the print process

See also:
UmlSequenceDiagramPrinterInterface::perform( UmlSequenceDiagram )
Parameters:
UmlSequenceDiagram $objUmlSequenceDiagram
Returns:
mixer

Implements UmlSequenceDiagramPrinterInterface.

Definition at line 68 of file UmlSequenceDiagramPrinterToXml.class.php.

References createXml().

00069         {
00070                 $this->objUmlSequenceDiagram = $objUmlSequenceDiagram;
00071                 return $this->createXml();      
00072         }

setConfiguration ( UmlSequenceDiagramPrinterConfigurationInterface objConfiguration  ) 

Todo:
Create the configuration class to the xml printer

use the configuration class of the xml printer

Implements UmlSequenceDiagramPrinterInterface.

Definition at line 187 of file UmlSequenceDiagramPrinterToXml.class.php.

00188     {
00189         $this->objConfiguration = $objConfiguration;
00190     }


Member Data Documentation

$objConfiguration [protected]

Uml Sequence Diagram Printer Configuration To Xml

Todo:
Create the class configuration to the xml
UmlSequenceDiagramPrinterConfigurationToXml

Definition at line 28 of file UmlSequenceDiagramPrinterToXml.class.php.

$objInstance [static, protected]

Singleton of the UmlSequenceDiagramPrinterToXml

See also:
UmlSequenceDiagramPrinterInterface::$objInstance
UmlSequenceDiagramPrinterToXml

Definition at line 36 of file UmlSequenceDiagramPrinterToXml.class.php.

$objUmlSequenceDiagram [protected]

Uml Sequence Diagram object what will be print

See also:
UmlSequenceDiagramPrinterInterface->objUmlSequenceDiagram
UmlSequenceDiagram

Definition at line 20 of file UmlSequenceDiagramPrinterToXml.class.php.


The documentation for this class was generated from the following file:

Generated on Thu Feb 3 03:55:04 2011 for CodeToDiagram by  doxygen 1.5.9