314 @return external state |
314 @return external state |
315 @rtype bool |
315 @rtype bool |
316 """ |
316 """ |
317 return self.external |
317 return self.external |
318 |
318 |
319 def buildItemDataString(self): |
|
320 """ |
|
321 Public method to build a string to persist the specific item data. |
|
322 |
|
323 This string must start with ", " and should be built like |
|
324 "attribute=value" with pairs separated by ", ". value must not |
|
325 contain ", " or newlines. |
|
326 |
|
327 @return persistence data |
|
328 @rtype str |
|
329 """ |
|
330 entries = [ |
|
331 "is_external={0}".format(self.external), |
|
332 "no_attributes={0}".format(self.noAttrs), |
|
333 "name={0}".format(self.model.getName()), |
|
334 ] |
|
335 instanceAttributes = self.model.getInstanceAttributes() |
|
336 if instanceAttributes: |
|
337 entries.append("attributes={0}".format( |
|
338 "||".join(instanceAttributes))) |
|
339 methods = self.model.getMethods() |
|
340 if methods: |
|
341 entries.append("methods={0}".format( |
|
342 "||".join(methods))) |
|
343 classAttributes = self.model.getClassAttributes() |
|
344 if classAttributes: |
|
345 entries.append("class_attributes={0}".format( |
|
346 "||".join(classAttributes))) |
|
347 |
|
348 return ", " + ", ".join(entries) |
|
349 |
|
350 def parseItemDataString(self, version, data): |
319 def parseItemDataString(self, version, data): |
351 """ |
320 """ |
352 Public method to parse the given persistence data. |
321 Public method to parse the given persistence data. |
353 |
322 |
354 @param version version of the data |
323 @param version version of the data |