Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

XMLPropertyTypeSAXHandler.h

Go to the documentation of this file.
00001 
00035 #ifndef _AMIRE_PERSISTENCE_XML_PROPERTY_TYPE_SAX_HANDLER_H
00036 #define _AMIRE_PERSISTENCE_XML_PROPERTY_TYPE_SAX_HANDLER_H
00037 
00038 #include <amire/property/Property.h>
00039 #include <amire/property/PropertyType.h>
00040 #include <amire/component/ComponentManager.h>
00041 #include <xercesc/sax2/DefaultHandler.hpp>
00042 #include <amire/persistence/XMLPropertyTypeDictionary.h>
00043 #include <amire/persistence/XMLSpecializedSAXHandler.h>
00044 #include <stack>
00045  
00046 namespace amire {
00047   namespace persistence {
00048     
00049     class VectorPlaceHolderType : public amire::property::PropertyType {
00050       private: 
00051         amire::property::PropertyType* type;
00052       public:
00053         VectorPlaceHolderType(amire::property::PropertyType::Kind kind, 
00054                               amire::property::PropertyTypeManager *propertyTypeManager, std::string aName = "VectorPlaceHolder"): PropertyType(aName,kind,propertyTypeManager) {
00055             type = NULL;                  
00056         };        
00057         void setType(amire::property::PropertyType* aType) { type = aType;
00058         };
00059         amire::property::PropertyType* getType() { return type;
00060         };       
00061     };
00062     class ExistingStructPlaceHolderType : public amire::property::PropertyType {
00063       private: 
00064         std::string name;     
00065       public:
00066         ExistingStructPlaceHolderType(std::string aName,amire::property::PropertyType::Kind kind, 
00067                                       amire::property::PropertyTypeManager *propertyTypeManager):name(aName), PropertyType(aName, kind,propertyTypeManager) {
00068         };                
00069         const std::string getName() {
00070           return name;
00071         }
00072     };
00073     
00074     class AMIRE_EXPORT_API XMLPropertyTypeSAXHandler : public XMLSpecializedSAXHandler, public XMLPropertyTypeDictionary {
00075       private:                
00076         std::stack<amire::property::PropertyType*> propertyTypeStack;
00077         std::stack<std::string> fieldStack;
00078     
00079         const amire::property::PropertyType *stringPropertyType;
00080         const amire::property::PropertyType *booleanPropertyType;
00081         const amire::property::PropertyType *charPropertyType;
00082         const amire::property::PropertyType *integerPropertyType;
00083         const amire::property::PropertyType *doublePropertyType;
00084         const amire::property::PropertyType *floatPropertyType;      
00085            
00086       public:   
00087         
00088         XMLPropertyTypeSAXHandler(amire::component::ComponentManager * aComponentManager);
00089         XMLPropertyTypeSAXHandler(const amire::persistence::XMLPropertyTypeSAXHandler& handler);             
00090         virtual ~XMLPropertyTypeSAXHandler();
00091         
00092         virtual void startElement (    
00093           const   XMLCh* const    uri,
00094           const   XMLCh* const    localname,
00095           const   XMLCh* const    qname,
00096           const   Attributes&     attrs    
00097         );    
00098         virtual void endElement(
00099                       const XMLCh* const uri,
00100                       const XMLCh* const localname,
00101                       const XMLCh* const qname
00102               );                          
00103     };
00104   }
00105 }
00106 #endif

Generated on Tue May 20 17:23:54 2003 for AMIRE-Framework by doxygen1.3