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

class XMLSchemaRestriction describes a refinement on the behavior of existing types. For example, one could define a restriction representing a list of residue indexes separating commas: "15,44,102" and then describe an attribute of a complex type as having to conform to that restriction. An xml-schema validator would be able to say that an input file with "fifteen,fortyfour,onehundredandtwo" did not meet the schema. More...

#include <XMLSchemaGeneration.hh>

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

Public Member Functions

 XMLSchemaRestriction ()
 
void name (std::string const &setting)
 
void base_type (XMLSchemaType setting)
 
void add_restriction (XMLSchemaRestrictionType type, std::string const &value)
 
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::pointer::ReferenceCount
 ReferenceCount ()
 Default constructor. More...
 
virtual ~ReferenceCount ()
 

Private Attributes

std::string name_
 
XMLSchemaType base_type_
 
std::list< std::pair
< XMLSchemaRestrictionType,
std::string > > 
restrictions_
 

Additional Inherited Members

- Public Types inherited from utility::pointer::ReferenceCount
typedef platform::Size Size
 
typedef platform::Size size_type
 

Detailed Description

class XMLSchemaRestriction describes a refinement on the behavior of existing types. For example, one could define a restriction representing a list of residue indexes separating commas: "15,44,102" and then describe an attribute of a complex type as having to conform to that restriction. An xml-schema validator would be able to say that an input file with "fifteen,fortyfour,onehundredandtwo" did not meet the schema.

See the description of XML schema restrictions here: http://www.w3schools.com/xml/schema_facets.asp Restrictions are given as pairs of restriction types and then values for those restriction types. The restriction types are defined in an enumeration in XMLSchemaGeneration.fwd.hh.

An example of a useful XMLSchemaRestriction is oen to define a comma-separated list of integers. The elements in the XMLSchema that would define such a restriction look like this:

/// <xs:simpleType name="int_cslist">
///  <xs:restriction base="xs:string">
///   <xs:pattern value="[0-9]+(,[0-9]+)*"/>
///  </xs:restriction>
/// </xs:simpleType>
/// 

Constructor & Destructor Documentation

utility::tag::XMLSchemaRestriction::XMLSchemaRestriction ( )
default

Member Function Documentation

void utility::tag::XMLSchemaRestriction::add_restriction ( XMLSchemaRestrictionType  type,
std::string const &  value 
)
void utility::tag::XMLSchemaRestriction::base_type ( XMLSchemaType  setting)
std::string const & utility::tag::XMLSchemaRestriction::element_name ( ) const
overridevirtual
void utility::tag::XMLSchemaRestriction::name ( std::string const &  setting)
void utility::tag::XMLSchemaRestriction::prepare_for_output ( XMLSchemaDefinition xsd) const
overridevirtual
void utility::tag::XMLSchemaRestriction::write_definition ( int  indentation,
std::ostream &  os 
) const
overridevirtual

Member Data Documentation

XMLSchemaType utility::tag::XMLSchemaRestriction::base_type_
private
std::string utility::tag::XMLSchemaRestriction::name_
private
std::list< std::pair< XMLSchemaRestrictionType, std::string > > utility::tag::XMLSchemaRestriction::restrictions_
private

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