From: <de...@us...> - 2004-01-16 00:50:05
|
Update of /cvsroot/pymerase/pymerase/pymerase In directory sc8-pr-cvs1:/tmp/cvs-serv2166 Modified Files: ClassMembers.py Log Message: Add support for tracking Public/Private/Protected attributes Index: ClassMembers.py =================================================================== RCS file: /cvsroot/pymerase/pymerase/pymerase/ClassMembers.py,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** ClassMembers.py 10 Sep 2003 02:07:13 -0000 1.28 --- ClassMembers.py 16 Jan 2004 00:50:02 -0000 1.29 *************** *** 210,213 **** --- 210,217 ---- return self.config.getNameMangler(translatorName).createAppender(self.name) + ATTRIBUTE_PUBLIC = 0 + ATTRIBUTE_PROTECTED = 1 + ATTRIBUTE_PRIVATE = 2 + class ClassAttribute(ModelElement): """Stores information about an attribute from the xml definition file *************** *** 221,224 **** --- 225,229 ---- self.__primaryKey = 0 self.__foreignKey = 0 + self.__access = ATTRIBUTE_PUBLIC self.__indexed = 0 *************** *** 281,284 **** --- 286,321 ---- return (self.__primaryKey or self.__foreignKey) + def setPublicAccess(self): + """Indicate attribute has public access + """ + self.__access = ATTRIBUTE_PUBLIC + + def isPublicAccess(self): + """Does attribute has public access + """ + return self.__access == ATTRIBUTE_PUBLIC + + def setProtectedAccess(self): + """Indicate attribute has protected access + """ + self.__access = ATTRIBUTE_PROTECTED + + def isProtectedAccess(self): + """Does attribute has protected access + """ + return self.__access == ATTRIBUTE_PROTECTED + + def setPrivateAccess(self): + """Indicate attribute has private access + """ + self.__access = ATTRIBUTE_PRIVATE + + def isPrivateAccess(self): + """Does attribute has private access + """ + return self.__access == ATTRIBUTE_PRIVATE + # end class attribute + + def createAssociation(pymeraseConfig, thisEnd, otherEnd, associationName=None, associationUUID=None): """Helper function to create association with provided associationEnds *************** *** 315,318 **** --- 352,356 ---- return association + class Association(ModelElement): """Describe the meta info regarding the between two objects *************** *** 366,370 **** firstEndName, secondEndName) ! class AssociationEnd(ModelElement): """Maintain meta information each end of an association. --- 404,408 ---- firstEndName, secondEndName) ! class AssociationEnd(ModelElement): """Maintain meta information each end of an association. *************** *** 389,392 **** --- 427,431 ---- self.__multiplicity = None self.__aggregation = 0 + self.__access = ATTRIBUTE_PUBLIC # things to make ER easier |