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 #include "xmlpull/wsdlpull_export.h" 00028 00029 using namespace Schema; 00030 00031 #if (defined _WIN32) && !(defined SCHEMADIR) 00032 #define SCHEMADIR "src/schemas/" 00033 #endif 00034 00035 00036 namespace WsdlPull { 00037 00038 class WsdlParser; 00039 00040 //This class is the generic interface that all extensibility namespaces must derive from 00041 class WSDLPULL_EXPORT WsdlExtension 00042 { 00043 public: 00044 WsdlExtension(){}; 00045 virtual ~WsdlExtension(){}; 00046 virtual std::string getNamespace()const = 0; 00047 00048 //returns the namespace Uri of the wsdl extensibility elements that it can handle. 00049 virtual void setNamespacePrefix(std::string) = 0; 00050 virtual std::string getNamespacePrefix()const = 0; 00051 00052 //does this extensibility handler handle the given namespace 00053 virtual bool isNamespaceHandler(const std::string &)const = 0; 00054 virtual std::string getExtensibilitySchema()const = 0; 00055 virtual void setSchemaParser(SchemaParser * spe) = 0; 00056 virtual void setSchemaPath(const std::string & /* schemaPath */){}; 00057 00058 // parent is the Wsdl parent element type under which the extensibility element has come 00059 // the id returned must be non zero if the extensibility handler has handled the element correctly 00060 virtual int handleElement(int parent, XmlPullParser *) = 0; 00061 00062 //attName is the extensibility attribute 00063 // the id returned must be non zero if the extensibility handler has handled the attribute correctly 00064 virtual int handleAttribute(int parent, std::string attName, 00065 XmlPullParser *) = 0; 00066 00067 //returns a valid extensibilty element 00068 //must return a non zero integer if the element was present in the wsdl 00069 virtual int getElementName(int id)const = 0; 00070 00071 //returns a valid extensibility attribute 00072 //must return a non zero integer if the attribute was present in the wsdl 00073 virtual int getAttributeName(int id)const = 0; 00074 00075 //this is the start of all ids that must be used for elems/attributes in this namespace 00076 virtual void setStartId(int) = 0; 00077 virtual int getStartId() const= 0; 00078 virtual void setWsdlParser(WsdlParser *){}; 00079 virtual WsdlParser * wsdlParser()const { return 0;} ; 00080 00081 //this method returns true if the Wsdl file had extensibility elements parsed by this extensibility handler 00082 virtual bool wasUsed()const = 0; 00083 }; 00084 } 00085 #endif /* */