00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef CONSTRAINT_H
00022 #define CONSTRAINT_H
00023
00024
00025
00026 #include <string>
00027 #include <list>
00028 #include "xmlpull/wsdlpull_export.h"
00029 #include "schemaparser/Schema.h"
00030
00031 namespace Schema {
00032 class WSDLPULL_EXPORT Constraint
00033 {
00034 public:
00035 Constraint(Schema::Constraints c);
00036
00037 std::string getName()const;
00038 void setName(const std::string & n);
00039 Schema::Constraints * getConstraintType();
00040 void setSelector(const std::string & xpath);
00041 void addField(const std::string &xpath);
00042 std::string selector()const;
00043 const std::list<std::string>& fields();
00044
00045 void setAnnotation(const std::string & s);
00046
00047 private:
00048 Schema::Constraints m_constraints;
00049 std::string m_name,m_annotation;
00050 std::string m_selector;
00051 std::list<std::string> m_fields;
00052 };
00053
00054 inline
00055 Constraint::Constraint(Schema::Constraints c)
00056 :m_constraints(c)
00057 {
00058 m_fields.clear();
00059 }
00060
00061 inline
00062 void
00063 Constraint::setSelector(const std::string & xpath)
00064 {
00065 m_selector=xpath;
00066 }
00067
00068 inline
00069 std::string
00070 Constraint::selector()const
00071 {
00072 return m_selector;
00073 }
00074
00075 inline
00076 const std::list<std::string>&
00077 Constraint::fields()
00078 {
00079 return m_fields;
00080 }
00081
00082 inline
00083 void
00084 Constraint::addField(const std::string & xpath)
00085 {
00086 m_fields.push_back(xpath);
00087 }
00088
00089 inline
00090 std::string
00091 Constraint::getName()const
00092 {
00093 return m_name;
00094 }
00095
00096 inline
00097 void
00098 Constraint::setName(const std::string &n)
00099 {
00100 m_name=n;
00101 }
00102
00103 inline
00104 void
00105 Constraint::setAnnotation(const std::string &s)
00106 {
00107 m_annotation=s;
00108 }
00109 }
00110 #endif // GROUP_H