37""" Initialization. """
+ 38ifnothasattr(property_node,'name'):
+ 39raiseException("Name is not defined for '"+str(property_node)+"'")
+ 40ifnothasattr(property_node,'type'):
+ 41raiseException("Type is not defined for '"+str(property_node.name)+"'")
+ 42ifnothasattr(property_node,'description'):
+ 43raiseException("Description is not defined for '"+str(property_node.name)+"'")
+ 44
+ 45self.name=str(property_node.name)
+ 46self.editStatus=str(property_node.editStatus)
+ 47self.type=str(property_node.type)
+ 48self.description=str(property_node.description).strip()
+ 49
+ 50iflen(self.description)==0:
+ 51_logger.log(logging.ERROR,"Description has no content for '"+str(property_node.name)+"'")
+ 52
+ 53ifhasattr(property_node,'deprecated'):
+ 54self.deprecated=str(property_node.deprecated)
+
75""" Checks that the set of properties in a group are properly defined. """
+ 76defined_props=[pforpinself.properties.keys()ifconfig.has_key(p)]
+ 77iflen(defined_props)>0:
+ 78required_props=[pforpinself.properties.keys()ifself.properties[p]=='required']
+ 79required_not_defined_props=set(required_props).difference(set(defined_props))
+ 80forundefined_propertyinrequired_not_defined_props:
+ 81items.append(UndefinedRequiredInGroupItem((self.name,undefined_property)))
+
126""" Validate the Ant configuration against the model at build startup. """
+127items=[]
+128
+129forpinself.required_props:
+130ifnotconfig.has_key(str(p)):
+131print"Required property "+str(p)+" is not defined!"
+132
+133returnitems
+
144""" Check for any defined properties that are not in the model. """
+145undefined_properties=[pforpinconfig.keys()ifpnotinself.properties]
+146undefined_properties.sort()
+147forundefined_propertyinundefined_properties:
+148items.append(MissingFromDataModelItem(undefined_property))
+
156gp=[]
+157forgroupinself.groups.values():
+158gp=gp+group.properties.keys()
+159forpinself.properties.values():
+160ifnotstr(p)ingp:
+161raiseException(str(p)+' not in a group')
+