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

SchemaParser Class Reference

#include <SchemaParser.h>

Collaboration diagram for SchemaParser:

Collaboration graph
[legend]
List of all members.

Public Member Functions

Constructors and Destructors
 SchemaParser (const string &Uri, string tns="", ostream &log=cout)
 SchemaParser (XmlPullParser *parser, string tns="", ostream &log=cout)
 ~SchemaParser ()
methods used for parsing
bool parseSchemaTag ()
Various Getter methods
const XSDTypegetType (const Qname &type)
const XSDTypegetType (int id) const
list< const XSDType * > * getAllTypes () const
const ElementgetElement (const Qname &element) const
const list< ElementgetElements () const
int getNumElements () const
AttributegetAttribute (const Qname &attribute)
const list< AttributegetAttributes () const
int getNumAttributes () const
string getNamespace (void) const
int getNumTypes () const
int getTypeId (const Qname &, bool create=false)
bool isBasicType (int sType) const
int getBasicContentType (int typeId) const
GroupgetGroup (const Qname &name)
AttributeGroupgetAttributeGroup (const Qname &name)
Methods for handling Imports
bool addImports (const std::vector< SchemaParser * > &schemaParsers)
bool addImport (string ns, string location="")
bool addImport (SchemaParser *sp)
Miscellaneous Methods
bool finalize (void)
void setWarningLevel (unsigned char l)

Constructor & Destructor Documentation

SchemaParser::SchemaParser const string &  Uri,
string  tns = "",
ostream &  log = cout
 

The constructor for SchemaParser

Parameters:
the URI schema definition file.
target namespace
output stream for any error outputs

SchemaParser::SchemaParser XmlPullParser parser,
string  tns = "",
ostream &  log = cout
 

The constructor for SchemaParser

Parameters:
XmlPullParser instance for the schema definition file.
target namespace
output stream for any error outputs

SchemaParser::~SchemaParser  ) 
 


Member Function Documentation

bool SchemaParser::parseSchemaTag  ) 
 

parseSchemaTag

Returns:
true if parsing was successful ,false otherwise

const XSDType * SchemaParser::getType const Qname type  ) 
 

getType

Parameters:
Qname refering to the type
Returns:
pointer to the type

const XSDType * SchemaParser::getType int  id  )  const
 

Parameters:
the types unique id
Returns:
pointer to the type

list< const XSDType * > * SchemaParser::getAllTypes  )  const
 

Returns:
a list of all types defined in the schema including anonymous types caller *MUST* free the list but not the list members

const Element * SchemaParser::getElement const Qname element  )  const
 

Parameters:
Qname of the element
Returns:
pointer to a globally defined element in the schema

const list< Element > SchemaParser::getElements  )  const [inline]
 

returns the list of all the global elements in the schema

Parameters:
void 
Returns:
list<Element>

int SchemaParser::getNumElements  )  const
 

Returns:
number of globally defined elements in the schema

Attribute * SchemaParser::getAttribute const Qname attribute  ) 
 

getAttribute

Parameters:
Qname of the attribute
Returns:
pointer to a globally defined attribute in the schema

const list< Attribute > SchemaParser::getAttributes  )  const [inline]
 

returns a list of global attributes in the schema

Parameters:
void 
Returns:
list<Attribute>

int SchemaParser::getNumAttributes  )  const
 

Returns:
number of globally defined attributes in the schema

string SchemaParser::getNamespace void   )  const
 

Returns:
target namespace of the wsdl document

int SchemaParser::getNumTypes  )  const
 

Returns:
number of types defined in the schema (includes anonymous types)

int SchemaParser::getTypeId const Qname ,
bool  create = false
 

getTypeId :Search for a type ,if not present create one

Parameters:
Qname of the type
bool:create 
Returns:
type id

bool SchemaParser::isBasicType int  sType  )  const
 

isBasicType

Parameters:
unique type identifier
Returns:
true if its a basic schema type false otherwise

int SchemaParser::getBasicContentType int  typeId  )  const
 

getBasicContentType

If the type has a simple content model then this method returns the basic schema type which defines its contents For example calling on a type like below would return Schema::STRING

<xsd:complexType> <xsd:simpleContent> <xsd:extension base = "xsd:string"> <xsd:attribute name = "lang" type = "xsd:string"/> </xsd:extension> </xsd:simpleContent> </xsd:complexType>

Parameters:
unique type identifier
Returns:
type id of the basic type from which this type is derived or if the typeId is one of the atomic types,the same value is returned If the typeId is a complex type Schema::INVALID is returned

Group * SchemaParser::getGroup const Qname name  ) 
 

getGroup

Parameters:
unique type identifier
Returns:
Group*

AttributeGroup * SchemaParser::getAttributeGroup const Qname name  ) 
 

getAttributeGroup

Parameters:
unique type identifier
Returns:
AttributeGroup*

bool SchemaParser::addImports const std::vector< SchemaParser * > &  schemaParsers  ) 
 

addImports .To add an array of schema parsers for imported schemas

Parameters:
array of schema parsers
number of schema parsers added

bool SchemaParser::addImport string  ns,
string  location = ""
 

addImport .Instructs the schema parser to import a namespace

Parameters:
namespace of the schema
(optional)schemaLocation .If this is not passed ,schema file is not processed but any refernces to the namespace are not flagged as errors
Returns:
true if the schema was succesfully imported.If location is not passed always returns true

bool SchemaParser::addImport SchemaParser sp  ) 
 

addImport . imports the namespace of the schemaparser

Parameters:
SchemaParser instance which has parsed the namespace
Returns:
true if the schema was succesfully imported .

bool SchemaParser::finalize void   ) 
 

finalize : tries to match unresolved types and references with imported schemas you *must* call this to ensure successful type resolution

Returns:
true if all type references are resolved ,false otherwise

void SchemaParser::setWarningLevel unsigned char  l  )  [inline]
 

setWarningLevel default is 0 . 1 is wanrning level 2 is information level //quite verbose


The documentation for this class was generated from the following files:
Generated on Sun Oct 16 10:11:52 2005 for wsdlpull by  doxygen 1.3.9.1