
try:
    from generatedssuper import GeneratedsSuper
except ImportError, exp:

    class GeneratedsSuper(object):
    o
    o
    o
        # fix_any
        def gds_build_any(self, node, type_name=None):
            return None

class PlantType_single(GeneratedsSuper):
    """Test for xs:any child element"""
    subclass = None
    superclass = None
    # fix_any
    def __init__(self, name=None, description=None, any_=None):
        self.name = name
        self.description = description
        # fix_any
        self.any_ = any_
    def factory(*args_, **kwargs_):
        if PlantType.subclass:
            return PlantType.subclass(*args_, **kwargs_)
        else:
            return PlantType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_name(self): return self.name
    def set_name(self, name): self.name = name
    def get_description(self): return self.description
    def set_description(self, description): self.description = description
    # fix_any
    def get_any_(self): return self.any_
    def set_any_(self, any_): self.any_ = any_
    def export(self, outfile, level, namespace_='', name_='PlantType', namespacedef_=''):
        showIndent(outfile, level)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='PlantType')
        if self.hasContent_():
            outfile.write('>\n')
            self.exportChildren(outfile, level + 1, namespace_, name_)
            showIndent(outfile, level)
            outfile.write('</%s%s>\n' % (namespace_, name_))
        else:
            outfile.write('/>\n')
    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='PlantType'):
        pass
    def exportChildren(self, outfile, level, namespace_='', name_='PlantType', fromsubclass_=False):
        if self.name is not None:
            showIndent(outfile, level)
            outfile.write('<%sname>%s</%sname>\n' % (namespace_, self.gds_format_string(quote_xml(self.name).encode(ExternalEncoding), input_name='name'), namespace_))
        if self.description:
            self.description.export(outfile, level, namespace_, name_='description', )
        # fix_any
        if self.any_:
            obj_.export(outfile, level, namespace_, name_='description', )
    def hasContent_(self):
        if (
            self.name is not None or
            self.description is not None
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='PlantType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        pass
    def exportLiteralChildren(self, outfile, level, name_):
        if self.name is not None:
            showIndent(outfile, level)
            outfile.write('name=%s,\n' % quote_python(self.name).encode(ExternalEncoding))
        if self.description is not None:
            showIndent(outfile, level)
            outfile.write('description=model_.DescriptionType(\n')
            self.description.exportLiteral(outfile, level, name_='description')
            showIndent(outfile, level)
            outfile.write('),\n')
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        pass
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'name':
            name_ = child_.text
            name_ = self.gds_validate_string(name_, node, 'name')
            self.name = name_
        elif nodeName_ == 'description':
            obj_ = DescriptionType.factory()
            obj_.build(child_)
            self.set_description(obj_)
        # fix_any
        else:
            obj_ = self.gds_build_any(node, 'PlantType')
            self.set_any_(obj_)
# end class PlantType

class PlantType_multiple(GeneratedsSuper):
    """Test for xs:any child element with maxOccurs="unbounded" """
    subclass = None
    superclass = None
    # fix_any
    def __init__(self, name=None, description=None, any_=None):
        self.name = name
        self.description = description
        # fix_any
        if any_ is None:
            self.any_ = []
        else:
            self.any_ = any_
    def factory(*args_, **kwargs_):
        if PlantType.subclass:
            return PlantType.subclass(*args_, **kwargs_)
        else:
            return PlantType(*args_, **kwargs_)
    factory = staticmethod(factory)
    def get_name(self): return self.name
    def set_name(self, name): self.name = name
    def get_description(self): return self.description
    def set_description(self, description): self.description = description
    # fix_any
    def get_any_(self): return self.any_
    def set_any_(self, any_): self.any_ = any_
    def add_any_(self, any_obj): self.any_.append(any_obj)
    def export(self, outfile, level, namespace_='', name_='PlantType', namespacedef_=''):
        showIndent(outfile, level)
        outfile.write('<%s%s%s' % (namespace_, name_, namespacedef_ and ' ' + namespacedef_ or '', ))
        already_processed = []
        self.exportAttributes(outfile, level, already_processed, namespace_, name_='PlantType')
        if self.hasContent_():
            outfile.write('>\n')
            self.exportChildren(outfile, level + 1, namespace_, name_)
            showIndent(outfile, level)
            outfile.write('</%s%s>\n' % (namespace_, name_))
        else:
            outfile.write('/>\n')
    def exportAttributes(self, outfile, level, already_processed, namespace_='', name_='PlantType'):
        pass
    def exportChildren(self, outfile, level, namespace_='', name_='PlantType', fromsubclass_=False):
        if self.name is not None:
            showIndent(outfile, level)
            outfile.write('<%sname>%s</%sname>\n' % (namespace_, self.gds_format_string(quote_xml(self.name).encode(ExternalEncoding), input_name='name'), namespace_))
        if self.description:
            self.description.export(outfile, level, namespace_, name_='description', )
        # fix_any
        if self.any_:
            for obj_ in self.any_:
                obj_.export(outfile, level, namespace_, name_='description', )
    def hasContent_(self):
        if (
            self.name is not None or
            self.description is not None
            ):
            return True
        else:
            return False
    def exportLiteral(self, outfile, level, name_='PlantType'):
        level += 1
        self.exportLiteralAttributes(outfile, level, [], name_)
        if self.hasContent_():
            self.exportLiteralChildren(outfile, level, name_)
    def exportLiteralAttributes(self, outfile, level, already_processed, name_):
        pass
    def exportLiteralChildren(self, outfile, level, name_):
        if self.name is not None:
            showIndent(outfile, level)
            outfile.write('name=%s,\n' % quote_python(self.name).encode(ExternalEncoding))
        if self.description is not None:
            showIndent(outfile, level)
            outfile.write('description=model_.DescriptionType(\n')
            self.description.exportLiteral(outfile, level, name_='description')
            showIndent(outfile, level)
            outfile.write('),\n')
    def build(self, node):
        self.buildAttributes(node, node.attrib, [])
        for child in node:
            nodeName_ = Tag_pattern_.match(child.tag).groups()[-1]
            self.buildChildren(child, node, nodeName_)
    def buildAttributes(self, node, attrs, already_processed):
        pass
    def buildChildren(self, child_, node, nodeName_, fromsubclass_=False):
        if nodeName_ == 'name':
            name_ = child_.text
            name_ = self.gds_validate_string(name_, node, 'name')
            self.name = name_
        elif nodeName_ == 'description':
            obj_ = DescriptionType.factory()
            obj_.build(child_)
            self.set_description(obj_)
        # fix_any
        else:
            obj_ = self.gds_build_any(node, 'PlantType')
            self.add_any_(obj_)
# end class PlantType

