Location: PHPKode > scripts > UML 2 Classes > uml-2-classes/src/Classes/Methods/MethodParser.class.php
<?
/**
 * Parser for the XMI Methods
 *
 *@author	Teoni Valois da Mota Silva
 *@name		MethodParser
 *@package	Methods
 *@version 	0.1.1
 *
 */

class MethodParser extends XMIParser{
	
	/**
	 * MethodParser's Object constructor
	 *
	 * @param String $xmiFile
	 */
	function MethodParser($data){
		$this->data = $data[0]['UML:Operation'];
	}
	
	/**
	 * MethodParser's Object destructor
	 *
	 */
	function __destruct(){
		$this->data = null;
	}
	
	function getName($methodId){
		return $this->data[$methodId]['name'];
	}
	
	/**
	 * Returns the XMI Id of The Method
	 *
	 * @param Int $methodId
	 * @return String
	 */
	function getXMIId($methodId){
		return $this->data[$methodId]['xmi.id'];
	}
	
	/**
	 * Returns the Visibility Status of The Method
	 *
	 * @param Int $methodId
	 * @return String
	 */
	function getVisibility($methodId){
		return $this->data[$methodId]['visibility'];
	}
	
	/**
	 * Returns the Specification Status of The Method
	 *
	 * @param Int $methodId
	 * @return String
	 */
	function getSpecificationStatus($methodId){
		return $this->data[$methodId]['isSpecification'];
	}
	
	/**
	 * Returns the Owner Scope of The Method
	 *
	 * @param Int $methodId
	 * @return String
	 */
	function getOwnerScope($methodId){
		return $this->data[$methodId]['ownerScope'];
	}
	
	/**
	 * Returns the Query Status of The Method
	 *
	 * @param Int $methodId
	 * @return String
	 */
	function getQueryStatus($methodId){
		return $this->data[$methodId]['isQuery'];
	}
	
	/**
	 * Returns the Concurrency of The Method
	 *
	 * @param Int $methodId
	 * @return String
	 */
	function getConcurrency($methodId){
		return $this->data[$methodId]['concurrency'];
	}
	
	/**
	 * Returns the Root Status of The Method
	 *
	 * @param Int $methodId
	 * @return String
	 */
	function getRootStatus($methodId){
		return $this->data[$methodId]['isRoot'];
	}
	
	/**
	 * Returns the Leaf Status of The Method
	 *
	 * @param Int $methodId
	 * @return String
	 */
	function getLeafStatus($methodId){
		return $this->data[$methodId]['isLeaf'];
	}
	
	/**
	 * Returns the Abstract Status of The Method
	 *
	 * @param Int $methodId
	 * @return String
	 */
	function getAbstractStatus($methodId){
		return $this->data[$methodId]['isAbstract'];
	}
	
	function getParameters($methodId){
		$parameters = $this->data[$methodId]['UML:BehavioralFeature.parameter'][0]['UML:Parameter'];
		$numberOfParameters = count($parameters);
		$array = array();
		for($i=0;$i<$numberOfParameters;$i++){
			if($parameters[$i]['kind'] != 'return'){
				array_push($array,$parameters[$i]['name']);
			}
		}
		return $array;
	}
}
?>
Return current item: UML 2 Classes