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 #include "schemaparser/Annotation.h"
00031
00032 namespace Schema {
00033 class WSDLPULL_EXPORT Constraint
00034 {
00035 public:
00036 Constraint(Schema::ConstraintType c);
00037
00038 std::string getName()const;
00039 void setName(const std::string & n);
00040 virtual Schema::ConstraintType getConstraintType();
00041 void setSelector(const std::string & xpath);
00042 void addField(const std::string &xpath);
00043 std::string selector()const;
00044 const std::list<std::string>& fields();
00045 virtual ~Constraint();
00046 void setAnnotation(const std::string & s);
00047
00048 private:
00049 Schema::ConstraintType m_constraints;
00050 std::string m_name,m_annotation;
00051 std::string m_selector;
00052 std::list<std::string> m_fields;
00053 };
00054
00055 inline
00056 Constraint::Constraint(Schema::ConstraintType c)
00057 :m_constraints(c)
00058 {
00059 m_fields.clear();
00060 }
00061
00062 inline
00063 void
00064 Constraint::setSelector(const std::string & xpath)
00065 {
00066 m_selector=xpath;
00067 }
00068
00069 inline
00070 std::string
00071 Constraint::selector()const
00072 {
00073 return m_selector;
00074 }
00075
00076 inline
00077 const std::list<std::string>&
00078 Constraint::fields()
00079 {
00080 return m_fields;
00081 }
00082
00083 inline
00084 void
00085 Constraint::addField(const std::string & xpath)
00086 {
00087 m_fields.push_back(xpath);
00088 }
00089
00090 inline
00091 std::string
00092 Constraint::getName()const
00093 {
00094 return m_name;
00095 }
00096
00097 inline
00098 void
00099 Constraint::setName(const std::string &n)
00100 {
00101 m_name=n;
00102 }
00103
00104 inline
00105 void
00106 Constraint::setAnnotation(const std::string &s)
00107 {
00108 m_annotation=s;
00109 }
00110
00111 inline
00112 Constraint::~Constraint()
00113 {
00114 }
00115
00116 inline
00117 Schema::ConstraintType
00118 Constraint::getConstraintType()
00119 {
00120 return Schema::NoConstraint;
00121 }
00122
00123 }
00124 #endif // GROUP_H