All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
XSDSerializer.h
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file terralib/xsd/XSDSerializer.h
22 
23  \brief Data serialization for the XSD module.
24 */
25 
26 #ifndef __TERRALIB_XSD_INTERNAL_XSDSERIALIZER_H
27 #define __TERRALIB_XSD_INTERNAL_XSDSERIALIZER_H
28 
29 // TerraLib
30 #include "../../Config.h"
31 #include "../../Enums.h"
32 
33 //STL
34 #include <string>
35 
36 //#ifdef TE_ENABLED_XML
37 
38 namespace te
39 {
40  namespace xml
41  {
42  class Reader;
43  class Writer;
44  }
45 
46  namespace xsd
47  {
48  class All;
49  class Annotation;
50  class Any;
51  class AnyAttribute;
52  class Attribute;
53  class AttributeGroup;
54  class Choice;
55  class ComplexContent;
56  class ComplexType;
57  class Element;
58  class Extension;
59  class Field;
60  class Group;
61  class Import;
62  class Include;
63  class Key;
64  class KeyRef;
65  class List;
66  class Redefine;
67  class Restriction4ComplexContent;
68  class Restriction4SimpleContent;
69  class Restriction4SimpleType;
70  class Schema;
71  class Selector;
72  class Sequence;
73  class SimpleContent;
74  class SimpleType;
75  class Union;
76  class Unique;
77  class Identifiable;
78  class Annotated;
79  class Occurs;
80  class QName;
81 
82  namespace serialize
83  {
85 
86  TEXSDEXPORT void Save(All* all, te::xml::AbstractWriter& writer);
87 
89 
90  TEXSDEXPORT void Save(Annotation* annotation, te::xml::AbstractWriter& writer);
91 
93 
94  TEXSDEXPORT void Save(Any* any, te::xml::AbstractWriter& writer);
95 
97 
98  TEXSDEXPORT void Save(AnyAttribute* anyAttribute, te::xml::AbstractWriter& writer);
99 
101 
102  TEXSDEXPORT void Save(Attribute* attribute, te::xml::AbstractWriter& writer);
103 
105 
106  TEXSDEXPORT void Save(AttributeGroup* attributeGroup, te::xml::AbstractWriter& writer);
107 
109 
110  TEXSDEXPORT void Save(Choice* choice, te::xml::AbstractWriter& writer);
111 
113 
115 
117 
119 
121 
122  TEXSDEXPORT void Save(Element* element, te::xml::AbstractWriter& writer);
123 
125 
126  TEXSDEXPORT void Save(Extension* extension, te::xml::AbstractWriter& writer);
127 
129 
130  TEXSDEXPORT void Save(Field* field, te::xml::AbstractWriter& writer);
131 
133 
134  TEXSDEXPORT void Save(Group* group, te::xml::AbstractWriter& writer);
135 
137 
138  TEXSDEXPORT void Save(Import* import, te::xml::AbstractWriter& writer);
139 
141 
142  TEXSDEXPORT void Save(Include* include, te::xml::AbstractWriter& writer);
143 
145 
146  TEXSDEXPORT void Save(Key* key, te::xml::AbstractWriter& writer);
147 
149 
150  TEXSDEXPORT void Save(KeyRef* keyRef, te::xml::AbstractWriter& writer);
151 
153 
154  TEXSDEXPORT void Save(List* list, te::xml::AbstractWriter& writer);
155 
157 
158  TEXSDEXPORT void Save(Redefine* redefine, te::xml::AbstractWriter& writer);
159 
161 
163 
165 
167 
169 
171 
172  TEXSDEXPORT Schema* ReadSchema(const std::string& path);
173 
175 
176  TEXSDEXPORT void Save(Schema* schema, te::xml::AbstractWriter& writer);
177 
179 
180  TEXSDEXPORT void Save(Selector* selector, te::xml::AbstractWriter& writer);
181 
183 
184  TEXSDEXPORT void Save(Sequence* sequence, te::xml::AbstractWriter& writer);
185 
187 
189 
191 
193 
195 
196  TEXSDEXPORT void Save(Union* u, te::xml::AbstractWriter& writer);
197 
199 
200  TEXSDEXPORT void Save(Unique* unique, te::xml::AbstractWriter& writer);
201 
202  void ReadIdentifiable(Identifiable* identifiable, te::xml::Reader& reader);
203 
204  void ReadAnnotated(Annotated* annotated, te::xml::Reader& reader);
205 
206  void ReadOccurs(Occurs* occurs, te::xml::Reader& reader);
207 
208  QName* CreateQName(const std::string& name);
209 
210  FacetType GetFacetType(const std::string& name);
211 
212  } // end namespace serialize
213  } // end namespace xsd
214 } // end namespace te
215 
216 //#endif // TE_ENABLED_XML
217 
218 #endif // __TERRALIB_XSD_INTERNAL_XSDSERIALIZER_H
TEXSDEXPORT void Save(All *all, te::xml::AbstractWriter &writer)
TEXSDEXPORT Element * ReadElement(te::xml::Reader &reader)
TEXSDEXPORT AttributeGroup * ReadAttributeGroup(te::xml::Reader &reader)
TEXSDEXPORT Include * ReadInclude(te::xml::Reader &reader)
It models an XML Schema complexContent element.
This class models a XML reader object.
Definition: Reader.h:55
TEXSDEXPORT Extension * ReadExtension(te::xml::Reader &reader)
void ReadOccurs(Occurs *occurs, te::xml::Reader &reader)
This class models an XML Schema all element.
Definition: All.h:54
A base class for XSD classes that may allow annotation.
Definition: Annotated.h:49
TEXSDEXPORT AnyAttribute * ReadAnyAttribute(te::xml::Reader &reader)
A base class for XSD classes that have occurs attributes.
Definition: Occurs.h:43
TEXSDEXPORT Unique * ReadUnique(te::xml::Reader &reader)
The restriction class can be used to define restrictions on a complexContent.
TEXSDEXPORT ComplexContent * ReadComplexContent(te::xml::Reader &reader)
A class that models a XML schema (XSD).
Definition: Schema.h:63
TEXSDEXPORT Group * ReadGroup(te::xml::Reader &reader)
TEXSDEXPORT Sequence * ReadSequence(te::xml::Reader &reader)
It models a XML Schema import.
Definition: Import.h:47
TEXSDEXPORT List * ReadList(te::xml::Reader &reader)
This class models the element of a XML Schema.
Definition: Element.h:56
TEXSDEXPORT Any * ReadAny(te::xml::Reader &reader)
It models a XML Schema include.
Definition: Include.h:46
This class models a sequence element in a XML Schema.
Definition: Sequence.h:58
TEXSDEXPORT Field * ReadField(te::xml::Reader &reader)
TEXSDEXPORT SimpleType * ReadSimpleType(te::xml::Reader &reader)
This class models a XML writer object.
TEXSDEXPORT Restriction4SimpleContent * ReadRestriction4SimpleContent(te::xml::Reader &reader)
It models the unique element in an XML Schema.
Definition: Unique.h:43
It models the XML Schema any element.
Definition: Any.h:49
It models a XML Schema redefine.
Definition: Redefine.h:52
It is used to define a simple type element as a list of values.
Definition: List.h:45
TEXSDEXPORT Restriction4ComplexContent * ReadRestriction4ComplexContent(te::xml::Reader &reader)
TEXSDEXPORT Schema * ReadSchema(const std::string &path)
This class models a key element from an XML Schema.
Definition: Key.h:43
It models an XML anyAttribute element.
Definition: AnyAttribute.h:49
This restriction class defines restrictions on a simpleContent.
TEXSDEXPORT Redefine * ReadRedefine(te::xml::Reader &reader)
It models a XML Schema Complex Type definition.
Definition: ComplexType.h:56
void ReadIdentifiable(Identifiable *identifiable, te::xml::Reader &reader)
A base class for XSD classes that must provide a unique ID property.
Definition: Identifiable.h:46
This class models the XML Schema choice element.
Definition: Choice.h:57
It models a XML Schema attribute.
Definition: Attribute.h:61
QName * CreateQName(const std::string &name)
It models the field element of an XML Schema.
Definition: Field.h:47
TEXSDEXPORT Selector * ReadSelector(te::xml::Reader &reader)
void ReadAnnotated(Annotated *annotated, te::xml::Reader &reader)
TEXSDEXPORT Key * ReadKey(te::xml::Reader &reader)
It models the selector element of an XML Schema.
Definition: Selector.h:44
TEXSDEXPORT Import * ReadImport(te::xml::Reader &reader)
#define TEXSDEXPORT
You can use this macro in order to export/import classes and functions from this module.
Definition: Config.h:60
TEXSDEXPORT Attribute * ReadAttribute(te::xml::Reader &reader)
TEXSDEXPORT All * ReadAll(te::xml::Reader &reader)
This class models an extension element that can be used to extend an existing simpleType or complexTy...
Definition: Extension.h:52
TEXSDEXPORT Choice * ReadChoice(te::xml::Reader &reader)
A class to be used to represent XML qualified names.
Definition: QName.h:49
This class models a keyref element from a XML Schema element.
Definition: KeyRef.h:46
A class that models an XML Schema simpleContent element.
Definition: SimpleContent.h:50
It defines a simple type as a collection (union) of values from specified simple data types...
Definition: Union.h:50
FacetType
It enumerates the available facet types.
Definition: Enums.h:91
The restriction element defines restrictions on a simpleType definition.
TEXSDEXPORT SimpleContent * ReadSimpleContent(te::xml::Reader &reader)
TEXSDEXPORT ComplexType * ReadComplexType(te::xml::Reader &reader)
TEXSDEXPORT Union * ReadUnion(te::xml::Reader &reader)
A class that models a XSD annotation element.
Definition: Annotation.h:55
TEXSDEXPORT Restriction4SimpleType * ReadRestriction4SimpleType(te::xml::Reader &reader)
It models a XML Schema SimpleType element.
Definition: SimpleType.h:54
TEXSDEXPORT KeyRef * ReadKeyRef(te::xml::Reader &reader)
FacetType GetFacetType(const std::string &name)
This class models a group element in a XML Schema.
Definition: Group.h:52
TEXSDEXPORT Annotation * ReadAnnotation(te::xml::Reader &reader)