Rosetta  2020.37
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Attributes | List of all members
utility::tag::XMLSchemaComplexType Class Reference

class XMLSchemaComplexType represents the definition of the type for an element – that is, the structure of a set of elements with the same name. If an XMLSchemaElement is analogous to a utility::tag::Tag, an XMLSchemaComplexType is analogous to the wiki page describing the valid format for an instance of that Tag. More...

#include <XMLSchemaGeneration.hh>

Inheritance diagram for utility::tag::XMLSchemaComplexType:
Inheritance graph
[legend]

Public Member Functions

 XMLSchemaComplexType ()
 
XMLSchemaComplexTypename (std::string const &setting)
 
XMLSchemaComplexTypedescription (std::string const &setting)
 
XMLSchemaComplexTypeset_model_group (XMLSchemaModelGroupCOP model_group)
 
XMLSchemaComplexTypeadd_attribute (XMLSchemaAttribute attribute)
 
XMLSchemaComplexTypeadd_attributes (AttributeList const &attributes)
 
std::string const & element_name () const override
 
void write_definition (int indentation, std::ostream &os) const override
 
void prepare_for_output (XMLSchemaDefinition &xsd) const override
 
- Public Member Functions inherited from utility::VirtualBase
 VirtualBase ()=default
 Default constructor. More...
 
virtual ~VirtualBase ()=default
 The virtual destructor is one of the main reasons for the VirtualBase class. More...
 
 VirtualBase (VirtualBase const &)=default
 
 VirtualBase (VirtualBase &&)=default
 
VirtualBaseoperator= (VirtualBase const &)=default
 
VirtualBaseoperator= (VirtualBase &&)=default
 

Private Attributes

std::string name_
 
std::string desc_
 
XMLSchemaModelGroupCOP model_group_
 
std::list< XMLSchemaAttributeattributes_
 

Detailed Description

class XMLSchemaComplexType represents the definition of the type for an element – that is, the structure of a set of elements with the same name. If an XMLSchemaElement is analogous to a utility::tag::Tag, an XMLSchemaComplexType is analogous to the wiki page describing the valid format for an instance of that Tag.

XMLSchemaComplexTypes can be named or unnamed: if they are named, then the are inserted into the XMLSchemaDefinition on their own, and can be referred to by name in other XMLSchemaElements; if they are unnamed, then they are given as an in-line definition for an XMLSchemaElement. So a name is not required for an XMLSchemaComplexType. That said: the recommended structure for defining an XML Schema is that complex types should be named and to live on their own – elements should refer to these complex types by name.

(There are some who recommend that instead elements be defined at "global scope" – i.e. directly beneath the xs:schema tag – and that complex types be unnamed. The principle disadvantage of that idea is that you cannot have two elements in different contexts with the same name but different structures. This problem of "name collisions" is addressed in XML Schema through the use of "namespacing," which is horrendous, so we won't use it. By giving complex types names, we can avoid name collision by just giving the complex types different names, which has no effect on the apperance of the XML file itself.)

Complex types must be one of the five options in the XMLSchemaComplexTypeType. They are either:

A complex type may refer to a reference type, and then extend that type, e.g. by adding extra attributes.

In the case of a "group" complex type, the complex type needs to contain a subtype. E.g. the group complex-type defined by ResidueSelectorFactory holds a choice complex-type.

Complex types may contain subelements; these subelements can be added through a model group (e.g. "xs:all") that itself contains elements and possibly other model groups.

Complex types may contain attributes; these attributes can be added through the add_attribute method.

Complex types may be repeated, e.g., in the sequence or group cases. You may specify the minimum and maximum number of times the complex type is to appaer.

Constructor & Destructor Documentation

utility::tag::XMLSchemaComplexType::XMLSchemaComplexType ( )
default

Member Function Documentation

XMLSchemaComplexType & utility::tag::XMLSchemaComplexType::add_attribute ( XMLSchemaAttribute  attribute)
XMLSchemaComplexType & utility::tag::XMLSchemaComplexType::add_attributes ( AttributeList const &  attributes)
XMLSchemaComplexType & utility::tag::XMLSchemaComplexType::description ( std::string const &  setting)
std::string const & utility::tag::XMLSchemaComplexType::element_name ( ) const
overridevirtual
XMLSchemaComplexType & utility::tag::XMLSchemaComplexType::name ( std::string const &  setting)
void utility::tag::XMLSchemaComplexType::prepare_for_output ( XMLSchemaDefinition xsd) const
overridevirtual
XMLSchemaComplexType & utility::tag::XMLSchemaComplexType::set_model_group ( XMLSchemaModelGroupCOP  model_group)
void utility::tag::XMLSchemaComplexType::write_definition ( int  indentation,
std::ostream &  os 
) const
overridevirtual

Member Data Documentation

std::list< XMLSchemaAttribute > utility::tag::XMLSchemaComplexType::attributes_
private
std::string utility::tag::XMLSchemaComplexType::desc_
private

Referenced by description(), and write_definition().

XMLSchemaModelGroupCOP utility::tag::XMLSchemaComplexType::model_group_
private
std::string utility::tag::XMLSchemaComplexType::name_
private

The documentation for this class was generated from the following files: