6 Copyright (C) 2009-2010 8 RT-Synthesis Research Group 9 Intelligent Systems Research Institute, 10 National Institute of Advanced Industrial Science and Technology (AIST), 13 Licensed under the Eclipse Public License -v 1.0 (EPL) 14 http://www.opensource.org/licenses/eclipse-1.0.txt 18 Object representing a participating component. 22 __version__ =
'$Revision: $' 26 from rtsprofile
import RTS_NS, RTS_NS_S
35 '''This object contains a reference to a component object that is part of a 43 @param target_component The target component of this participant. 44 @type target_component TargetComponent 48 expected_type=TargetComponent, required=
False)
56 '''The target component of this participant.''' 59 @target_component.setter
62 expected_type=TargetComponent, required=
True)
66 '''Parse an xml.dom Node object representing a participant into this 70 if node.getElementsByTagNameNS(RTS_NS,
'Participant').length != 1:
71 raise InvalidParticipantNodeError
73 node.getElementsByTagNameNS(RTS_NS,
'Participant')[0])
77 '''Parse a YAML specification of a participant into this object.''' 78 if 'participant' not in y:
79 raise InvalidParticipantNodeError
84 '''Save this participant into an xml.dom.Element object.''' 85 new_element = doc.createElementNS(RTS_NS, RTS_NS_S +
'Participant')
86 self.target_component.save_xml(doc, new_element)
87 element.appendChild(new_element)
90 '''Save this participant into a dictionary.''' 91 return {
'participant': self.target_component.to_dict()}
def parse_yaml_node(self, y)
def __init__(self, target_component=None)
def validate_attribute(attr, name, expected_type=None, required=False)
def save_xml(self, doc, element)
def parse_xml_node(self, node)