Main Page | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members

WsdlExtension.h

Go to the documentation of this file.
00001 /* 
00002  * wsdlpull - A C++ parser  for WSDL  (Web services description language)
00003  * Copyright (C) 2005-2007 Vivek Krishna
00004  *
00005  * This library is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU Library General Public
00007  * License as published by the Free Software Foundation; either
00008  * version 2 of the License, or (at your option) any later version.
00009  *
00010  * This library is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * Library General Public License for more details.
00014  *
00015  * You should have received a copy of the GNU Library General Public
00016  * License along with this library; if not, write to the Free
00017  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00018  *
00019  *
00020  */
00021 
00022 #ifndef _WSDLEXTENSIONH
00023 #define _WSDLEXTENSIONH
00024 
00025 #include "xmlpull/XmlPullParser.h"
00026 #include "schemaparser/SchemaParser.h"
00027 using namespace Schema;
00028 
00029 #if (defined _WIN32) && !(defined SCHEMADIR)
00030 #define SCHEMADIR "src/schemas/"
00031 #endif
00032 
00033 
00034 #ifndef WSDLPULL_EXPORT
00035 #if (defined _MSC_VER) && (defined _MT)
00036 #define WSDLPULL_EXPORT __declspec (dllimport)
00037 #else
00038 #define WSDLPULL_EXPORT 
00039 #endif
00040 #endif
00041 
00042 namespace WsdlPull {
00043 
00044 class WsdlParser;
00045 
00046 //This class is the generic interface that all extensibility namespaces must derive from
00047 class WSDLPULL_EXPORT WsdlExtension
00048 {
00049  public:
00050   WsdlExtension(){};
00051   virtual ~WsdlExtension(){};
00052   virtual std::string getNamespace()const = 0;
00053   
00054   //returns the namespace Uri of the wsdl extensibility elements that it can handle.
00055   virtual void setNamespacePrefix(std::string) = 0;
00056   virtual std::string getNamespacePrefix()const = 0;
00057 
00058   //does this extensibility handler handle the given namespace
00059   virtual bool isNamespaceHandler(const std::string &)const = 0;
00060   virtual std::string getExtensibilitySchema()const = 0;
00061   virtual void setSchemaParser(SchemaParser * spe) = 0;
00062 
00063   // parent is the Wsdl parent element type under which the extensibility element has come
00064   // the id returned must be non zero if the extensibility handler has handled the element correctly
00065   virtual int handleElement(int parent, XmlPullParser *) = 0;
00066 
00067   //attName is the extensibility attribute
00068   // the id returned must be non zero if the extensibility handler has handled the attribute correctly
00069   virtual int handleAttribute(int parent, std::string attName,
00070                               XmlPullParser *) = 0;
00071 
00072   //returns a valid extensibilty element
00073   //must return a non zero integer if the element was present in the wsdl
00074   virtual int getElementName(int id)const = 0;
00075 
00076   //returns a valid extensibility attribute
00077   //must return a non zero integer if the attribute was present in the wsdl
00078   virtual int getAttributeName(int id)const = 0;
00079 
00080   //this is the start of all ids that must be used for elems/attributes in this namespace
00081   virtual void setStartId(int) = 0;
00082   virtual int getStartId() const= 0;
00083   virtual void setWsdlParser(WsdlParser *){};
00084 
00085   //this method returns true if the Wsdl file had extensibility elements parsed by this extensibility handler
00086   virtual bool wasUsed()const = 0;
00087 };
00088 }
00089 #endif                                            /*  */

Generated on Mon Feb 6 23:02:42 2006 for wsdlpull by  doxygen 1.3.9.1