wsdlpull  1.23
WsdlExtension.h
Go to the documentation of this file.
1 /*
2  * wsdlpull - A C++ parser for WSDL (Web services description language)
3  * Copyright (C) 2005-2007 Vivek Krishna
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library 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 GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public
16  * License along with this library; if not, write to the Free
17  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18  *
19  *
20  */
21 
22 #ifndef _WSDLEXTENSIONH
23 #define _WSDLEXTENSIONH
24 
25 #include "xmlpull/XmlPullParser.h"
28 
29 using namespace Schema;
30 
31 #if (defined _WIN32) && !(defined SCHEMADIR)
32 #define SCHEMADIR "src/schemas/"
33 #endif
34 
35 
36 namespace WsdlPull {
37 
38 class WsdlParser;
39 
40 //This class is the generic interface that all extensibility namespaces must derive from
42 {
43  public:
45  virtual ~WsdlExtension(){};
46  virtual std::string getNamespace()const = 0;
47 
48  //returns the namespace Uri of the wsdl extensibility elements that it can handle.
49  virtual void setNamespacePrefix(std::string) = 0;
50  virtual std::string getNamespacePrefix()const = 0;
51 
52  //does this extensibility handler handle the given namespace
53  virtual bool isNamespaceHandler(const std::string &)const = 0;
54  virtual std::string getExtensibilitySchema()const = 0;
55  virtual void setSchemaParser(SchemaParser * spe) = 0;
56  virtual void setSchemaPath(const std::string & /* schemaPath */){};
57 
58  // parent is the Wsdl parent element type under which the extensibility element has come
59  // the id returned must be non zero if the extensibility handler has handled the element correctly
60  virtual int handleElement(int parent, XmlPullParser *) = 0;
61 
62  //attName is the extensibility attribute
63  // the id returned must be non zero if the extensibility handler has handled the attribute correctly
64  virtual int handleAttribute(int parent, std::string attName,
65  XmlPullParser *) = 0;
66 
67  //returns a valid extensibilty element
68  //must return a non zero integer if the element was present in the wsdl
69  virtual int getElementName(int id)const = 0;
70 
71  //returns a valid extensibility attribute
72  //must return a non zero integer if the attribute was present in the wsdl
73  virtual int getAttributeName(int id)const = 0;
74 
75  //this is the start of all ids that must be used for elems/attributes in this namespace
76  virtual void setStartId(int) = 0;
77  virtual int getStartId() const= 0;
78  virtual void setWsdlParser(WsdlParser *){};
79  virtual WsdlParser * wsdlParser()const { return 0;} ;
80 
81  //this method returns true if the Wsdl file had extensibility elements parsed by this extensibility handler
82  virtual bool wasUsed()const = 0;
83 };
84 }
85 #endif /* */
virtual void setSchemaPath(const std::string &)
Definition: WsdlExtension.h:56
virtual bool isNamespaceHandler(const std::string &) const =0
virtual int handleAttribute(int parent, std::string attName, XmlPullParser *)=0
virtual void setWsdlParser(WsdlParser *)
Definition: WsdlExtension.h:78
virtual std::string getExtensibilitySchema() const =0
virtual void setSchemaParser(SchemaParser *spe)=0
virtual void setStartId(int)=0
virtual int getElementName(int id) const =0
virtual std::string getNamespace() const =0
virtual int getStartId() const =0
virtual int getAttributeName(int id) const =0
virtual int handleElement(int parent, XmlPullParser *)=0
virtual void setNamespacePrefix(std::string)=0
virtual std::string getNamespacePrefix() const =0
virtual bool wasUsed() const =0
virtual WsdlParser * wsdlParser() const
Definition: WsdlExtension.h:79
#define WSDLPULL_EXPORT