コード例 #1
0
    def _getFields(self, Class):
        """
        To extract fields from Class.
        """
        # for class fields
        allFields = []
        for Field in Class.getElementsByTagName("Field"):

            aField = PyutField()
            aField.setVisibility(Field.getAttribute('visibility'))
            Param = Field.getElementsByTagName("Param")[0]

            if Param.hasAttribute('defaultValue'):
                aField.setDefaultValue(Param.getAttribute('defaultValue'))
            aField.setName(Param.getAttribute('name'))
            aField.setType(Param.getAttribute('type'))

            allFields.append(aField)
        return allFields
コード例 #2
0
ファイル: PyutXml.py プロジェクト: curiousTauseef/PyUt
    def _getFields(self, Class):
        """
        To extract fields form Class.

        @since 1.0
        @author Deve Roux <*****@*****.**>
        """
        # for class fields
        allFields = []
        for Field in Class.getElementsByTagName("Field"):

            aField = PyutField()
            # aField.setVisibility(Field.getAttribute('visibility'))
            vis: PyutVisibilityEnum = PyutVisibilityEnum(Field.getAttribute('visibility'))
            aField.setVisibility(vis)
            Param = Field.getElementsByTagName("Param")[0]
            if Param.hasAttribute('defaultValue'):
                aField.setDefaultValue(Param.getAttribute('defaultValue'))
            aField.setName(Param.getAttribute('name'))
            aField.setType(Param.getAttribute('type'))

            allFields.append(aField)
        return allFields