Reordered files in all libs - now all includes are in "libname/include" dir - logical, isn't it? This should break compilation however.

This commit is contained in:
pelya
2010-10-26 14:43:54 +03:00
parent fc58bc53c0
commit 6b9b163689
520 changed files with 41 additions and 43205 deletions

View File

@@ -0,0 +1,179 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: PSVIAttribute.hpp 527149 2007-04-10 14:56:39Z amassari $
*/
#if !defined(XERCESC_INCLUDE_GUARD_PSVIATTRIBUTE_HPP)
#define XERCESC_INCLUDE_GUARD_PSVIATTRIBUTE_HPP
#include <xercesc/framework/psvi/PSVIItem.hpp>
#include <xercesc/framework/psvi/XSSimpleTypeDefinition.hpp>
#include <xercesc/validators/datatype/DatatypeValidator.hpp>
XERCES_CPP_NAMESPACE_BEGIN
/**
* Represent the PSVI contributions for one attribute information item.
* This is *always* owned by the scanner/parser object from which
* it is obtained. The validator will specify
* under what conditions it may be relied upon to have meaningful contents.
*/
// forward declarations
class XSAttributeDeclaration;
class XMLPARSER_EXPORT PSVIAttribute : public PSVIItem
{
public:
// Constructors and Destructor
// -----------------------------------------------------------------------
/** @name Constructors */
//@{
/**
* The default constructor
*
* @param manager The configurable memory manager
*/
PSVIAttribute( MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
//@};
/** @name Destructor */
//@{
~PSVIAttribute();
//@}
//---------------------
/** @name PSVIAttribute methods */
//@{
/**
* An item isomorphic to the attribute declaration used to validate
* this attribute.
*
* @return an attribute declaration
*/
XSAttributeDeclaration *getAttributeDeclaration();
/**
* An item isomorphic to the type definition used to validate this element.
*
* @return a type declaration
*/
XSTypeDefinition *getTypeDefinition();
/**
* If and only if that type definition is a simple type definition
* with {variety} union, or a complex type definition whose {content type}
* is a simple thype definition with {variety} union, then an item isomorphic
* to that member of the union's {member type definitions} which actually
* validated the element item's normalized value.
*
* @return a simple type declaration
*/
XSSimpleTypeDefinition *getMemberTypeDefinition();
//@}
//----------------------------------
/** methods needed by implementation */
//@{
/**
* reset this object. Intended to be called by
* the implementation.
*/
void reset(
const XMLCh * const valContext
, PSVIItem::VALIDITY_STATE state
, PSVIItem::ASSESSMENT_TYPE assessmentType
, XSSimpleTypeDefinition * validatingType
, XSSimpleTypeDefinition * memberType
, const XMLCh * const defaultValue
, const bool isSpecified
, XSAttributeDeclaration * attrDecl
, DatatypeValidator * dv
);
/**
* set the schema normalized value (and
* implicitly the canonical value) of this object; intended to be used
* by the implementation.
*/
void setValue(const XMLCh * const normalizedValue);
/**
* set VALIDITY_STATE to specified value; intended to be
* called by implementation.
*/
void updateValidity(VALIDITY_STATE newValue);
//@}
private:
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
PSVIAttribute(const PSVIAttribute&);
PSVIAttribute & operator=(const PSVIAttribute &);
// -----------------------------------------------------------------------
// data members
// -----------------------------------------------------------------------
// fAttributeDecl
// attribute declaration component that validated this attribute
// fDV
// implementation-specific datatype validator used to validate this attribute
XSAttributeDeclaration * fAttributeDecl;
DatatypeValidator * fDV;
};
inline PSVIAttribute::~PSVIAttribute()
{
fMemoryManager->deallocate((void *)fCanonicalValue);
}
inline XSAttributeDeclaration *PSVIAttribute::getAttributeDeclaration()
{
return fAttributeDecl;
}
inline XSTypeDefinition* PSVIAttribute::getTypeDefinition()
{
return fType;
}
inline XSSimpleTypeDefinition* PSVIAttribute::getMemberTypeDefinition()
{
return fMemberType;
}
inline void PSVIAttribute::updateValidity(VALIDITY_STATE newValue)
{
fValidityState = newValue;
}
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,215 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: PSVIAttributeList.hpp 932887 2010-04-11 13:04:59Z borisk $
*/
#if !defined(XERCESC_INCLUDE_GUARD_PSVIATTRIBUTE_LIST_HPP)
#define XERCESC_INCLUDE_GUARD_PSVIATTRIBUTE_LIST_HPP
#include <xercesc/util/PlatformUtils.hpp>
#include <xercesc/framework/psvi/PSVIAttribute.hpp>
#include <xercesc/util/RefVectorOf.hpp>
XERCES_CPP_NAMESPACE_BEGIN
/**
* A container for the PSVI contributions to attributes that occur
* on a particular element.
* This is always owned by the parser/validator from
* which it is obtained. The parser/validator will specify
* under what conditions it may be relied upon to have meaningful contents.
*/
class XMLPARSER_EXPORT PSVIAttributeStorage : public XMemory
{
public:
PSVIAttributeStorage() :
fPSVIAttribute(0)
, fAttributeName(0)
, fAttributeNamespace(0)
{
}
~PSVIAttributeStorage()
{
delete fPSVIAttribute;
}
PSVIAttribute* fPSVIAttribute;
const XMLCh* fAttributeName;
const XMLCh* fAttributeNamespace;
};
class XMLPARSER_EXPORT PSVIAttributeList : public XMemory
{
public:
// Constructors and Destructor
// -----------------------------------------------------------------------
/** @name Constructors */
//@{
/**
* The default constructor
*
* @param manager The configurable memory manager
*/
PSVIAttributeList( MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
//@};
/** @name Destructor */
//@{
~PSVIAttributeList();
//@}
//---------------------
/** @name PSVIAttributeList methods */
//@{
/*
* Get the number of attributes whose PSVI contributions
* are contained in this list.
*/
XMLSize_t getLength() const;
/*
* Get the PSVI contribution of attribute at position i
* in this list. Indices start from 0.
* @param index index from which the attribute PSVI contribution
* is to come.
* @return PSVIAttribute containing the attributes PSVI contributions;
* null is returned if the index is out of range.
*/
PSVIAttribute *getAttributePSVIAtIndex(const XMLSize_t index);
/*
* Get local part of attribute name at position index in the list.
* Indices start from 0.
* @param index index from which the attribute name
* is to come.
* @return local part of the attribute's name; null is returned if the index
* is out of range.
*/
const XMLCh *getAttributeNameAtIndex(const XMLSize_t index);
/*
* Get namespace of attribute at position index in the list.
* Indices start from 0.
* @param index index from which the attribute namespace
* is to come.
* @return namespace of the attribute;
* null is returned if the index is out of range.
*/
const XMLCh *getAttributeNamespaceAtIndex(const XMLSize_t index);
/*
* Get the PSVI contribution of attribute with given
* local name and namespace.
* @param attrName local part of the attribute's name
* @param attrNamespace namespace of the attribute
* @return null if the attribute PSVI does not exist
*/
PSVIAttribute *getAttributePSVIByName(const XMLCh *attrName
, const XMLCh * attrNamespace);
//@}
//----------------------------------
/** methods needed by implementation */
//@{
/**
* returns a PSVI attribute of undetermined state and given name/namespace and
* makes that object part of the internal list. Intended to be called
* during validation of an element.
* @param attrName name of this attribute
* @param attrNS URI of the attribute
* @return new, uninitialized, PSVIAttribute object
*/
PSVIAttribute *getPSVIAttributeToFill(
const XMLCh * attrName
, const XMLCh * attrNS);
/**
* reset the list
*/
void reset();
//@}
private:
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
PSVIAttributeList(const PSVIAttributeList&);
PSVIAttributeList & operator=(const PSVIAttributeList &);
// -----------------------------------------------------------------------
// data members
// -----------------------------------------------------------------------
// fMemoryManager
// handler to provide dynamically-need memory
// fAttrList
// list of PSVIAttributes contained by this object
// fAttrPos
// current number of initialized PSVIAttributes in fAttrList
MemoryManager* fMemoryManager;
RefVectorOf<PSVIAttributeStorage>* fAttrList;
XMLSize_t fAttrPos;
};
inline PSVIAttributeList::~PSVIAttributeList()
{
delete fAttrList;
}
inline PSVIAttribute *PSVIAttributeList::getPSVIAttributeToFill(
const XMLCh *attrName
, const XMLCh * attrNS)
{
PSVIAttributeStorage* storage = 0;
if(fAttrPos == fAttrList->size())
{
storage = new (fMemoryManager) PSVIAttributeStorage();
storage->fPSVIAttribute = new (fMemoryManager) PSVIAttribute(fMemoryManager);
fAttrList->addElement(storage);
}
else
{
storage = fAttrList->elementAt(fAttrPos);
}
storage->fAttributeName = attrName;
storage->fAttributeNamespace = attrNS;
fAttrPos++;
return storage->fPSVIAttribute;
}
inline void PSVIAttributeList::reset()
{
fAttrPos = 0;
}
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,174 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: PSVIElement.hpp 527149 2007-04-10 14:56:39Z amassari $
*/
#if !defined(XERCESC_INCLUDE_GUARD_PSVIELEMENT_HPP)
#define XERCESC_INCLUDE_GUARD_PSVIELEMENT_HPP
#include <xercesc/framework/psvi/PSVIItem.hpp>
XERCES_CPP_NAMESPACE_BEGIN
/**
* Represent the PSVI contributions for one element information item.
* This is *always* owned by the scanner/parser object from which
* it is obtained. The validator will specify
* under what conditions it may be relied upon to have meaningful contents.
*/
// forward declarations
class XSElementDeclaration;
class XSNotationDeclaration;
class XSModel;
class XMLPARSER_EXPORT PSVIElement : public PSVIItem
{
public:
// Constructors and Destructor
// -----------------------------------------------------------------------
/** @name Constructors */
//@{
/**
* The default constructor
*
* @param manager The configurable memory manager
*/
PSVIElement( MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
//@};
/** @name Destructor */
//@{
~PSVIElement();
//@}
//---------------------
/** @name PSVIElement methods */
//@{
/**
* An item isomorphic to the element declaration used to validate
* this element.
*
* @return an element declaration
*/
XSElementDeclaration *getElementDeclaration();
/**
* [notation]
* @see <a href="http://www.w3.org/TR/xmlschema-1/#e-notation">XML Schema Part 1: Structures [notation]</a>
* @return The notation declaration.
*/
XSNotationDeclaration *getNotationDeclaration();
/**
* [schema information]
* @see <a href="http://www.w3.org/TR/xmlschema-1/#e-schema_information">XML Schema Part 1: Structures [schema information]</a>
* @return The schema information property if it's the validation root,
* null otherwise.
*/
XSModel *getSchemaInformation();
/**
* An item isomorphic to the type definition used to validate this element.
*
* @return a type declaration
*/
XSTypeDefinition *getTypeDefinition();
/**
* If and only if that type definition is a simple type definition
* with {variety} union, or a complex type definition whose {content type}
* is a simple type definition with {variety} union, then an item isomorphic
* to that member of the union's {member type definitions} which actually
* validated the element item's normalized value.
*
* @return a simple type declaration
*/
XSSimpleTypeDefinition *getMemberTypeDefinition();
//@}
//----------------------------------
/** methods needed by implementation */
//@{
void reset
(
const VALIDITY_STATE validityState
, const ASSESSMENT_TYPE assessmentType
, const XMLCh* const validationContext
, bool isSpecified
, XSElementDeclaration* const elemDecl
, XSTypeDefinition* const typeDef
, XSSimpleTypeDefinition* const memberType
, XSModel* const schemaInfo
, const XMLCh* const defaultValue
, const XMLCh* const normalizedValue = 0
, XMLCh* const canonicalValue = 0
, XSNotationDeclaration* const notationDecl = 0
);
//@}
private:
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
PSVIElement(const PSVIElement&);
PSVIElement & operator=(const PSVIElement &);
// -----------------------------------------------------------------------
// data members
// -----------------------------------------------------------------------
// fElementDecl
// element declaration component that validated this element
// fNotationDecl
// (optional) notation decl associated with this element
// fSchemaInfo
// Schema Information Item with which this validation episode is associated
XSElementDeclaration *fElementDecl;
XSNotationDeclaration *fNotationDecl;
XSModel *fSchemaInfo;
};
inline XSElementDeclaration *PSVIElement::getElementDeclaration()
{
return fElementDecl;
}
inline XSNotationDeclaration* PSVIElement::getNotationDeclaration()
{
return fNotationDecl;
}
inline XSModel* PSVIElement::getSchemaInformation()
{
return fSchemaInfo;
}
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,148 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: PSVIHandler.hpp 676796 2008-07-15 05:04:13Z dbertoni $
*/
#if !defined(XERCESC_INCLUDE_GUARD_PSVIHANDLER_HPP)
#define XERCESC_INCLUDE_GUARD_PSVIHANDLER_HPP
XERCES_CPP_NAMESPACE_BEGIN
class PSVIElement;
class PSVIAttributeList;
/**
* This abstract class provides the interface for the scanner to return
* PSVI information to the application.
*
*/
class XMLPARSER_EXPORT PSVIHandler
{
public:
// -----------------------------------------------------------------------
// Constructors are hidden, just the virtual destructor is exposed
// -----------------------------------------------------------------------
/** @name Destructor */
//@{
virtual ~PSVIHandler()
{
}
//@}
/** @name The PSVI handler interface */
//@{
/** Receive notification of the PSVI properties of an element.
* The scanner will issue this call after the XMLDocumentHandler
* endElement call. Since the scanner will issue the psviAttributes
* call immediately after reading the start tag of an element, all element
* content will be effectively bracketed by these two calls.
* @param localName The name of the element whose end tag was just
* parsed.
* @param uri The namespace to which the element is bound
* @param elementInfo Object containing the element's PSVI properties
*/
virtual void handleElementPSVI
(
const XMLCh* const localName
, const XMLCh* const uri
, PSVIElement * elementInfo
) = 0;
/**
* Receive notification of partial PSVI properties of an element.
* This callback is made right after the psviAttributes
* call for non-empty element.
*
* The PSVIElement passed in has all fields properly set and it
* can be safely accessed the same way as the one passed in handleElementPSVI.
* However, fields listed below always have default values.
*
* getValidity() PSVIItem::VALIDITY_NOTKNOWN
* getValidationAttemped() PSVIItem::VALIDATION_NONE
* getMemberTypeDefinition() 0
* getSchemaNormalizedValue() 0
* getCanonicalRepresentation() 0
* getNotationDeclaration() 0
*
*
* @param localName The name of the element upon which start tag
* these attributes were encountered.
* @param uri The namespace to which the element is bound
* @param elementInfo Object containing the element's partial PSVI properties
*/
virtual void handlePartialElementPSVI
(
const XMLCh* const localName
, const XMLCh* const uri
, PSVIElement * elementInfo
);
/**
* Enables PSVI information about attributes to be passed back to the
* application. This callback will be made on *all*
* elements; on elements with no attributes, the final parameter will
* be null.
* @param localName The name of the element upon which start tag
* these attributes were encountered.
* @param uri The namespace to which the element is bound
* @param psviAttributes Object containing the attributes' PSVI properties
* with information to identify them.
*/
virtual void handleAttributesPSVI
(
const XMLCh* const localName
, const XMLCh* const uri
, PSVIAttributeList * psviAttributes
) = 0;
//@}
protected :
// -----------------------------------------------------------------------
// Hidden Constructors
// -----------------------------------------------------------------------
PSVIHandler()
{
}
private:
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
PSVIHandler(const PSVIHandler&);
PSVIHandler& operator=(const PSVIHandler&);
};
inline void PSVIHandler::handlePartialElementPSVI(const XMLCh* const /*localName*/
, const XMLCh* const /*uri*/
, PSVIElement * /*elementInfo*/
)
{
}
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,309 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: PSVIItem.hpp 932887 2010-04-11 13:04:59Z borisk $
*/
#if !defined(XERCESC_INCLUDE_GUARD_PSVIITEM_HPP)
#define XERCESC_INCLUDE_GUARD_PSVIITEM_HPP
#include <xercesc/util/PlatformUtils.hpp>
XERCES_CPP_NAMESPACE_BEGIN
/**
* Represent the PSVI contributions for one element or one attribute information item.
* This is *always* owned by the validator /parser object from which
* it is obtained. It is designed to be subclassed; subclasses will
* specify under what conditions it may be relied upon to have meaningful contents.
*/
// forward declarations
class XSTypeDefinition;
class XSSimpleTypeDefinition;
class XSValue;
class XMLPARSER_EXPORT PSVIItem : public XMemory
{
public:
enum VALIDITY_STATE {
/** Validity value indicating that validation has either not
been performed or that a strict assessment of validity could
not be performed
*/
VALIDITY_NOTKNOWN = 0,
/** Validity value indicating that validation has been strictly
assessed and the element in question is invalid according to the
rules of schema validation.
*/
VALIDITY_INVALID = 1,
/** Validity value indicating that validation has been strictly
assessed and the element in question is valid according to the rules
of schema validation.
*/
VALIDITY_VALID = 2
};
enum ASSESSMENT_TYPE {
/** Validation status indicating that schema validation has been
performed and the element in question has specifically been skipped.
*/
VALIDATION_NONE = 0,
/** Validation status indicating that schema validation has been
performed on the element in question under the rules of lax validation.
*/
VALIDATION_PARTIAL = 1,
/** Validation status indicating that full schema validation has been
performed on the element. */
VALIDATION_FULL = 2
};
// Constructors and Destructor
// -----------------------------------------------------------------------
/** @name Constructors */
//@{
/**
* The default constructor
*
* @param manager The configurable memory manager
*/
PSVIItem(MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
//@};
/** @name Destructor */
//@{
virtual ~PSVIItem();
//@}
//---------------------
/** @name PSVIItem methods */
//@{
/**
* [validation context]
*
* @return A string identifying the nearest ancestor element
* information item with a [schema information] property
* (or this element item itself if it has such a property)
* (form to be determined)
* @see <a href="http://www.w3.org/TR/xmlschema-1/#e-validation_context">XML Schema Part 1: Structures [validation context]</a>
*/
const XMLCh *getValidationContext();
/**
* Determine the validity of the node with respect
* to the validation being attempted
*
* @return return the [validity] property. Possible values are:
* VALIDITY_UNKNOWN, VALIDITY_INVALID, VALIDITY_VALID
*/
VALIDITY_STATE getValidity() const;
/**
* Determines the extent to which the item has been validated
*
* @return return the [validation attempted] property. The possible values are
* VALIDATION_NONE, VALIDATION_ORDERED_PARTIAL and VALIDATION_FULL
*/
ASSESSMENT_TYPE getValidationAttempted() const;
/**
* A list of error codes generated from validation attempts.
* Need to find all the possible sub-clause reports that need reporting
*
* @return list of error codes
*/
/***
const XMLCh ** getErrorCodes();
****/
/**
* [schema normalized value]
*
* @see <a href="http://www.w3.org/TR/xmlschema-1/#e-schema_normalized_value">XML Schema Part 1: Structures [schema normalized value]</a>
* @return the normalized value of this item after validation
*/
const XMLCh *getSchemaNormalizedValue();
/**
* An item isomorphic to the type definition used to validate this element.
*
* @return a type declaration
*/
virtual XSTypeDefinition *getTypeDefinition() = 0;
/**
* If and only if that type definition is a simple type definition
* with {variety} union, or a complex type definition whose {content type}
* is a simple thype definition with {variety} union, then an item isomorphic
* to that member of the union's {member type definitions} which actually
* validated the element item's normalized value.
*
* @return a simple type declaration
*/
virtual XSSimpleTypeDefinition *getMemberTypeDefinition() = 0;
/**
* [schema default]
*
* @return The canonical lexical representation of the declaration's {value constraint} value.
* @see <a href="http://www.w3.org/TR/xmlschema-1/#e-schema_default">XML Schema Part 1: Structures [schema default]</a>
*/
const XMLCh *getSchemaDefault();
/**
* [schema specified]
* @see <a href="http://www.w3.org/TR/xmlschema-1/#e-schema_specified">XML Schema Part 1: Structures [schema specified]</a>
* @return true - value was specified in schema, false - value comes from the infoset
*/
bool getIsSchemaSpecified() const;
/**
* Return the canonical representation of this value.
* Note that, formally, this is not a PSVI property.
* @return string representing the canonical representation, if this item
* was validated by a simple type definition for which canonical
* representations of values are defined.
*/
const XMLCh *getCanonicalRepresentation() const;
//@}
/**
*
* Get actual value in the form of XSValue,
* caller needs to delete the object returned.
*
* @return an XSValue
*/
virtual XSValue *getActualValue() const;
//----------------------------------
/** methods needed by implementation */
//@{
void setValidationAttempted(PSVIItem::ASSESSMENT_TYPE attemptType);
void setValidity(PSVIItem::VALIDITY_STATE validity);
/** reset the object
* @param validationContext corresponds to schema validation context property
* @param normalizedValue corresponds to schema normalized value property
* @param validityState state of item's validity
* @param assessmentType type of assessment carried out on item
*/
void reset(
const XMLCh* const validationContext
, const XMLCh* const normalizedValue
, const VALIDITY_STATE validityState
, const ASSESSMENT_TYPE assessmentType
);
//@}
private:
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
PSVIItem(const PSVIItem&);
PSVIItem & operator=(const PSVIItem &);
protected:
// -----------------------------------------------------------------------
// data members
// -----------------------------------------------------------------------
// fMemoryManager:
// used for any memory allocations
// fValidationContext
// corresponds to the schema [validation context] property
// fNormalizedValue
// The schema normalized value (when present)
// fDefaultValue
// default value specified in the schema, if any
// fCanonicalValue
// canonicalized version of normalizedValue
// fValidityState
// Whether this item is valid or not
// fAssessmentType
// The kind of assessment that produced the given validity outcome
// fIsSpecified
// Whether this item exists because a default was specified in the schema
// fType
// type responsible for validating this item
// fMemberType
// If fType is a union type, the member type that validated this item
MemoryManager* const fMemoryManager;
const XMLCh* fValidationContext;
const XMLCh* fNormalizedValue;
const XMLCh* fDefaultValue;
XMLCh* fCanonicalValue;
VALIDITY_STATE fValidityState;
ASSESSMENT_TYPE fAssessmentType;
bool fIsSpecified;
XSTypeDefinition * fType;
XSSimpleTypeDefinition* fMemberType;
};
inline PSVIItem::~PSVIItem() {}
inline const XMLCh *PSVIItem::getValidationContext()
{
return fValidationContext;
}
inline const XMLCh* PSVIItem::getSchemaNormalizedValue()
{
return fNormalizedValue;
}
inline const XMLCh* PSVIItem::getSchemaDefault()
{
return fDefaultValue;
}
inline const XMLCh* PSVIItem::getCanonicalRepresentation() const
{
return fCanonicalValue;
}
inline PSVIItem::VALIDITY_STATE PSVIItem::getValidity() const
{
return fValidityState;
}
inline bool PSVIItem::getIsSchemaSpecified() const
{
return fIsSpecified;
}
inline PSVIItem::ASSESSMENT_TYPE PSVIItem::getValidationAttempted() const
{
return fAssessmentType;
}
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,195 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: XSAnnotation.hpp 672273 2008-06-27 13:57:00Z borisk $
*/
#if !defined(XERCESC_INCLUDE_GUARD_XSANNOTATION_HPP)
#define XERCESC_INCLUDE_GUARD_XSANNOTATION_HPP
#include <xercesc/framework/psvi/XSObject.hpp>
#include <xercesc/internal/XSerializable.hpp>
XERCES_CPP_NAMESPACE_BEGIN
/**
* This class describes all properties of a Schema Annotation
* component.
* This is *always* owned by the validator /parser object from which
* it is obtained.
*/
// forward declarations
class DOMNode;
class ContentHandler;
class XMLPARSER_EXPORT XSAnnotation : public XSerializable, public XSObject
{
public:
// TargetType
enum ANNOTATION_TARGET {
/**
* The object type is <code>org.w3c.dom.Element</code>.
*/
W3C_DOM_ELEMENT = 1,
/**
* The object type is <code>org.w3c.dom.Document</code>.
*/
W3C_DOM_DOCUMENT = 2
};
// Constructors and Destructor
// -----------------------------------------------------------------------
/** @name Constructors */
//@{
/**
* The default constructor
*
* @param contents The string that is to be the content of this XSAnnotation
* @param manager The configurable memory manager
*/
XSAnnotation
(
const XMLCh* const contents
, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
//@};
/** @name Destructor */
//@{
~XSAnnotation();
//@}
//---------------------
/** @name XSAnnotation methods */
//@{
/**
* Write contents of the annotation to the specified DOM object. In-scope
* namespace declarations for <code>annotation</code> element are added as
* attribute nodes of the serialized <code>annotation</code>.
* @param node A target pointer to the annotation target object, i.e.
* either <code>DOMDocument</code> or <code>DOMElement</code> cast as
* <code>DOMNode</code>.
* @param targetType A target type.
*/
void writeAnnotation(DOMNode* node, ANNOTATION_TARGET targetType);
/**
* Write contents of the annotation to the specified object.
* The corresponding events for all in-scope namespace declarations are
* sent via the specified document handler.
* @param handler A target pointer to the annotation target object, i.e.
* <code>ContentHandler</code>.
*/
void writeAnnotation(ContentHandler* handler);
/**
* A text representation of annotation.
*/
const XMLCh *getAnnotationString() const;
XMLCh *getAnnotationString();
//@}
//----------------------------------
/** methods needed by implementation */
//@{
void setNext(XSAnnotation* const nextAnnotation);
XSAnnotation* getNext();
//@}
//-----------------------------
/** Getter */
//@{
inline void getLineCol(XMLFileLoc& line, XMLFileLoc& col) const;
inline const XMLCh* getSystemId() const;
//@}
//-----------------------------
/** Setter */
//@{
inline void setLineCol(XMLFileLoc line, XMLFileLoc col);
void setSystemId(const XMLCh* const systemId);
//@}
/***
* Support for Serialization/De-serialization
***/
DECL_XSERIALIZABLE(XSAnnotation)
XSAnnotation(MemoryManager* const manager);
private:
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
XSAnnotation(const XSAnnotation&);
XSAnnotation & operator=(const XSAnnotation &);
protected:
// -----------------------------------------------------------------------
// data members
// -----------------------------------------------------------------------
XMLCh* fContents;
XSAnnotation* fNext;
private:
XMLCh* fSystemId;
XMLFileLoc fLine;
XMLFileLoc fCol;
};
inline const XMLCh *XSAnnotation::getAnnotationString() const
{
return fContents;
}
inline XMLCh *XSAnnotation::getAnnotationString()
{
return fContents;
}
inline void XSAnnotation::getLineCol(XMLFileLoc& line, XMLFileLoc& col) const
{
line = fLine;
col = fCol;
}
inline const XMLCh* XSAnnotation::getSystemId() const
{
return fSystemId;
}
inline void XSAnnotation::setLineCol(XMLFileLoc line, XMLFileLoc col)
{
fLine = line;
fCol = col;
}
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,210 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: XSAttributeDeclaration.hpp 527149 2007-04-10 14:56:39Z amassari $
*/
#if !defined(XERCESC_INCLUDE_GUARD_XSATTRIBUTEDECLARATION_HPP)
#define XERCESC_INCLUDE_GUARD_XSATTRIBUTEDECLARATION_HPP
#include <xercesc/framework/psvi/XSObject.hpp>
XERCES_CPP_NAMESPACE_BEGIN
/**
* This class describes all properties of a Schema Attribute
* Declaration component.
* This is *always* owned by the validator /parser object from which
* it is obtained.
*/
// forward declarations
class XSAnnotation;
class XSComplexTypeDefinition;
class XSSimpleTypeDefinition;
class SchemaAttDef;
class XMLPARSER_EXPORT XSAttributeDeclaration : public XSObject
{
public:
// Constructors and Destructor
// -----------------------------------------------------------------------
/** @name Constructors */
//@{
/**
* The default constructor
*
* @param attDef
* @param typeDef
* @param annot
* @param xsModel
* @param scope
* @param enclosingCTDefinition
* @param manager The configurable memory manager
*/
XSAttributeDeclaration
(
SchemaAttDef* const attDef
, XSSimpleTypeDefinition* const typeDef
, XSAnnotation* const annot
, XSModel* const xsModel
, XSConstants::SCOPE scope
, XSComplexTypeDefinition* enclosingCTDefinition
, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
//@};
/** @name Destructor */
//@{
~XSAttributeDeclaration();
//@}
//---------------------
/** @name overridden XSObject methods */
//@{
/**
* The name of type <code>NCName</code> of this declaration as defined in
* XML Namespaces.
*/
const XMLCh* getName() const;
/**
* The [target namespace] of this object, or <code>null</code> if it is
* unspecified.
*/
const XMLCh* getNamespace();
/**
* A namespace schema information item corresponding to the target
* namespace of the component, if it's globally declared; or null
* otherwise.
*/
XSNamespaceItem* getNamespaceItem();
//@}
/** @name XSAttributeDeclaration methods **/
//@{
/**
* [type definition]: A simple type definition
*/
XSSimpleTypeDefinition *getTypeDefinition() const;
/**
* Optional. One of <code>SCOPE_GLOBAL</code>, <code>SCOPE_LOCAL</code>,
* or <code>SCOPE_ABSENT</code>. If the scope is local, then the
* <code>enclosingCTDefinition</code> is present.
*/
XSConstants::SCOPE getScope() const;
/**
* The complex type definition for locally scoped declarations (see
* <code>scope</code>).
*/
XSComplexTypeDefinition *getEnclosingCTDefinition();
/**
* Value constraint: one of <code>VC_NONE, VC_DEFAULT, VC_FIXED</code>.
*/
XSConstants::VALUE_CONSTRAINT getConstraintType() const;
/**
* Value constraint: The actual value with respect to the [type definition
* ].
*/
const XMLCh *getConstraintValue();
/**
* Optional. Annotation.
*/
XSAnnotation *getAnnotation() const;
//@}
//----------------------------------
/** methods needed by implementation */
//@{
bool getRequired() const;
//@}
private:
void setEnclosingCTDefinition(XSComplexTypeDefinition* const toSet);
friend class XSObjectFactory;
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
XSAttributeDeclaration(const XSAttributeDeclaration&);
XSAttributeDeclaration & operator=(const XSAttributeDeclaration &);
protected:
// -----------------------------------------------------------------------
// data members
// -----------------------------------------------------------------------
SchemaAttDef* fAttDef;
XSSimpleTypeDefinition* fTypeDefinition;
XSAnnotation* fAnnotation;
XSConstants::SCOPE fScope;
XSComplexTypeDefinition* fEnclosingCTDefinition;
};
// ---------------------------------------------------------------------------
// XSAttributeDeclaration: inline methods
// ---------------------------------------------------------------------------
inline XSSimpleTypeDefinition* XSAttributeDeclaration::getTypeDefinition() const
{
return fTypeDefinition;
}
inline XSAnnotation *XSAttributeDeclaration::getAnnotation() const
{
return fAnnotation;
}
inline XSConstants::SCOPE XSAttributeDeclaration::getScope() const
{
return fScope;
}
inline XSComplexTypeDefinition *XSAttributeDeclaration::getEnclosingCTDefinition()
{
return fEnclosingCTDefinition;
}
inline void XSAttributeDeclaration::setEnclosingCTDefinition
(
XSComplexTypeDefinition* const toSet
)
{
fEnclosingCTDefinition = toSet;
}
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,167 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: XSAttributeGroupDefinition.hpp 527149 2007-04-10 14:56:39Z amassari $
*/
#if !defined(XERCESC_INCLUDE_GUARD_XSATTRIBUTEGROUPDEFINITION_HPP)
#define XERCESC_INCLUDE_GUARD_XSATTRIBUTEGROUPDEFINITION_HPP
#include <xercesc/framework/psvi/XSObject.hpp>
XERCES_CPP_NAMESPACE_BEGIN
/**
* This class describes all properties of a Schema Attribute
* Group Definition component.
* This is *always* owned by the validator /parser object from which
* it is obtained.
*/
// forward declarations
class XSAnnotation;
class XSAttributeUse;
class XSWildcard;
class XercesAttGroupInfo;
class XMLPARSER_EXPORT XSAttributeGroupDefinition : public XSObject
{
public:
// Constructors and Destructor
// -----------------------------------------------------------------------
/** @name Constructors */
//@{
/**
* The default constructor
*
* @param xercesAttGroupInfo
* @param xsAttList
* @param xsWildcard
* @param xsAnnot
* @param xsModel
* @param manager The configurable memory manager
*/
XSAttributeGroupDefinition
(
XercesAttGroupInfo* const xercesAttGroupInfo
, XSAttributeUseList* const xsAttList
, XSWildcard* const xsWildcard
, XSAnnotation* const xsAnnot
, XSModel* const xsModel
, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
//@};
/** @name Destructor */
//@{
~XSAttributeGroupDefinition();
//@}
//---------------------
/** @name overridden XSObject methods */
//@{
/**
* The name of type <code>NCName</code> of this declaration as defined in
* XML Namespaces.
*/
const XMLCh* getName() const;
/**
* The [target namespace] of this object, or <code>null</code> if it is
* unspecified.
*/
const XMLCh* getNamespace();
/**
* A namespace schema information item corresponding to the target
* namespace of the component, if it's globally declared; or null
* otherwise.
*/
XSNamespaceItem* getNamespaceItem();
//@}
//---------------------
/** @name XSAttributeGroupDefinition methods */
//@{
/**
* A set of [attribute uses].
*/
XSAttributeUseList *getAttributeUses();
/**
* Optional. A [wildcard].
*/
XSWildcard *getAttributeWildcard() const;
/**
* Optional. An [annotation].
*/
XSAnnotation *getAnnotation() const;
//@}
//----------------------------------
/** methods needed by implementation */
//@{
//@}
private:
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
XSAttributeGroupDefinition(const XSAttributeGroupDefinition&);
XSAttributeGroupDefinition & operator=(const XSAttributeGroupDefinition &);
protected:
// -----------------------------------------------------------------------
// data members
// -----------------------------------------------------------------------
XercesAttGroupInfo* fXercesAttGroupInfo;
XSAttributeUseList* fXSAttributeUseList;
XSWildcard* fXSWildcard;
XSAnnotation* fAnnotation;
};
inline XSAttributeUseList* XSAttributeGroupDefinition::getAttributeUses()
{
return fXSAttributeUseList;
}
inline XSWildcard* XSAttributeGroupDefinition::getAttributeWildcard() const
{
return fXSWildcard;
}
inline XSAnnotation* XSAttributeGroupDefinition::getAnnotation() const
{
return fAnnotation;
}
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,156 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: XSAttributeUse.hpp 527149 2007-04-10 14:56:39Z amassari $
*/
#if !defined(XERCESC_INCLUDE_GUARD_XSATTRIBUTEUSE_HPP)
#define XERCESC_INCLUDE_GUARD_XSATTRIBUTEUSE_HPP
#include <xercesc/framework/psvi/XSObject.hpp>
XERCES_CPP_NAMESPACE_BEGIN
/**
* This class describes all properties of a Schema Attribute
* Use component.
* This is *always* owned by the validator /parser object from which
* it is obtained.
*/
// forward declarations
class XSAttributeDeclaration;
class XMLPARSER_EXPORT XSAttributeUse : public XSObject
{
public:
// Constructors and Destructor
// -----------------------------------------------------------------------
/** @name Constructors */
//@{
/**
* The default constructor
* @param xsAttDecl
* @param xsModel
* @param manager The configurable memory manager
*/
XSAttributeUse
(
XSAttributeDeclaration* const xsAttDecl,
XSModel* const xsModel,
MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
//@};
/** @name Destructor */
//@{
~XSAttributeUse();
//@}
//---------------------
/** @name XSAttributeUse methods */
//@{
/**
* [required]: determines whether this use of an attribute declaration
* requires an appropriate attribute information item to be present, or
* merely allows it.
*/
bool getRequired() const;
/**
* [attribute declaration]: provides the attribute declaration itself,
* which will in turn determine the simple type definition used.
*/
XSAttributeDeclaration *getAttrDeclaration() const;
/**
* Value Constraint: one of default, fixed.
*/
XSConstants::VALUE_CONSTRAINT getConstraintType() const;
/**
* Value Constraint: The actual value.
*/
const XMLCh *getConstraintValue();
//@}
//----------------------------------
/** methods needed by implementation */
//@{
//@}
private:
// set data
void set
(
const bool isRequired
, XSConstants::VALUE_CONSTRAINT constraintType
, const XMLCh* const constraintValue
);
friend class XSObjectFactory;
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
XSAttributeUse(const XSAttributeUse&);
XSAttributeUse & operator=(const XSAttributeUse &);
protected:
// -----------------------------------------------------------------------
// data members
// -----------------------------------------------------------------------
bool fRequired;
XSConstants::VALUE_CONSTRAINT fConstraintType;
const XMLCh* fConstraintValue;
XSAttributeDeclaration* fXSAttributeDeclaration;
};
inline XSAttributeDeclaration *XSAttributeUse::getAttrDeclaration() const
{
return fXSAttributeDeclaration;
}
inline bool XSAttributeUse::getRequired() const
{
return fRequired;
}
inline XSConstants::VALUE_CONSTRAINT XSAttributeUse::getConstraintType() const
{
return fConstraintType;
}
inline const XMLCh *XSAttributeUse::getConstraintValue()
{
return fConstraintValue;
}
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,294 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: XSComplexTypeDefinition.hpp 932887 2010-04-11 13:04:59Z borisk $
*/
#if !defined(XERCESC_INCLUDE_GUARD_XSCOMPLEXTYPEDEFINITION_HPP)
#define XERCESC_INCLUDE_GUARD_XSCOMPLEXTYPEDEFINITION_HPP
#include <xercesc/framework/psvi/XSTypeDefinition.hpp>
XERCES_CPP_NAMESPACE_BEGIN
/**
* This class represents a complexType definition
* schema component.
* This is *always* owned by the validator /parser object from which
* it is obtained.
*
*/
// forward declarations
class XSAnnotation;
class XSAttributeUse;
class XSSimpleTypeDefinition;
class XSParticle;
class XSWildcard;
class ComplexTypeInfo;
class XMLPARSER_EXPORT XSComplexTypeDefinition : public XSTypeDefinition
{
public:
// Content Model Types
enum CONTENT_TYPE {
/**
* Represents an empty content type. A content type with the distinguished
* value empty validates elements with no character or element
* information item children.
*/
CONTENTTYPE_EMPTY = 0,
/**
* Represents a simple content type. A content type which is a simple
* validates elements with character-only children.
*/
CONTENTTYPE_SIMPLE = 1,
/**
* Represents an element-only content type. An element-only content type
* validates elements with children that conform to the supplied content
* model.
*/
CONTENTTYPE_ELEMENT = 2,
/**
* Represents a mixed content type.
*/
CONTENTTYPE_MIXED = 3
};
// Constructors and Destructor
// -----------------------------------------------------------------------
/** @name Constructors */
//@{
/**
* The default constructor
*
* @param complexTypeInfo
* @param xsWildcard
* @param xsSimpleType
* @param xsAttList
* @param xsBaseType
* @param xsParticle
* @param headAnnot
* @param xsModel
* @param manager The configurable memory manager
*/
XSComplexTypeDefinition
(
ComplexTypeInfo* const complexTypeInfo
, XSWildcard* const xsWildcard
, XSSimpleTypeDefinition* const xsSimpleType
, XSAttributeUseList* const xsAttList
, XSTypeDefinition* const xsBaseType
, XSParticle* const xsParticle
, XSAnnotation* const headAnnot
, XSModel* const xsModel
, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
//@};
/** @name Destructor */
//@{
~XSComplexTypeDefinition();
//@}
//---------------------
/** @name XSComplexTypeDefinition methods */
//@{
/**
* [derivation method]: either <code>DERIVATION_EXTENSION</code>,
* <code>DERIVATION_RESTRICTION</code>, or <code>DERIVATION_NONE</code>
* (see <code>XSObject</code>).
*/
XSConstants::DERIVATION_TYPE getDerivationMethod() const;
/**
* [abstract]: a boolean. Complex types for which <code>abstract</code> is
* true must not be used as the type definition for the validation of
* element information items.
*/
bool getAbstract() const;
/**
* A set of attribute uses.
*/
XSAttributeUseList *getAttributeUses();
/**
* Optional.An attribute wildcard.
*/
XSWildcard *getAttributeWildcard() const;
/**
* [content type]: one of empty (<code>CONTENTTYPE_EMPTY</code>), a simple
* type definition (<code>CONTENTTYPE_SIMPLE</code>), mixed (
* <code>CONTENTTYPE_MIXED</code>), or element-only (
* <code>CONTENTTYPE_ELEMENT</code>).
*/
CONTENT_TYPE getContentType() const;
/**
* A simple type definition corresponding to simple content model,
* otherwise <code>null</code>
*/
XSSimpleTypeDefinition *getSimpleType() const;
/**
* A particle for mixed or element-only content model, otherwise
* <code>null</code>
*/
XSParticle *getParticle() const;
/**
* [prohibited substitutions]: a subset of {extension, restriction}
* @param toTest Extension or restriction constants (see
* <code>XSObject</code>).
* @return True if toTest is a prohibited substitution, otherwise
* false.
*/
bool isProhibitedSubstitution(XSConstants::DERIVATION_TYPE toTest);
/**
* [prohibited substitutions]: A subset of {extension, restriction} or
* <code>DERIVATION_NONE</code> represented as a bit flag (see
* <code>XSObject</code>).
*/
short getProhibitedSubstitutions() const;
/**
* A set of [annotations].
*/
XSAnnotationList *getAnnotations();
/**
* The name of type <code>NCName</code> of this declaration as defined in
* XML Namespaces.
*/
const XMLCh* getName() const;
/**
* The [target namespace] of this object, or <code>null</code> if it is
* unspecified.
*/
const XMLCh* getNamespace();
/**
* A namespace schema information item corresponding to the target
* namespace of the component, if it's globally declared; or null
* otherwise.
*/
XSNamespaceItem *getNamespaceItem();
/**
* A boolean that specifies if the type definition is
* anonymous. Convenience attribute.
*/
bool getAnonymous() const;
/**
* {base type definition}: either a simple type definition or a complex
* type definition.
*/
XSTypeDefinition *getBaseType();
/**
* Convenience method: check if this type is derived from the given
* <code>ancestorType</code>.
* @param ancestorType An ancestor type definition.
* @return Return true if this type is derived from
* <code>ancestorType</code>.
*/
bool derivedFromType(const XSTypeDefinition* const ancestorType);
//@}
//----------------------------------
/** methods needed by implementation */
//@{
//@}
private:
/**
* Set the base type
*/
void setBaseType(XSTypeDefinition* const xsBaseType);
friend class XSObjectFactory;
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
XSComplexTypeDefinition(const XSComplexTypeDefinition&);
XSComplexTypeDefinition & operator=(const XSComplexTypeDefinition &);
protected:
// -----------------------------------------------------------------------
// data members
// -----------------------------------------------------------------------
ComplexTypeInfo* fComplexTypeInfo;
XSWildcard* fXSWildcard;
XSAttributeUseList* fXSAttributeUseList;
XSSimpleTypeDefinition* fXSSimpleTypeDefinition;
XSAnnotationList* fXSAnnotationList;
XSParticle* fParticle;
short fProhibitedSubstitution;
};
inline XSAttributeUseList* XSComplexTypeDefinition::getAttributeUses()
{
return fXSAttributeUseList;
}
inline XSWildcard* XSComplexTypeDefinition::getAttributeWildcard() const
{
return fXSWildcard;
}
inline XSSimpleTypeDefinition* XSComplexTypeDefinition::getSimpleType() const
{
return fXSSimpleTypeDefinition;
}
inline short XSComplexTypeDefinition::getProhibitedSubstitutions() const
{
return fProhibitedSubstitution;
}
inline XSParticle *XSComplexTypeDefinition::getParticle() const
{
return fParticle;
}
inline void
XSComplexTypeDefinition::setBaseType(XSTypeDefinition* const xsBaseType)
{
fBaseType = xsBaseType;
}
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,196 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: XSConstants.hpp 527149 2007-04-10 14:56:39Z amassari $
*/
#if !defined(XERCESC_INCLUDE_GUARD_XSCONSTANTS_HPP)
#define XERCESC_INCLUDE_GUARD_XSCONSTANTS_HPP
#include <xercesc/util/RefVectorOf.hpp>
#include <xercesc/util/RefArrayVectorOf.hpp>
XERCES_CPP_NAMESPACE_BEGIN
/**
* This contains constants needed in the schema component model.
*/
// forward definitions for typedefs
class XSAnnotation;
class XSAttributeUse;
class XSFacet;
class XSMultiValueFacet;
class XSNamespaceItem;
class XSParticle;
class XSSimpleTypeDefinition;
// these typedefs are intended to help hide dependence on utility
// classes, as well as to define more intuitive names for commonly
// used concepts.
typedef RefVectorOf <XSAnnotation> XSAnnotationList;
typedef RefVectorOf <XSAttributeUse> XSAttributeUseList;
typedef RefVectorOf <XSFacet> XSFacetList;
typedef RefVectorOf <XSMultiValueFacet> XSMultiValueFacetList;
typedef RefVectorOf <XSNamespaceItem> XSNamespaceItemList;
typedef RefVectorOf <XSParticle> XSParticleList;
typedef RefVectorOf <XSSimpleTypeDefinition> XSSimpleTypeDefinitionList;
typedef RefArrayVectorOf <XMLCh> StringList;
class XMLPARSER_EXPORT XSConstants
{
public:
// XML Schema Components
enum COMPONENT_TYPE {
/**
* The object describes an attribute declaration.
*/
ATTRIBUTE_DECLARATION = 1,
/**
* The object describes an element declaration.
*/
ELEMENT_DECLARATION = 2,
/**
* The object describes a complex type or simple type definition.
*/
TYPE_DEFINITION = 3,
/**
* The object describes an attribute use definition.
*/
ATTRIBUTE_USE = 4,
/**
* The object describes an attribute group definition.
*/
ATTRIBUTE_GROUP_DEFINITION= 5,
/**
* The object describes a model group definition.
*/
MODEL_GROUP_DEFINITION = 6,
/**
* A model group.
*/
MODEL_GROUP = 7,
/**
* The object describes a particle.
*/
PARTICLE = 8,
/**
* The object describes a wildcard.
*/
WILDCARD = 9,
/**
* The object describes an identity constraint definition.
*/
IDENTITY_CONSTRAINT = 10,
/**
* The object describes a notation declaration.
*/
NOTATION_DECLARATION = 11,
/**
* The object describes an annotation.
*/
ANNOTATION = 12,
/**
* The object describes a constraining facet.
*/
FACET = 13,
/**
* The object describes enumeration/pattern facets.
*/
MULTIVALUE_FACET = 14
};
// Derivation constants
enum DERIVATION_TYPE {
/**
* No constraint is available.
*/
DERIVATION_NONE = 0,
/**
* <code>XSTypeDefinition</code> final set or
* <code>XSElementDeclaration</code> disallowed substitution group.
*/
DERIVATION_EXTENSION = 1,
/**
* <code>XSTypeDefinition</code> final set or
* <code>XSElementDeclaration</code> disallowed substitution group.
*/
DERIVATION_RESTRICTION = 2,
/**
* <code>XSTypeDefinition</code> final set.
*/
DERIVATION_SUBSTITUTION = 4,
/**
* <code>XSTypeDefinition</code> final set.
*/
DERIVATION_UNION = 8,
/**
* <code>XSTypeDefinition</code> final set.
*/
DERIVATION_LIST = 16
};
// Scope
enum SCOPE {
/**
* The scope of a declaration within named model groups or attribute
* groups is <code>absent</code>. The scope of such declaration is
* determined when it is used in the construction of complex type
* definitions.
*/
SCOPE_ABSENT = 0,
/**
* A scope of <code>global</code> identifies top-level declarations.
*/
SCOPE_GLOBAL = 1,
/**
* <code>Locally scoped</code> declarations are available for use only
* within the complex type.
*/
SCOPE_LOCAL = 2
};
// Value Constraint
enum VALUE_CONSTRAINT {
/**
* Indicates that the component does not have any value constraint.
*/
VALUE_CONSTRAINT_NONE = 0,
/**
* Indicates that there is a default value constraint.
*/
VALUE_CONSTRAINT_DEFAULT = 1,
/**
* Indicates that there is a fixed value constraint for this attribute.
*/
VALUE_CONSTRAINT_FIXED = 2
};
private:
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
XSConstants();
};
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,307 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: XSElementDeclaration.hpp 527149 2007-04-10 14:56:39Z amassari $
*/
#if !defined(XERCESC_INCLUDE_GUARD_XSELEMENTDECLARATION_HPP)
#define XERCESC_INCLUDE_GUARD_XSELEMENTDECLARATION_HPP
#include <xercesc/framework/psvi/XSObject.hpp>
#include <xercesc/framework/psvi/XSNamedMap.hpp>
XERCES_CPP_NAMESPACE_BEGIN
/**
* This class describes all properties of a Schema Element Declaration
* component.
* This is *always* owned by the validator /parser object from which
* it is obtained.
*/
// forward declarations
class XSAnnotation;
class XSComplexTypeDefinition;
class XSIDCDefinition;
class XSTypeDefinition;
class SchemaElementDecl;
class XMLPARSER_EXPORT XSElementDeclaration : public XSObject
{
public:
// Constructors and Destructor
// -----------------------------------------------------------------------
/** @name Constructors */
//@{
/**
* The default constructor
*
* @param schemaElementDecl
* @param typeDefinition
* @param substitutionGroupAffiliation
* @param annot
* @param identityConstraints
* @param xsModel
* @param elemScope
* @param enclosingTypeDefinition
* @param manager The configurable memory manager
*/
XSElementDeclaration
(
SchemaElementDecl* const schemaElementDecl
, XSTypeDefinition* const typeDefinition
, XSElementDeclaration* const substitutionGroupAffiliation
, XSAnnotation* const annot
, XSNamedMap<XSIDCDefinition>* const identityConstraints
, XSModel* const xsModel
, XSConstants::SCOPE elemScope = XSConstants::SCOPE_ABSENT
, XSComplexTypeDefinition* const enclosingTypeDefinition = 0
, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
//@};
/** @name Destructor */
//@{
~XSElementDeclaration();
//@}
//---------------------
/** @name overridden XSXSObject methods */
//@{
/**
* The name of type <code>NCName</code> of this declaration as defined in
* XML Namespaces.
*/
const XMLCh* getName() const;
/**
* The [target namespace] of this object, or <code>null</code> if it is
* unspecified.
*/
const XMLCh* getNamespace();
/**
* A namespace schema information item corresponding to the target
* namespace of the component, if it's globally declared; or null
* otherwise.
*/
XSNamespaceItem *getNamespaceItem();
//@}
//---------------------
/** @name XSElementDeclaration methods */
//@{
/**
* [type definition]: either a simple type definition or a complex type
* definition.
*/
XSTypeDefinition *getTypeDefinition() const;
/**
* Optional. One of <code>SCOPE_GLOBAL</code>, <code>SCOPE_LOCAL</code>,
* or <code>SCOPE_ABSENT</code>. If the scope is local, then the
* <code>enclosingCTDefinition</code> is present.
*/
XSConstants::SCOPE getScope() const;
/**
* The complex type definition for locally scoped declarations (see
* <code>scope</code>).
*/
XSComplexTypeDefinition *getEnclosingCTDefinition() const;
/**
* [Value constraint]: one of <code>VC_NONE, VC_DEFAULT, VC_FIXED</code>.
*/
XSConstants::VALUE_CONSTRAINT getConstraintType() const;
/**
* [Value constraint]: the actual value with respect to the [type
* definition].
*/
const XMLCh *getConstraintValue();
/**
* If nillable is true, then an element may also be valid if it carries
* the namespace qualified attribute with local name <code>nil</code>
* from namespace <code>http://www.w3.org/2001/XMLSchema-instance</code>
* and value <code>true</code> (xsi:nil) even if it has no text or
* element content despite a <code>content type</code> which would
* otherwise require content.
*/
bool getNillable() const;
/**
* identity-constraint definitions: a set of constraint definitions.
*/
XSNamedMap <XSIDCDefinition> *getIdentityConstraints();
/**
* [substitution group affiliation]: optional. A top-level element
* definition.
*/
XSElementDeclaration *getSubstitutionGroupAffiliation() const;
/**
* Convenience method. Check if <code>exclusion</code> is a substitution
* group exclusion for this element declaration.
* @param exclusion
* <code>DERIVATION_EXTENSION, DERIVATION_RESTRICTION</code> or
* <code>DERIVATION_NONE</code>. Represents final set for the element.
* @return True if <code>exclusion</code> is a part of the substitution
* group exclusion subset.
*/
bool isSubstitutionGroupExclusion(XSConstants::DERIVATION_TYPE exclusion);
/**
* [substitution group exclusions]: the returned value is a bit
* combination of the subset of {
* <code>DERIVATION_EXTENSION, DERIVATION_RESTRICTION</code>} or
* <code>DERIVATION_NONE</code>.
*/
short getSubstitutionGroupExclusions() const;
/**
* Convenience method. Check if <code>disallowed</code> is a disallowed
* substitution for this element declaration.
* @param disallowed {
* <code>DERIVATION_SUBSTITUTION, DERIVATION_EXTENSION, DERIVATION_RESTRICTION</code>
* } or <code>DERIVATION_NONE</code>. Represents a block set for the
* element.
* @return True if <code>disallowed</code> is a part of the substitution
* group exclusion subset.
*/
bool isDisallowedSubstitution(XSConstants::DERIVATION_TYPE disallowed);
/**
* [disallowed substitutions]: the returned value is a bit combination of
* the subset of {
* <code>DERIVATION_SUBSTITUTION, DERIVATION_EXTENSION, DERIVATION_RESTRICTION</code>
* } corresponding to substitutions disallowed by this
* <code>XSElementDeclaration</code> or <code>DERIVATION_NONE</code>.
*/
short getDisallowedSubstitutions() const;
/**
* {abstract} A boolean.
*/
bool getAbstract() const;
/**
* Optional. Annotation.
*/
XSAnnotation *getAnnotation() const;
//@}
//----------------------------------
/** methods needed by implementation */
//@{
void setTypeDefinition(XSTypeDefinition* typeDefinition);
//@}
private:
void setEnclosingCTDefinition(XSComplexTypeDefinition* const toSet);
friend class XSObjectFactory;
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
XSElementDeclaration(const XSElementDeclaration&);
XSElementDeclaration & operator=(const XSElementDeclaration &);
protected:
// -----------------------------------------------------------------------
// data members
// -----------------------------------------------------------------------
short fDisallowedSubstitutions;
short fSubstitutionGroupExclusions;
XSConstants::SCOPE fScope;
SchemaElementDecl* fSchemaElementDecl;
XSTypeDefinition* fTypeDefinition;
XSComplexTypeDefinition* fEnclosingTypeDefinition;
XSElementDeclaration* fSubstitutionGroupAffiliation;
XSAnnotation* fAnnotation;
XSNamedMap<XSIDCDefinition>* fIdentityConstraints;
};
inline XSTypeDefinition* XSElementDeclaration::getTypeDefinition() const
{
return fTypeDefinition;
}
inline XSNamedMap<XSIDCDefinition>* XSElementDeclaration::getIdentityConstraints()
{
return fIdentityConstraints;
}
inline XSElementDeclaration* XSElementDeclaration::getSubstitutionGroupAffiliation() const
{
return fSubstitutionGroupAffiliation;
}
inline short XSElementDeclaration::getSubstitutionGroupExclusions() const
{
return fSubstitutionGroupExclusions;
}
inline short XSElementDeclaration::getDisallowedSubstitutions() const
{
return fDisallowedSubstitutions;
}
inline XSAnnotation *XSElementDeclaration::getAnnotation() const
{
return fAnnotation;
}
inline XSConstants::SCOPE XSElementDeclaration::getScope() const
{
return fScope;
}
inline XSComplexTypeDefinition *XSElementDeclaration::getEnclosingCTDefinition() const
{
return fEnclosingTypeDefinition;
}
inline void XSElementDeclaration::setTypeDefinition(XSTypeDefinition* typeDefinition)
{
fTypeDefinition = typeDefinition;
}
inline void XSElementDeclaration::setEnclosingCTDefinition(XSComplexTypeDefinition* const toSet)
{
fEnclosingTypeDefinition = toSet;
}
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,151 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: XSFacet.hpp 527149 2007-04-10 14:56:39Z amassari $
*/
#if !defined(XERCESC_INCLUDE_GUARD_XSFACET_HPP)
#define XERCESC_INCLUDE_GUARD_XSFACET_HPP
#include <xercesc/framework/psvi/XSSimpleTypeDefinition.hpp>
XERCES_CPP_NAMESPACE_BEGIN
/**
* This represents all Schema Facet components with the exception
* of Enumeration and Pattern Facets, which are represented by the
* XSMultiValueFacet interface.
* This is *always* owned by the validator /parser object from which
* it is obtained.
*/
// forward declarations
class XSAnnotation;
class XMLPARSER_EXPORT XSFacet : public XSObject
{
public:
// Constructors and Destructor
// -----------------------------------------------------------------------
/** @name Constructors */
//@{
/**
* The default constructor
*
* @param facetKind
* @param lexicalValue
* @param isFixed
* @param annot
* @param xsModel
* @param manager The configurable memory manager
*/
XSFacet
(
XSSimpleTypeDefinition::FACET facetKind
, const XMLCh* const lexicalValue
, bool isFixed
, XSAnnotation* const annot
, XSModel* const xsModel
, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
//@};
/** @name Destructor */
//@{
~XSFacet();
//@}
//---------------------
/** @name XSFacet methods */
//@{
/**
* @return An indication as to the facet's type; see <code>XSSimpleTypeDefinition::FACET</code>
*/
XSSimpleTypeDefinition::FACET getFacetKind() const;
/**
* @return Returns a value of a constraining facet.
*/
const XMLCh *getLexicalFacetValue() const;
/**
* Check whether a facet value is fixed.
*/
bool isFixed() const;
/**
* @return an annotation
*/
XSAnnotation *getAnnotation() const;
//@}
//----------------------------------
/** methods needed by implementation */
//@{
//@}
private:
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
XSFacet(const XSFacet&);
XSFacet & operator=(const XSFacet &);
protected:
// -----------------------------------------------------------------------
// data members
// -----------------------------------------------------------------------
XSSimpleTypeDefinition::FACET fFacetKind;
bool fIsFixed;
const XMLCh* fLexicalValue;
XSAnnotation* fAnnotation;
};
inline XSSimpleTypeDefinition::FACET XSFacet::getFacetKind() const
{
return fFacetKind;
}
inline const XMLCh* XSFacet::getLexicalFacetValue() const
{
return fLexicalValue;
}
inline bool XSFacet::isFixed() const
{
return fIsFixed;
}
inline XSAnnotation* XSFacet::getAnnotation() const
{
return fAnnotation;
}
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,190 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: XSIDCDefinition.hpp 527149 2007-04-10 14:56:39Z amassari $
*/
#if !defined(XERCESC_INCLUDE_GUARD_XSIDCDEFINITION_HPP)
#define XERCESC_INCLUDE_GUARD_XSIDCDEFINITION_HPP
#include <xercesc/framework/psvi/XSObject.hpp>
XERCES_CPP_NAMESPACE_BEGIN
/**
* This class describes all properties of a Schema Identity Constraint
* Definition component.
* This is *always* owned by the validator /parser object from which
* it is obtained.
*/
// forward declarations
class XSAnnotation;
class IdentityConstraint;
class XMLPARSER_EXPORT XSIDCDefinition : public XSObject
{
public:
// Identity Constraints
enum IC_CATEGORY {
/**
*
*/
IC_KEY = 1,
/**
*
*/
IC_KEYREF = 2,
/**
*
*/
IC_UNIQUE = 3
};
// Constructors and Destructor
// -----------------------------------------------------------------------
/** @name Constructors */
//@{
/**
* The default constructor
*
* @param identityConstraint
* @param keyIC
* @param headAnnot
* @param stringList
* @param xsModel
* @param manager The configurable memory manager
*/
XSIDCDefinition
(
IdentityConstraint* const identityConstraint
, XSIDCDefinition* const keyIC
, XSAnnotation* const headAnnot
, StringList* const stringList
, XSModel* const xsModel
, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
//@};
/** @name Destructor */
//@{
~XSIDCDefinition();
//@}
//---------------------
/** @name overridden XSXSObject methods */
//@{
/**
* The name of type <code>NCName</code> of this declaration as defined in
* XML Namespaces.
*/
const XMLCh* getName() const;
/**
* The [target namespace] of this object, or <code>null</code> if it is
* unspecified.
*/
const XMLCh* getNamespace();
/**
* A namespace schema information item corresponding to the target
* namespace of the component, if it's globally declared; or null
* otherwise.
*/
XSNamespaceItem *getNamespaceItem();
//@}
//---------------------
/** @name XSIDCDefinition methods */
//@{
/**
* [identity-constraint category]: one of IC_KEY, IC_KEYREF or IC_UNIQUE.
*/
IC_CATEGORY getCategory() const;
/**
* [selector]: a restricted XPath expression.
*/
const XMLCh *getSelectorStr();
/**
* [fields]: a non-empty list of restricted XPath ([XPath]) expressions.
*/
StringList *getFieldStrs();
/**
* [referenced key]: required if [identity-constraint category] is IC_KEYREF,
* forbidden otherwise (when an identity-constraint definition with [
* identity-constraint category] equal to IC_KEY or IC_UNIQUE).
*/
XSIDCDefinition *getRefKey() const;
/**
* A set of [annotations].
*/
XSAnnotationList *getAnnotations();
//@}
//----------------------------------
/** methods needed by implementation */
//@{
//@}
private:
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
XSIDCDefinition(const XSIDCDefinition&);
XSIDCDefinition & operator=(const XSIDCDefinition &);
protected:
// -----------------------------------------------------------------------
// data members
// -----------------------------------------------------------------------
IdentityConstraint* fIdentityConstraint;
XSIDCDefinition* fKey;
StringList* fStringList;
XSAnnotationList* fXSAnnotationList;
};
inline StringList* XSIDCDefinition::getFieldStrs()
{
return fStringList;
}
inline XSIDCDefinition* XSIDCDefinition::getRefKey() const
{
return fKey;
}
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,338 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: XSModel.hpp 674012 2008-07-04 11:18:21Z borisk $
*/
#if !defined(XERCESC_INCLUDE_GUARD_XSMODEL_HPP)
#define XERCESC_INCLUDE_GUARD_XSMODEL_HPP
#include <xercesc/util/PlatformUtils.hpp>
#include <xercesc/framework/psvi/XSObject.hpp>
#include <xercesc/framework/psvi/XSNamedMap.hpp>
#include <xercesc/util/ValueVectorOf.hpp>
#include <xercesc/validators/schema/SchemaElementDecl.hpp>
XERCES_CPP_NAMESPACE_BEGIN
/**
* This class contains all properties of the Schema infoitem as determined
* after an entire validation episode. That is, it contains all the properties
* of all the Schema Namespace Information objects that went into
* the validation episode.
* Since it is not like other components, it does not
* inherit from the XSObject interface.
* This is *always* owned by the validator /parser object from which
* it is obtained. It is designed to be subclassed; subclasses will
* specify under what conditions it may be relied upon to have meaningful contents.
*/
// forward declarations
class Grammar;
class XMLGrammarPool;
class XSAnnotation;
class XSAttributeDeclaration;
class XSAttributeGroupDefinition;
class XSElementDeclaration;
class XSModelGroupDefinition;
class XSNamespaceItem;
class XSNotationDeclaration;
class XSTypeDefinition;
class XSObjectFactory;
class XMLPARSER_EXPORT XSModel : public XMemory
{
public:
// Constructors and Destructor
// -----------------------------------------------------------------------
/** @name Constructors */
//@{
/**
* The constructor to be used when a grammar pool contains all needed info
* @param grammarPool the grammar pool containing the underlying data structures
* @param manager The configurable memory manager
*/
XSModel( XMLGrammarPool *grammarPool
, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
/**
* The constructor to be used when the XSModel must represent all
* components in the union of an existing XSModel and a newly-created
* Grammar(s) from the GrammarResolver
*
* @param baseModel the XSModel upon which this one is based
* @param grammarResolver the grammar(s) whose components are to be merged
* @param manager The configurable memory manager
*/
XSModel( XSModel *baseModel
, GrammarResolver *grammarResolver
, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager);
//@};
/** @name Destructor */
//@{
~XSModel();
//@}
//---------------------
/** @name XSModel methods */
//@{
/**
* Convenience method. Returns a list of all namespaces that belong to
* this schema. The value <code>null</code> is not a valid namespace
* name, but if there are components that don't have a target namespace,
* <code>null</code> is included in this list.
*/
StringList *getNamespaces();
/**
* A set of namespace schema information information items ( of type
* <code>XSNamespaceItem</code>), one for each namespace name which
* appears as the target namespace of any schema component in the schema
* used for that assessment, and one for absent if any schema component
* in the schema had no target namespace. For more information see
* schema information.
*/
XSNamespaceItemList *getNamespaceItems();
/**
* [schema components]: a list of top-level components, i.e. element
* declarations, attribute declarations, etc.
* @param objectType The type of the declaration, i.e.
* <code>ELEMENT_DECLARATION</code>,
* <code>TYPE_DEFINITION</code> and any other component type that
* may be a property of a schema component.
* @return A list of top-level definition of the specified type in
* <code>objectType</code> or <code>null</code>.
*/
XSNamedMap<XSObject> *getComponents(XSConstants::COMPONENT_TYPE objectType);
/**
* Convenience method. Returns a list of top-level component declarations
* that are defined within the specified namespace, i.e. element
* declarations, attribute declarations, etc.
* @param objectType The type of the declaration, i.e.
* <code>ELEMENT_DECLARATION</code>.
* @param compNamespace The namespace to which declaration belongs or
* <code>null</code> (for components with no target namespace).
* @return A list of top-level definitions of the specified type in
* <code>objectType</code> and defined in the specified
* <code>namespace</code> or <code>null</code>.
*/
XSNamedMap<XSObject> *getComponentsByNamespace(XSConstants::COMPONENT_TYPE objectType,
const XMLCh *compNamespace);
/**
* [annotations]: a set of annotations.
*/
XSAnnotationList *getAnnotations();
/**
* Convenience method. Returns a top-level element declaration.
* @param name The name of the declaration.
* @param compNamespace The namespace of the declaration, null if absent.
* @return A top-level element declaration or <code>null</code> if such
* declaration does not exist.
*/
XSElementDeclaration *getElementDeclaration(const XMLCh *name
, const XMLCh *compNamespace);
/**
* Convenience method. Returns a top-level attribute declaration.
* @param name The name of the declaration.
* @param compNamespace The namespace of the declaration, null if absent.
* @return A top-level attribute declaration or <code>null</code> if such
* declaration does not exist.
*/
XSAttributeDeclaration *getAttributeDeclaration(const XMLCh *name
, const XMLCh *compNamespace);
/**
* Convenience method. Returns a top-level simple or complex type
* definition.
* @param name The name of the definition.
* @param compNamespace The namespace of the declaration, null if absent.
* @return An <code>XSTypeDefinition</code> or <code>null</code> if such
* definition does not exist.
*/
XSTypeDefinition *getTypeDefinition(const XMLCh *name
, const XMLCh *compNamespace);
/**
* Convenience method. Returns a top-level attribute group definition.
* @param name The name of the definition.
* @param compNamespace The namespace of the declaration, null if absent.
* @return A top-level attribute group definition or <code>null</code> if
* such definition does not exist.
*/
XSAttributeGroupDefinition *getAttributeGroup(const XMLCh *name
, const XMLCh *compNamespace);
/**
* Convenience method. Returns a top-level model group definition.
* @param name The name of the definition.
* @param compNamespace The namespace of the declaration, null if absent.
* @return A top-level model group definition definition or
* <code>null</code> if such definition does not exist.
*/
XSModelGroupDefinition *getModelGroupDefinition(const XMLCh *name
, const XMLCh *compNamespace);
/**
* Convenience method. Returns a top-level notation declaration.
* @param name The name of the declaration.
* @param compNamespace The namespace of the declaration, null if absent.
* @return A top-level notation declaration or <code>null</code> if such
* declaration does not exist.
*/
XSNotationDeclaration *getNotationDeclaration(const XMLCh *name
, const XMLCh *compNamespace);
/**
* Optional. Return a component given a component type and a unique Id.
* May not be supported for all component types.
* @param compId unique Id of the component within its type
* @param compType type of the component
* @return the component of the given type with the given Id, or 0
* if no such component exists or this is unsupported for
* this type of component.
*/
XSObject *getXSObjectById(XMLSize_t compId,
XSConstants::COMPONENT_TYPE compType);
//@}
//----------------------------------
/** methods needed by implementation */
//@{
XMLStringPool* getURIStringPool();
XSNamespaceItem* getNamespaceItem(const XMLCh* const key);
/**
* Get the XSObject (i.e. XSElementDeclaration) that corresponds to
* to a schema grammar component (i.e. SchemaElementDecl)
* @param key schema component object
*
* @return the corresponding XSObject
*/
XSObject* getXSObject(void* key);
//@}
private:
// -----------------------------------------------------------------------
// Helper methods
// -----------------------------------------------------------------------
void addGrammarToXSModel
(
XSNamespaceItem* namespaceItem
);
void addS4SToXSModel
(
XSNamespaceItem* const namespaceItem
, RefHashTableOf<DatatypeValidator>* const builtInDV
);
void addComponentToNamespace
(
XSNamespaceItem* const namespaceItem
, XSObject* const component
, XMLSize_t componentIndex
, bool addToXSModel = true
);
void addComponentToIdVector
(
XSObject* const component
, XMLSize_t componentIndex
);
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
XSModel(const XSModel&);
XSModel & operator=(const XSModel &);
protected:
friend class XSObjectFactory;
friend class XSObject;
// -----------------------------------------------------------------------
// data members
// -----------------------------------------------------------------------
// fMemoryManager:
// used for any memory allocations
MemoryManager* const fMemoryManager;
StringList* fNamespaceStringList;
XSNamespaceItemList* fXSNamespaceItemList;
RefVectorOf<XSObject>* fIdVector[XSConstants::MULTIVALUE_FACET];
/* Need a XSNamedMap for each component top-level?
ATTRIBUTE_DECLARATION = 1,
ELEMENT_DECLARATION = 2,
TYPE_DEFINITION = 3,
ATTRIBUTE_USE = 4, no
ATTRIBUTE_GROUP_DEFINITION= 5,
MODEL_GROUP_DEFINITION = 6,
MODEL_GROUP = 7, no
PARTICLE = 8, no
WILDCARD = 9, no
IDENTITY_CONSTRAINT = 10, no
NOTATION_DECLARATION = 11,
ANNOTATION = 12, no
FACET = 13, no
MULTIVALUE_FACET = 14 no
*/
XSNamedMap<XSObject>* fComponentMap[XSConstants::MULTIVALUE_FACET];
XMLStringPool* fURIStringPool;
XSAnnotationList* fXSAnnotationList;
RefHashTableOf<XSNamespaceItem>* fHashNamespace;
XSObjectFactory* fObjFactory;
RefVectorOf<XSNamespaceItem>* fDeleteNamespace;
XSModel* fParent;
bool fDeleteParent;
bool fAddedS4SGrammar;
};
inline XMLStringPool* XSModel::getURIStringPool()
{
return fURIStringPool;
}
inline StringList *XSModel::getNamespaces()
{
return fNamespaceStringList;
}
inline XSNamespaceItemList *XSModel::getNamespaceItems()
{
return fXSNamespaceItemList;
}
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,156 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: XSModelGroup.hpp 527149 2007-04-10 14:56:39Z amassari $
*/
#if !defined(XERCESC_INCLUDE_GUARD_XSMODELGROUP_HPP)
#define XERCESC_INCLUDE_GUARD_XSMODELGROUP_HPP
#include <xercesc/framework/psvi/XSObject.hpp>
XERCES_CPP_NAMESPACE_BEGIN
/**
* This class describes all properties of a Schema Model Group
* component.
* This is *always* owned by the validator /parser object from which
* it is obtained.
*/
// forward declarations
class XSAnnotation;
class XSParticle;
class XMLPARSER_EXPORT XSModelGroup : public XSObject
{
public:
// Content model compositors
enum COMPOSITOR_TYPE {
/**
* This constant value signifies a sequence operator.
*/
COMPOSITOR_SEQUENCE = 1,
/**
* This constant value signifies a choice operator.
*/
COMPOSITOR_CHOICE = 2,
/**
* This content model represents a simplified version of the SGML
* &amp;-Connector and is limited to the top-level of any content model.
* No element in the all content model may appear more than once.
*/
COMPOSITOR_ALL = 3
};
// Constructors and Destructor
// -----------------------------------------------------------------------
/** @name Constructors */
//@{
/**
* The default constructor
*
* @param compositorType
* @param particleList
* @param annot
* @param xsModel
* @param manager The configurable memory manager
*/
XSModelGroup
(
COMPOSITOR_TYPE compositorType
, XSParticleList* const particleList
, XSAnnotation* const annot
, XSModel* const xsModel
, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
//@};
/** @name Destructor */
//@{
~XSModelGroup();
//@}
//---------------------
/** @name XSModelGroup methods */
//@{
/**
* [compositor]: one of all, choice or sequence. The valid constants
* values are:
* <code>COMPOSITOR_SEQUENCE, COMPOSITOR_CHOICE, COMPOSITOR_ALL</code>.
*/
COMPOSITOR_TYPE getCompositor() const;
/**
* A list of [particles].
*/
XSParticleList *getParticles() const;
/**
* Optional. An [annotation].
*/
XSAnnotation *getAnnotation() const;
//@}
//----------------------------------
/** methods needed by implementation */
//@{
//@}
private:
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
XSModelGroup(const XSModelGroup&);
XSModelGroup & operator=(const XSModelGroup &);
protected:
// -----------------------------------------------------------------------
// data members
// -----------------------------------------------------------------------
COMPOSITOR_TYPE fCompositorType;
XSParticleList* fParticleList;
XSAnnotation* fAnnotation;
};
inline XSModelGroup::COMPOSITOR_TYPE XSModelGroup::getCompositor() const
{
return fCompositorType;
}
inline XSParticleList* XSModelGroup::getParticles() const
{
return fParticleList;
}
inline XSAnnotation* XSModelGroup::getAnnotation() const
{
return fAnnotation;
}
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,150 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: XSModelGroupDefinition.hpp 527149 2007-04-10 14:56:39Z amassari $
*/
#if !defined(XERCESC_INCLUDE_GUARD_XSMODELGROUPDEFINITION_HPP)
#define XERCESC_INCLUDE_GUARD_XSMODELGROUPDEFINITION_HPP
#include <xercesc/framework/psvi/XSObject.hpp>
XERCES_CPP_NAMESPACE_BEGIN
/**
* This class describes all properties of a Schema Model Group
* Definition component.
* This is *always* owned by the validator /parser object from which
* it is obtained.
*/
// forward declarations
class XSAnnotation;
class XSModelGroup;
class XSParticle;
class XercesGroupInfo;
class XMLPARSER_EXPORT XSModelGroupDefinition : public XSObject
{
public:
// Constructors and Destructor
// -----------------------------------------------------------------------
/** @name Constructors */
//@{
/**
* The default constructor
*
* @param groupInfo
* @param groupParticle
* @param annot
* @param xsModel
* @param manager The configurable memory manager
*/
XSModelGroupDefinition
(
XercesGroupInfo* const groupInfo
, XSParticle* const groupParticle
, XSAnnotation* const annot
, XSModel* const xsModel
, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
//@};
/** @name Destructor */
//@{
~XSModelGroupDefinition();
//@}
//---------------------
/** @name overridden XSXSObject methods */
//@{
/**
* The name of type <code>NCName</code> of this declaration as defined in
* XML Namespaces.
*/
const XMLCh* getName() const;
/**
* The [target namespace] of this object, or <code>null</code> if it is
* unspecified.
*/
const XMLCh* getNamespace();
/**
* A namespace schema information item corresponding to the target
* namespace of the component, if it's globally declared; or null
* otherwise.
*/
XSNamespaceItem *getNamespaceItem();
//@}
//---------------------
/** @name XSModelGroupDefinition methods */
//@{
/**
* A model group.
*/
XSModelGroup *getModelGroup();
/**
* Optional. An [annotation].
*/
XSAnnotation *getAnnotation() const;
//@}
//----------------------------------
/** methods needed by implementation */
//@{
//@}
private:
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
XSModelGroupDefinition(const XSModelGroupDefinition&);
XSModelGroupDefinition & operator=(const XSModelGroupDefinition &);
protected:
// -----------------------------------------------------------------------
// data members
// -----------------------------------------------------------------------
XercesGroupInfo* fGroupInfo;
XSParticle* fModelGroupParticle;
XSAnnotation* fAnnotation;
};
inline XSAnnotation* XSModelGroupDefinition::getAnnotation() const
{
return fAnnotation;
}
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,152 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: XSMultiValueFacet.hpp 527149 2007-04-10 14:56:39Z amassari $
*/
#if !defined(XERCESC_INCLUDE_GUARD_XSMULTIVALUEFACET_HPP)
#define XERCESC_INCLUDE_GUARD_XSMULTIVALUEFACET_HPP
#include <xercesc/framework/psvi/XSObject.hpp>
#include <xercesc/framework/psvi/XSSimpleTypeDefinition.hpp>
XERCES_CPP_NAMESPACE_BEGIN
/**
* This class represents all Schema Facets which may possess multiple
* lexical values/annotations (i.e., Pattern and Enumeration facets).
* This is *always* owned by the validator /parser object from which
* it is obtained.
*/
// forward declarations
class XSAnnotation;
class XMLPARSER_EXPORT XSMultiValueFacet : public XSObject
{
public:
// Constructors and Destructor
// -----------------------------------------------------------------------
/** @name Constructors */
//@{
/**
* The default constructor
*
* @param facetKind
* @param lexicalValues
* @param isFixed
* @param headAnnot
* @param xsModel
* @param manager The configurable memory manager
*/
XSMultiValueFacet
(
XSSimpleTypeDefinition::FACET facetKind
, StringList* lexicalValues
, bool isFixed
, XSAnnotation* const headAnnot
, XSModel* const xsModel
, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
//@};
/** @name Destructor */
//@{
~XSMultiValueFacet();
//@}
//---------------------
/** @name XSMultiValueFacet methods */
//@{
/**
* @return An indication as to the facet's type; see <code>XSSimpleTypeDefinition::FACET</code>
*/
XSSimpleTypeDefinition::FACET getFacetKind() const;
/**
* @return Returns the values of a constraining facet.
*/
StringList *getLexicalFacetValues();
/**
* Check whether a facet value is fixed.
*/
bool isFixed() const;
/**
* @return the annotations belonging to this facet's values
*/
XSAnnotationList *getAnnotations();
//@}
//----------------------------------
/** methods needed by implementation */
//@{
//@}
private:
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
XSMultiValueFacet(const XSMultiValueFacet&);
XSMultiValueFacet & operator=(const XSMultiValueFacet &);
protected:
// -----------------------------------------------------------------------
// data members
// -----------------------------------------------------------------------
XSSimpleTypeDefinition::FACET fFacetKind;
bool fIsFixed;
StringList* fLexicalValues; // not owned by this class
XSAnnotationList* fXSAnnotationList;
};
inline XSSimpleTypeDefinition::FACET XSMultiValueFacet::getFacetKind() const
{
return fFacetKind;
}
inline bool XSMultiValueFacet::isFixed() const
{
return fIsFixed;
}
inline StringList *XSMultiValueFacet::getLexicalFacetValues()
{
return fLexicalValues;
}
inline XSAnnotationList *XSMultiValueFacet::getAnnotations()
{
return fXSAnnotationList;
}
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,138 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: XSNamedMap.hpp 674012 2008-07-04 11:18:21Z borisk $
*/
#if !defined(XERCESC_INCLUDE_GUARD_XSNAMEDMAP_HPP)
#define XERCESC_INCLUDE_GUARD_XSNAMEDMAP_HPP
#include <xercesc/util/XMemory.hpp>
#include <xercesc/util/RefHash2KeysTableOf.hpp>
#include <xercesc/util/RefVectorOf.hpp>
XERCES_CPP_NAMESPACE_BEGIN
class XMLStringPool;
/*
* This template provides convenient mappings between name,namespace
* pairs and individual components, as well as means to iterate through all the
* named components on some object.
*/
template <class TVal> class XSNamedMap: public XMemory
{
public:
// -----------------------------------------------------------------------
// Constructors and Destructor
// -----------------------------------------------------------------------
/** @name Constructors */
//@{
XSNamedMap(const XMLSize_t maxElems,
const XMLSize_t modulus,
XMLStringPool* uriStringPool,
const bool adoptElems,
MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
//@}
/** @name Destructor */
//@{
~XSNamedMap();
//@}
// -----------------------------------------------------------------------
// XSNamedMap methods
// -----------------------------------------------------------------------
/** @name XSNamedMap methods */
//@{
/**
* The number of <code>XSObjects</code> in the <code>XSObjectList</code>.
* The range of valid child object indices is 0 to
* <code>mapLength-1</code> inclusive.
*/
XMLSize_t getLength() const;
/**
* Returns the <code>index</code>th item in the collection. The index
* starts at 0. If <code>index</code> is greater than or equal to the
* number of objects in the list, this returns <code>null</code>.
* @param index index into the collection.
* @return The <code>XSObject</code> at the <code>index</code>th
* position in the <code>XSObjectList</code>, or <code>null</code> if
* that is not a valid index.
*/
TVal *item(XMLSize_t index);
const TVal *item(XMLSize_t index) const;
/**
* Retrieves a component specified by local name and namespace URI.
* <br>applications must use the value null as the
* <code>compNamespace</code> parameter for components whose targetNamespace property
* is absent.
* @param compNamespace The namespace URI of the component to retrieve.
* @param localName The local name of the component to retrieve.
* @return A component (of any type) with the specified local
* name and namespace URI, or <code>null</code> if they do not
* identify any node in this map.
*/
TVal *itemByName(const XMLCh *compNamespace,
const XMLCh *localName);
//@}
//----------------------------------
/** methods needed by implementation */
//@{
void addElement(TVal* const toAdd, const XMLCh* key1, const XMLCh* key2);
//@}
private :
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
XSNamedMap(const XSNamedMap<TVal>&);
XSNamedMap<TVal>& operator=(const XSNamedMap<TVal>&);
// -----------------------------------------------------------------------
// Data members
//
// fMemoryManager
// manager used to allocate memory needed by this object
MemoryManager *const fMemoryManager;
XMLStringPool* fURIStringPool;
RefVectorOf<TVal>* fVector;
RefHash2KeysTableOf<TVal>* fHash;
};
XERCES_CPP_NAMESPACE_END
#if !defined(XERCES_TMPLSINC)
#include <xercesc/framework/psvi/XSNamedMap.c>
#endif
#endif

View File

@@ -0,0 +1,245 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: XSNamespaceItem.hpp 527149 2007-04-10 14:56:39Z amassari $
*/
#if !defined(XERCESC_INCLUDE_GUARD_XSNAMESPACEITEM_HPP)
#define XERCESC_INCLUDE_GUARD_XSNAMESPACEITEM_HPP
#include <xercesc/util/PlatformUtils.hpp>
#include <xercesc/framework/psvi/XSObject.hpp>
#include <xercesc/framework/psvi/XSNamedMap.hpp>
XERCES_CPP_NAMESPACE_BEGIN
/**
* This class contains all properties of the Schema Namespace Information infoitem.
* These items correspond to the result of processing a schema document
* and all its included/redefined schema documents. It corresponds to the
* schema component discussed in the schema specifications, but since it
* is not like other components does not inherit from the XSObject interface.
* This is *always* owned by the validator /parser object from which
* it is obtained. It is designed to be subclassed; subclasses will
* specify under what conditions it may be relied upon to have meaningful contents.
*/
// forward declarations
class XSAnnotation;
class XSAttributeDeclaration;
class XSAttributeGroupDefinition;
class XSElementDeclaration;
class XSModelGroupDefinition;
class XSNotationDeclaration;
class XSTypeDefinition;
class SchemaGrammar;
class XSModel;
class XMLPARSER_EXPORT XSNamespaceItem : public XMemory
{
public:
// Constructors and Destructor
// -----------------------------------------------------------------------
/** @name Constructors */
//@{
/**
* The default constructor
*
* @param xsModel
* @param grammar
* @param manager The configurable memory manager
*/
XSNamespaceItem
(
XSModel* const xsModel
, SchemaGrammar* const grammar
, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
XSNamespaceItem
(
XSModel* const xsModel
, const XMLCh* const schemaNamespace
, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
//@};
/** @name Destructor */
//@{
~XSNamespaceItem();
//@}
//---------------------
/** @name XSNamespaceItem methods */
//@{
/**
* [schema namespace]: A namespace name or <code>null</code>
* corresponding to the target namespace of the schema document.
*/
const XMLCh *getSchemaNamespace() const;
/**
* [schema components]: a list of top-level components, i.e. element
* declarations, attribute declarations, etc.
* @param objectType The type of the declaration, i.e.
* <code>ELEMENT_DECLARATION</code>,
* <code>TYPE_DEFINITION</code> and any other component type that
* may be a property of a schema component.
* @return A list of top-level definition of the specified type in
* <code>objectType</code> or <code>null</code>.
*/
XSNamedMap<XSObject> *getComponents(XSConstants::COMPONENT_TYPE objectType);
/**
* [annotations]: a set of annotations.
*/
XSAnnotationList *getAnnotations();
const XSAnnotationList *getAnnotations() const;
/**
* Convenience method. Returns a top-level element declaration.
* @param name The name of the declaration.
* @return A top-level element declaration or <code>null</code> if such
* declaration does not exist.
*/
XSElementDeclaration *getElementDeclaration(const XMLCh *name);
/**
* Convenience method. Returns a top-level attribute declaration.
* @param name The name of the declaration.
* @return A top-level attribute declaration or <code>null</code> if such
* declaration does not exist.
*/
XSAttributeDeclaration *getAttributeDeclaration(const XMLCh *name);
/**
* Convenience method. Returns a top-level simple or complex type
* definition.
* @param name The name of the definition.
* @return An <code>XSTypeDefinition</code> or <code>null</code> if such
* definition does not exist.
*/
XSTypeDefinition *getTypeDefinition(const XMLCh *name);
/**
* Convenience method. Returns a top-level attribute group definition.
* @param name The name of the definition.
* @return A top-level attribute group definition or <code>null</code> if
* such definition does not exist.
*/
XSAttributeGroupDefinition *getAttributeGroup(const XMLCh *name);
/**
* Convenience method. Returns a top-level model group definition.
* @param name The name of the definition.
* @return A top-level model group definition definition or
* <code>null</code> if such definition does not exist.
*/
XSModelGroupDefinition *getModelGroupDefinition(const XMLCh *name);
/**
* Convenience method. Returns a top-level notation declaration.
* @param name The name of the declaration.
* @return A top-level notation declaration or <code>null</code> if such
* declaration does not exist.
*/
XSNotationDeclaration *getNotationDeclaration(const XMLCh *name);
/**
* [document location] - a list of locations URI for the documents that
* contributed to the XSModel.
*/
const StringList *getDocumentLocations();
//@}
//----------------------------------
/** methods needed by implementation */
//@{
//@}
private:
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
XSNamespaceItem(const XSNamespaceItem&);
XSNamespaceItem & operator=(const XSNamespaceItem &);
protected:
friend class XSModel;
friend class XSObjectFactory;
// -----------------------------------------------------------------------
// data members
// -----------------------------------------------------------------------
// fMemoryManager:
// used for any memory allocations
MemoryManager* const fMemoryManager;
SchemaGrammar* fGrammar;
XSModel* fXSModel;
/* Need a XSNamedMap for each component top-level?
that is top level.
ATTRIBUTE_DECLARATION = 1,
ELEMENT_DECLARATION = 2,
TYPE_DEFINITION = 3,
ATTRIBUTE_USE = 4, no
ATTRIBUTE_GROUP_DEFINITION= 5,
MODEL_GROUP_DEFINITION = 6,
MODEL_GROUP = 7, no
PARTICLE = 8, no
WILDCARD = 9, no
IDENTITY_CONSTRAINT = 10, no
NOTATION_DECLARATION = 11,
ANNOTATION = 12, no
FACET = 13, no
MULTIVALUE_FACET = 14 no
*/
XSNamedMap<XSObject>* fComponentMap[XSConstants::MULTIVALUE_FACET];
XSAnnotationList* fXSAnnotationList;
RefHashTableOf<XSObject>* fHashMap[XSConstants::MULTIVALUE_FACET];
const XMLCh* fSchemaNamespace;
};
inline XSAnnotationList* XSNamespaceItem::getAnnotations()
{
return fXSAnnotationList;
}
inline const XSAnnotationList* XSNamespaceItem::getAnnotations() const
{
return fXSAnnotationList;
}
inline const XMLCh *XSNamespaceItem::getSchemaNamespace() const
{
return fSchemaNamespace;
}
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,154 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: XSNotationDeclaration.hpp 527149 2007-04-10 14:56:39Z amassari $
*/
#if !defined(XERCESC_INCLUDE_GUARD_XSNOTATIONDECLARATION_HPP)
#define XERCESC_INCLUDE_GUARD_XSNOTATIONDECLARATION_HPP
#include <xercesc/framework/psvi/XSObject.hpp>
XERCES_CPP_NAMESPACE_BEGIN
/**
* This class describes all properties of a Schema Notation Declaration
* component.
* This is *always* owned by the validator /parser object from which
* it is obtained.
*/
// forward declarations
class XSAnnotation;
class XMLNotationDecl;
class XMLPARSER_EXPORT XSNotationDeclaration : public XSObject
{
public:
// Constructors and Destructor
// -----------------------------------------------------------------------
/** @name Constructors */
//@{
/**
* The default constructor
*
* @param xmlNotationDecl
* @param annot
* @param xsModel
* @param manager The configurable memory manager
*/
XSNotationDeclaration
(
XMLNotationDecl* const xmlNotationDecl
, XSAnnotation* const annot
, XSModel* const xsModel
, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
//@};
/** @name Destructor */
//@{
~XSNotationDeclaration();
//@}
//---------------------
/** @name overridden XSXSObject methods */
//@{
/**
* The name of type <code>NCName</code> of this declaration as defined in
* XML Namespaces.
*/
const XMLCh* getName() const;
/**
* The [target namespace] of this object, or <code>null</code> if it is
* unspecified.
*/
const XMLCh* getNamespace();
/**
* A namespace schema information item corresponding to the target
* namespace of the component, if it's globally declared; or null
* otherwise.
*/
XSNamespaceItem *getNamespaceItem();
//@}
//---------------------
/** @name XSNotationDeclaration methods */
//@{
/**
* The URI reference representing the system identifier for the notation
* declaration, if present, <code>null</code> otherwise.
*/
const XMLCh *getSystemId();
/**
* The string representing the public identifier for this notation
* declaration, if present; <code>null</code> otherwise.
*/
const XMLCh *getPublicId();
/**
* Optional. An [annotation].
*/
XSAnnotation *getAnnotation() const;
//@}
//----------------------------------
/** methods needed by implementation */
//@{
//@}
private:
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
XSNotationDeclaration(const XSNotationDeclaration&);
XSNotationDeclaration & operator=(const XSNotationDeclaration &);
protected:
// -----------------------------------------------------------------------
// data members
// -----------------------------------------------------------------------
XMLNotationDecl* fXMLNotationDecl;
XSAnnotation* fAnnotation;
};
inline XSAnnotation* XSNotationDeclaration::getAnnotation() const
{
return fAnnotation;
}
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,152 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: XSObject.hpp 674012 2008-07-04 11:18:21Z borisk $
*/
#if !defined(XERCESC_INCLUDE_GUARD_XSOBJECT_HPP)
#define XERCESC_INCLUDE_GUARD_XSOBJECT_HPP
#include <xercesc/util/PlatformUtils.hpp>
#include <xercesc/framework/psvi/XSConstants.hpp>
XERCES_CPP_NAMESPACE_BEGIN
/**
* The XSObject forms the base of the Schema Component Model. It contains
* all properties common to the majority of XML Schema components.
* This is *always* owned by the validator /parser object from which
* it is obtained. It is designed to be subclassed; subclasses will
* specify under what conditions it may be relied upon to have meaningful contents.
*/
// forward declarations
class XSNamespaceItem;
class XSModel;
class XMLPARSER_EXPORT XSObject : public XMemory
{
public:
// Constructors and Destructor
// -----------------------------------------------------------------------
/** @name Constructors */
//@{
/**
* The default constructor
*
* @param compType
* @param xsModel
* @param manager The configurable memory manager
*/
XSObject
(
XSConstants::COMPONENT_TYPE compType
, XSModel* const xsModel
, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
//@};
/** @name Destructor */
//@{
virtual ~XSObject();
//@}
//---------------------
/** @name XSObject methods */
//@{
/**
* The <code>type</code> of this object, i.e.
* <code>ELEMENT_DECLARATION</code>.
*/
XSConstants::COMPONENT_TYPE getType() const;
/**
* The name of type <code>NCName</code> of this declaration as defined in
* XML Namespaces.
*/
virtual const XMLCh* getName() const;
/**
* The [target namespace] of this object, or <code>null</code> if it is
* unspecified.
*/
virtual const XMLCh* getNamespace();
/**
* A namespace schema information item corresponding to the target
* namespace of the component, if it's globally declared; or null
* otherwise.
*/
virtual XSNamespaceItem *getNamespaceItem();
/**
* Optional. Return a unique identifier for a component within this XSModel, to
* optimize querying. May not be defined for all types of component.
* @return id unique for this type of component within this XSModel or 0
* to indicate that this is not supported for this type of component.
*/
virtual XMLSize_t getId() const;
//@}
//----------------------------------
/** methods needed by implementation */
//@{
/**
* Set the id to be returned on getId().
*/
void setId(XMLSize_t id);
//@}
private:
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
XSObject(const XSObject&);
XSObject & operator=(const XSObject &);
protected:
// -----------------------------------------------------------------------
// data members
// -----------------------------------------------------------------------
// fMemoryManager:
// used for any memory allocations
// fComponentType
// the type of the actual component
XSConstants::COMPONENT_TYPE fComponentType;
XSModel* fXSModel;
MemoryManager* fMemoryManager;
XMLSize_t fId;
};
inline XSConstants::COMPONENT_TYPE XSObject::getType() const
{
return fComponentType;
}
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,198 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: XSParticle.hpp 883665 2009-11-24 11:41:38Z borisk $
*/
#if !defined(XERCESC_INCLUDE_GUARD_XSPARTICLE_HPP)
#define XERCESC_INCLUDE_GUARD_XSPARTICLE_HPP
#include <xercesc/framework/psvi/XSObject.hpp>
XERCES_CPP_NAMESPACE_BEGIN
/**
* This class describes all properties of a Schema Particle
* component.
* This is *always* owned by the validator /parser object from which
* it is obtained.
*/
// forward declarations
class XSElementDeclaration;
class XSModelGroup;
class XSWildcard;
class XMLPARSER_EXPORT XSParticle : public XSObject
{
public:
// possible terms of this particle
enum TERM_TYPE {
/*
* an empty particle
*/
TERM_EMPTY = 0,
/*
* the particle has element content
*/
TERM_ELEMENT = XSConstants::ELEMENT_DECLARATION,
/*
* the particle's content is a model group
*/
TERM_MODELGROUP = XSConstants::MODEL_GROUP_DEFINITION,
/*
* the particle's content is a wildcard
*/
TERM_WILDCARD = XSConstants::WILDCARD
};
// Constructors and Destructor
// -----------------------------------------------------------------------
/** @name Constructors */
//@{
/**
* The default constructor
*
* @param termType
* @param xsModel
* @param particleTerm
* @param minOccurs
* @param maxOccurs
* @param unbounded
* @param manager The configurable memory manager
*/
XSParticle
(
TERM_TYPE termType
, XSModel* const xsModel
, XSObject* const particleTerm
, XMLSize_t minOccurs
, XMLSize_t maxOccurs
, bool unbounded
, MemoryManager* const manager
);
//@};
/** @name Destructor */
//@{
~XSParticle();
//@}
//---------------------
/** @name XSParticle methods */
//@{
/**
* [min occurs]: determines the minimum number of terms that can occur.
*/
XMLSize_t getMinOccurs() const;
/**
* [max occurs] determines the maximum number of terms that can occur. To
* query for value of unbounded use <code>maxOccursUnbounded</code>.
*/
XMLSize_t getMaxOccurs() const;
/**
* [max occurs] whether the maxOccurs value is unbounded.
*/
bool getMaxOccursUnbounded() const;
/**
* Returns the type of the [term]: one of
* TERM_EMPTY, TERM_ELEMENT, TERM_MODELGROUP, or TERM_WILDCARD.
*/
TERM_TYPE getTermType() const;
/**
* If this particle has an [element declaration] for its term,
* this method returns that declaration; otherwise, it returns 0.
* @returns The element declaration that is the [term] of this Particle
* if and only if getTermType() == TERM_ELEMENT.
*/
XSElementDeclaration *getElementTerm();
/**
* If this particle has a [model group] for its term,
* this method returns that definition; otherwise, it returns 0.
* @returns The model group that is the [term] of this Particle
* if and only if getTermType() == TERM_MODELGROUP.
*/
XSModelGroup *getModelGroupTerm();
/**
* If this particle has an [wildcard] for its term,
* this method returns that declaration; otherwise, it returns 0.
* @returns The wildcard declaration that is the [term] of this Particle
* if and only if getTermType() == TERM_WILDCARD.
*/
XSWildcard *getWildcardTerm();
//@}
//----------------------------------
/** methods needed by implementation */
//@{
//@}
private:
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
XSParticle(const XSParticle&);
XSParticle & operator=(const XSParticle &);
protected:
// -----------------------------------------------------------------------
// data members
// -----------------------------------------------------------------------
TERM_TYPE fTermType;
XMLSize_t fMinOccurs;
XMLSize_t fMaxOccurs;
bool fUnbounded;
XSObject* fTerm;
};
inline XMLSize_t XSParticle::getMinOccurs() const
{
return fMinOccurs;
}
inline XMLSize_t XSParticle::getMaxOccurs() const
{
return fMaxOccurs;
}
inline bool XSParticle::getMaxOccursUnbounded() const
{
return fUnbounded;
}
inline XSParticle::TERM_TYPE XSParticle::getTermType() const
{
return fTermType;
}
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,458 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: XSSimpleTypeDefinition.hpp 527149 2007-04-10 14:56:39Z amassari $
*/
#if !defined(XERCESC_INCLUDE_GUARD_XSSIMPLETYPEDEFINITION_HPP)
#define XERCESC_INCLUDE_GUARD_XSSIMPLETYPEDEFINITION_HPP
#include <xercesc/framework/psvi/XSTypeDefinition.hpp>
XERCES_CPP_NAMESPACE_BEGIN
/**
* This class represents a simpleType definition
* schema component.
* This is *always* owned by the validator /parser object from which
* it is obtained.
*
*/
// forward declarations
class XSAnnotation;
class XSFacet;
class XSMultiValueFacet;
class DatatypeValidator;
class XMLPARSER_EXPORT XSSimpleTypeDefinition : public XSTypeDefinition
{
public:
// Variety definitions
enum VARIETY {
/**
* The variety is absent for the anySimpleType definition.
*/
VARIETY_ABSENT = 0,
/**
* <code>Atomic</code> type.
*/
VARIETY_ATOMIC = 1,
/**
* <code>List</code> type.
*/
VARIETY_LIST = 2,
/**
* <code>Union</code> type.
*/
VARIETY_UNION = 3
};
// Facets
enum FACET {
/**
* No facets defined.
*/
FACET_NONE = 0,
/**
* 4.3.1 Length
*/
FACET_LENGTH = 1,
/**
* 4.3.2 minLength.
*/
FACET_MINLENGTH = 2,
/**
* 4.3.3 maxLength.
*/
FACET_MAXLENGTH = 4,
/**
* 4.3.4 pattern.
*/
FACET_PATTERN = 8,
/**
* 4.3.5 whitespace.
*/
FACET_WHITESPACE = 16,
/**
* 4.3.7 maxInclusive.
*/
FACET_MAXINCLUSIVE = 32,
/**
* 4.3.9 maxExclusive.
*/
FACET_MAXEXCLUSIVE = 64,
/**
* 4.3.9 minExclusive.
*/
FACET_MINEXCLUSIVE = 128,
/**
* 4.3.10 minInclusive.
*/
FACET_MININCLUSIVE = 256,
/**
* 4.3.11 totalDigits .
*/
FACET_TOTALDIGITS = 512,
/**
* 4.3.12 fractionDigits.
*/
FACET_FRACTIONDIGITS = 1024,
/**
* 4.3.5 enumeration.
*/
FACET_ENUMERATION = 2048
};
// possible order relations
enum ORDERING {
/**
* A constant defined for the 'ordered' fundamental facet: Not ordered.
*/
ORDERED_FALSE = 0,
/**
* A constant defined for the 'ordered' fundamental facet: partially
* ordered.
*/
ORDERED_PARTIAL = 1,
/**
* A constant defined for the 'ordered' fundamental facet: total ordered.
*/
ORDERED_TOTAL = 2
};
// Constructors and Destructor
// -----------------------------------------------------------------------
/** @name Constructors */
//@{
/**
* The default constructor
*
* @param datatypeValidator
* @param stVariety
* @param xsBaseType
* @param primitiveOrItemType
* @param memberTypes
* @param headAnnot
* @param xsModel
* @param manager The configurable memory manager
*/
XSSimpleTypeDefinition
(
DatatypeValidator* const datatypeValidator
, VARIETY stVariety
, XSTypeDefinition* const xsBaseType
, XSSimpleTypeDefinition* const primitiveOrItemType
, XSSimpleTypeDefinitionList* const memberTypes
, XSAnnotation* headAnnot
, XSModel* const xsModel
, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
//@};
/** @name Destructor */
//@{
~XSSimpleTypeDefinition();
//@}
//---------------------
/** @name XSSimpleTypeDefinition methods */
//@{
/**
* [variety]: one of {atomic, list, union} or absent
*/
VARIETY getVariety() const;
/**
* If variety is <code>atomic</code> the primitive type definition (a
* built-in primitive datatype definition or the simple ur-type
* definition) is available, otherwise <code>null</code>.
*/
XSSimpleTypeDefinition *getPrimitiveType();
/**
* If variety is <code>list</code> the item type definition (an atomic or
* union simple type definition) is available, otherwise
* <code>null</code>.
*/
XSSimpleTypeDefinition *getItemType();
/**
* If variety is <code>union</code> the list of member type definitions (a
* non-empty sequence of simple type definitions) is available,
* otherwise <code>null</code>.
*/
XSSimpleTypeDefinitionList *getMemberTypes() const;
/**
* [facets]: get all facets defined on this type. The value is a bit
* combination of FACET_XXX constants of all defined facets.
*/
int getDefinedFacets() const;
/**
* Convenience method. [Facets]: check whether a facet is defined on this
* type.
* @param facetName The name of the facet.
* @return True if the facet is defined, false otherwise.
*/
bool isDefinedFacet(FACET facetName);
/**
* [facets]: get all facets defined and fixed on this type.
*/
int getFixedFacets() const;
/**
* Convenience method. [Facets]: check whether a facet is defined and
* fixed on this type.
* @param facetName The name of the facet.
* @return True if the facet is fixed, false otherwise.
*/
bool isFixedFacet(FACET facetName);
/**
* Convenience method. Returns a value of a single constraining facet for
* this simple type definition. This method must not be used to retrieve
* values for <code>enumeration</code> and <code>pattern</code> facets.
* @param facetName The name of the facet, i.e.
* <code>FACET_LENGTH, FACET_TOTALDIGITS </code> (see
* <code>XSConstants</code>).To retrieve value for pattern or
* enumeration, see <code>enumeration</code> and <code>pattern</code>.
* @return A value of the facet specified in <code>facetName</code> for
* this simple type definition or <code>null</code>.
*/
const XMLCh *getLexicalFacetValue(FACET facetName);
/**
* Returns a list of enumeration values.
*/
StringList *getLexicalEnumeration();
/**
* Returns a list of pattern values.
*/
StringList *getLexicalPattern();
/**
* Fundamental Facet: ordered
*/
ORDERING getOrdered() const;
/**
* Fundamental Facet: cardinality.
*/
bool getFinite() const;
/**
* Fundamental Facet: bounded.
*/
bool getBounded() const;
/**
* Fundamental Facet: numeric.
*/
bool getNumeric() const;
/**
* Optional. A set of [annotation]s.
*/
XSAnnotationList *getAnnotations();
/**
* @return list of constraining facets.
* This method must not be used to retrieve
* values for <code>enumeration</code> and <code>pattern</code> facets.
*/
XSFacetList *getFacets();
/**
* @return list of enumeration and pattern facets.
*/
XSMultiValueFacetList *getMultiValueFacets();
/**
* The name of type <code>NCName</code> of this declaration as defined in
* XML Namespaces.
*/
const XMLCh* getName() const;
/**
* The [target namespace] of this object, or <code>null</code> if it is
* unspecified.
*/
const XMLCh* getNamespace();
/**
* A namespace schema information item corresponding to the target
* namespace of the component, if it's globally declared; or null
* otherwise.
*/
XSNamespaceItem *getNamespaceItem();
/**
* A boolean that specifies if the type definition is
* anonymous. Convenience attribute.
*/
bool getAnonymous() const;
/**
* {base type definition}: either a simple type definition or a complex
* type definition.
*/
XSTypeDefinition *getBaseType();
/**
* Convenience method: check if this type is derived from the given
* <code>ancestorType</code>.
* @param ancestorType An ancestor type definition.
* @return Return true if this type is derived from
* <code>ancestorType</code>.
*/
bool derivedFromType(const XSTypeDefinition* const ancestorType);
/**
*
*/
inline DatatypeValidator* getDatatypeValidator() const;
//@}
//----------------------------------
/** methods needed by implementation */
//@{
//@}
private:
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
XSSimpleTypeDefinition(const XSSimpleTypeDefinition&);
XSSimpleTypeDefinition & operator=(const XSSimpleTypeDefinition &);
/**
* Helper method for construct
*/
void setFacetInfo
(
int definedFacets
, int fixedFacets
, XSFacetList* const xsFacetList
, XSMultiValueFacetList* const xsMultiValueFacetList
, StringList* const patternList
);
void setPrimitiveType(XSSimpleTypeDefinition* const toSet);
friend class XSObjectFactory;
protected:
// -----------------------------------------------------------------------
// data members
// -----------------------------------------------------------------------
int fDefinedFacets;
int fFixedFacets;
VARIETY fVariety;
DatatypeValidator* fDatatypeValidator;
XSFacetList* fXSFacetList;
XSMultiValueFacetList* fXSMultiValueFacetList;
StringList* fPatternList;
XSSimpleTypeDefinition* fPrimitiveOrItemType;
XSSimpleTypeDefinitionList* fMemberTypes;
XSAnnotationList* fXSAnnotationList;
};
inline XSSimpleTypeDefinition::VARIETY XSSimpleTypeDefinition::getVariety() const
{
return fVariety;
}
inline XSSimpleTypeDefinition* XSSimpleTypeDefinition::getPrimitiveType()
{
if (fVariety == VARIETY_ATOMIC)
return fPrimitiveOrItemType;
return 0;
}
inline XSSimpleTypeDefinition* XSSimpleTypeDefinition::getItemType()
{
if (fVariety == VARIETY_LIST)
return fPrimitiveOrItemType;
return 0;
}
inline XSSimpleTypeDefinitionList* XSSimpleTypeDefinition::getMemberTypes() const
{
return fMemberTypes;
}
inline int XSSimpleTypeDefinition::getDefinedFacets() const
{
return fDefinedFacets;
}
inline int XSSimpleTypeDefinition::getFixedFacets() const
{
return fFixedFacets;
}
inline StringList* XSSimpleTypeDefinition::getLexicalPattern()
{
return fPatternList;
}
inline XSFacetList* XSSimpleTypeDefinition::getFacets()
{
return fXSFacetList;
}
inline XSMultiValueFacetList* XSSimpleTypeDefinition::getMultiValueFacets()
{
return fXSMultiValueFacetList;
}
inline XSAnnotationList *XSSimpleTypeDefinition::getAnnotations()
{
return fXSAnnotationList;
}
inline void
XSSimpleTypeDefinition::setPrimitiveType(XSSimpleTypeDefinition* const toSet)
{
fPrimitiveOrItemType = toSet;
}
inline DatatypeValidator*
XSSimpleTypeDefinition::getDatatypeValidator() const
{
return fDatatypeValidator;
}
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,214 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: XSTypeDefinition.hpp 527149 2007-04-10 14:56:39Z amassari $
*/
#if !defined(XERCESC_INCLUDE_GUARD_XSTYPEDEFINITION_HPP)
#define XERCESC_INCLUDE_GUARD_XSTYPEDEFINITION_HPP
#include <xercesc/framework/psvi/XSObject.hpp>
XERCES_CPP_NAMESPACE_BEGIN
// forward declarations
class XSNamespaceItem;
/**
* This class represents a complexType or simpleType definition.
* This is *always* owned by the validator /parser object from which
* it is obtained.
*
*/
class XMLPARSER_EXPORT XSTypeDefinition : public XSObject
{
public:
enum TYPE_CATEGORY {
/**
* This constant value signifies a complex type.
*/
COMPLEX_TYPE = 15,
/**
* This constant value signifies a simple type.
*/
SIMPLE_TYPE = 16
};
// Constructors and Destructor
// -----------------------------------------------------------------------
/** @name Constructors */
//@{
/**
* The default constructor
*
* @param typeCategory
* @param xsBaseType
* @param xsModel
* @param manager The configurable memory manager
*/
XSTypeDefinition
(
TYPE_CATEGORY typeCategory
, XSTypeDefinition* const xsBaseType
, XSModel* const xsModel
, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
//@};
/** @name Destructor */
//@{
virtual ~XSTypeDefinition();
//@}
//---------------------
/** @name overloaded XSObject methods */
//@{
/**
* The name of type <code>NCName</code> of this declaration as defined in
* XML Namespaces.
*/
virtual const XMLCh* getName() const = 0;
/**
* The [target namespace] of this object, or <code>null</code> if it is
* unspecified.
*/
virtual const XMLCh* getNamespace() = 0;
/**
* A namespace schema information item corresponding to the target
* namespace of the component, if it's globally declared; or null
* otherwise.
*/
virtual XSNamespaceItem *getNamespaceItem() = 0;
//@}
//---------------------
/** @name XSTypeDefinition methods */
//@{
/**
* Return whether this type definition is a simple type or complex type.
*/
TYPE_CATEGORY getTypeCategory() const;
/**
* {base type definition}: either a simple type definition or a complex
* type definition.
*/
virtual XSTypeDefinition *getBaseType() = 0;
/**
* {final}. For complex type definition it is a subset of {extension,
* restriction}. For simple type definition it is a subset of
* {extension, list, restriction, union}.
* @param toTest Extension, restriction, list, union constants
* (defined in <code>XSObject</code>).
* @return True if toTest is in the final set, otherwise false.
*/
bool isFinal(short toTest);
/**
* For complex types the returned value is a bit combination of the subset
* of {<code>DERIVATION_EXTENSION, DERIVATION_RESTRICTION</code>}
* corresponding to <code>final</code> set of this type or
* <code>DERIVATION_NONE</code>. For simple types the returned value is
* a bit combination of the subset of {
* <code>DERIVATION_RESTRICTION, DERIVATION_EXTENSION, DERIVATION_UNION, DERIVATION_LIST</code>
* } corresponding to <code>final</code> set of this type or
* <code>DERIVATION_NONE</code>.
*/
short getFinal() const;
/**
* A boolean that specifies if the type definition is
* anonymous. Convenience attribute.
*/
virtual bool getAnonymous() const = 0;
/**
* Convenience method: check if this type is derived from the given
* <code>ancestorType</code>.
* @param ancestorType An ancestor type definition.
* @return Return true if this type is derived from
* <code>ancestorType</code>.
*/
virtual bool derivedFromType(const XSTypeDefinition* const ancestorType) = 0;
/**
* Convenience method: check if this type is derived from the given
* ancestor type.
* @param typeNamespace An ancestor type namespace.
* @param name An ancestor type name.
* @return Return true if this type is derived from
* the ancestor defined by <code>typeNamespace</code> and <code>name</code>.
*/
bool derivedFrom(const XMLCh* typeNamespace,
const XMLCh* name);
//@}
//----------------------------------
/** methods needed by implementation */
//@{
//@}
private:
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
XSTypeDefinition(const XSTypeDefinition&);
XSTypeDefinition & operator=(const XSTypeDefinition &);
protected:
// -----------------------------------------------------------------------
// data members
// -----------------------------------------------------------------------
// fTypeCategory
// whether this is a simpleType or complexType
// fFinal
// the final properties which is set by the derived class.
TYPE_CATEGORY fTypeCategory;
short fFinal;
XSTypeDefinition* fBaseType; // owned by XSModel
};
inline XSTypeDefinition::TYPE_CATEGORY XSTypeDefinition::getTypeCategory() const
{
return fTypeCategory;
}
inline short XSTypeDefinition::getFinal() const
{
return fFinal;
}
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,406 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: XSValue.hpp 932887 2010-04-11 13:04:59Z borisk $
*/
#if !defined(XERCESC_INCLUDE_GUARD_XSVALUE_HPP)
#define XERCESC_INCLUDE_GUARD_XSVALUE_HPP
#include <xercesc/util/PlatformUtils.hpp>
#include <xercesc/util/ValueHashTableOf.hpp>
XERCES_CPP_NAMESPACE_BEGIN
class RegularExpression;
class XMLPARSER_EXPORT XSValue : public XMemory
{
public:
enum DataType {
dt_string = 0,
dt_boolean = 1,
dt_decimal = 2,
dt_float = 3,
dt_double = 4,
dt_duration = 5,
dt_dateTime = 6,
dt_time = 7,
dt_date = 8,
dt_gYearMonth = 9,
dt_gYear = 10,
dt_gMonthDay = 11,
dt_gDay = 12,
dt_gMonth = 13,
dt_hexBinary = 14,
dt_base64Binary = 15,
dt_anyURI = 16,
dt_QName = 17,
dt_NOTATION = 18,
dt_normalizedString = 19,
dt_token = 20,
dt_language = 21,
dt_NMTOKEN = 22,
dt_NMTOKENS = 23,
dt_Name = 24,
dt_NCName = 25,
dt_ID = 26,
dt_IDREF = 27,
dt_IDREFS = 28,
dt_ENTITY = 29,
dt_ENTITIES = 30,
dt_integer = 31,
dt_nonPositiveInteger = 32,
dt_negativeInteger = 33,
dt_long = 34,
dt_int = 35,
dt_short = 36,
dt_byte = 37,
dt_nonNegativeInteger = 38,
dt_unsignedLong = 39,
dt_unsignedInt = 40,
dt_unsignedShort = 41,
dt_unsignedByte = 42,
dt_positiveInteger = 43,
dt_MAXCOUNT = 44
};
enum XMLVersion {
ver_10,
ver_11
};
enum Status {
st_Init,
st_NoContent,
st_NoCanRep,
st_NoActVal,
st_NotSupported,
st_CantCreateRegEx,
st_FOCA0002, //invalid lexical value
st_FOCA0001, //input value too large/too small for decimal
st_FOCA0003, //input value too large for integer
st_FODT0003, //invalid timezone value
st_UnknownType
};
enum DataGroup {
dg_numerics,
dg_datetimes,
dg_strings
};
enum DoubleFloatType
{
DoubleFloatType_NegINF,
DoubleFloatType_PosINF,
DoubleFloatType_NaN,
DoubleFloatType_Zero,
DoubleFloatType_Normal
};
// Constructors and Destructor
// -----------------------------------------------------------------------
/** @name Destructor */
//@{
~XSValue();
//@}
//---------------------------------
/** @name Externalization methods */
//@{
/**
* Validate a given string of the data type specified
*
* @param content data to be validated
* @param datatype schema datatype
* @param status validation status which is set upon validation fails
* @param version xml version
* @param manager memory manager provided
*/
static
bool validate
(
const XMLCh* const content
, DataType datatype
, Status& status
, XMLVersion version = ver_10
, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
/**
* Get the canonical representation for a given string of the
* data type specified
*
* @param content raw data
* @param datatype schema datatype
* @param status validation status which is set upon validation fails
* @param version xml version
* @param toValidate to validate the content before generate canonical representation
* @param manager memory manager provided
*/
static
XMLCh* getCanonicalRepresentation
(
const XMLCh* const content
, DataType datatype
, Status& status
, XMLVersion version = ver_10
, bool toValidate = true
, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
/**
* Get the actual value, in the form of XSValue, for a given string of the
* data type specified
*
* Client application is responsible for the deletion of the XSValue returned.
*
* @param content raw data
* @param datatype schema datatype
* @param status validation status which is set upon validation fails
* @param version xml version
* @param toValidate to validate the content before generate actual value
* @param manager memory manager provided
*/
static
XSValue* getActualValue
(
const XMLCh* const content
, DataType datatype
, Status& status
, XMLVersion version = ver_10
, bool toValidate = true
, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
static
DataType getDataType (const XMLCh* const dtString);
//@}
//----------------------------------
/** public data */
struct XSValue_Data {
DataType f_datatype;
union {
bool f_bool;
char f_char;
unsigned char f_uchar;
short f_short;
unsigned short f_ushort;
int f_int;
unsigned int f_uint;
long f_long;
unsigned long f_ulong;
float f_float;
double f_double;
XMLCh* f_strVal;
XMLByte* f_byteVal;
struct decimal {
double f_dvalue;
} f_decimal;
struct datetime {
int f_year;
int f_month;
int f_day;
int f_hour;
int f_min;
int f_second;
double f_milisec;
} f_datetime;
struct doubletype {
double f_double;
DoubleFloatType f_doubleEnum;
} f_doubleType;
struct floattype {
float f_float;
DoubleFloatType f_floatEnum;
} f_floatType;
} fValue;
} fData;
private:
typedef union
{
long f_long;
unsigned long f_ulong;
} t_value;
/** @name Constructors */
//@{
/**
* The default constructor
*
*/
XSValue(
DataType const dt
, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
//@};
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
XSValue(const XSValue&);
XSValue & operator=(const XSValue &);
//---------------------------------
/** @name Helpers */
//@{
static const XSValue::DataGroup inGroup[];
static const bool numericSign[];
//@}
static
bool validateNumerics
(
const XMLCh* const content
, DataType datatype
, Status& status
, MemoryManager* const manager
);
static
bool validateDateTimes
(
const XMLCh* const content
, DataType datatype
, Status& status
, MemoryManager* const manager
);
static
bool validateStrings
(
const XMLCh* const content
, DataType datatype
, Status& status
, XMLVersion version
, MemoryManager* const manager
);
static
XMLCh* getCanRepNumerics
(
const XMLCh* const content
, DataType datatype
, Status& status
, bool toValidate
, MemoryManager* const manager
);
static
XMLCh* getCanRepDateTimes
(
const XMLCh* const content
, DataType datatype
, Status& status
, bool toValidate
, MemoryManager* const manager
);
static
XMLCh* getCanRepStrings
(
const XMLCh* const content
, DataType datatype
, Status& status
, XMLVersion version
, bool toValidate
, MemoryManager* const manager
);
static
XSValue* getActValNumerics
(
const XMLCh* const content
, DataType datatype
, Status& status
, bool toValidate
, MemoryManager* const manager
);
static
XSValue* getActValDateTimes
(
const XMLCh* const content
, DataType datatype
, Status& status
, MemoryManager* const manager
);
static
XSValue* getActValStrings
(
const XMLCh* const content
, DataType datatype
, Status& status
, XMLVersion version
, bool toValidate
, MemoryManager* const manager
);
static
bool getActualNumericValue
(
const XMLCh* const content
, Status& status
, t_value& retVal
, MemoryManager* const manager
, DataType datatype
);
static ValueHashTableOf<DataType>* fDataTypeRegistry;
// -----------------------------------------------------------------------
// static helper methods
// -----------------------------------------------------------------------
static void initializeRegistry();
friend class XMLInitializer;
// -----------------------------------------------------------------------
// data members
// -----------------------------------------------------------------------
bool fMemAllocated;
MemoryManager* fMemoryManager;
};
XERCES_CPP_NAMESPACE_END
#endif

View File

@@ -0,0 +1,201 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/*
* $Id: XSWildcard.hpp 527149 2007-04-10 14:56:39Z amassari $
*/
#if !defined(XERCESC_INCLUDE_GUARD_XSWILDCARD_HPP)
#define XERCESC_INCLUDE_GUARD_XSWILDCARD_HPP
#include <xercesc/framework/psvi/XSObject.hpp>
XERCES_CPP_NAMESPACE_BEGIN
/**
* This class describes all properties of a Schema Wildcard
* component.
* This is *always* owned by the validator /parser object from which
* it is obtained.
*/
// forward declarations
class XSAnnotation;
class SchemaAttDef;
class ContentSpecNode;
class XMLPARSER_EXPORT XSWildcard : public XSObject
{
public:
// Namespace Constraint
enum NAMESPACE_CONSTRAINT {
/**
* Namespace Constraint: any namespace is allowed.
*/
NSCONSTRAINT_ANY = 1,
/**
* Namespace Constraint: namespaces in the list are not allowed.
*/
NSCONSTRAINT_NOT = 2,
/**
* Namespace Constraint: namespaces in the list are allowed.
*/
NSCONSTRAINT_DERIVATION_LIST = 3
};
// Process contents
enum PROCESS_CONTENTS {
/**
* There must be a top-level declaration for the item available, or the
* item must have an xsi:type, and the item must be valid as appropriate.
*/
PC_STRICT = 1,
/**
* No constraints at all: the item must simply be well-formed XML.
*/
PC_SKIP = 2,
/**
* If the item, or any items among its [children] is an element
* information item, has a uniquely determined declaration available, it
* must be valid with respect to that definition, that is, validate
* where you can, don't worry when you can't.
*/
PC_LAX = 3
};
// Constructors and Destructor
// -----------------------------------------------------------------------
/** @name Constructors */
//@{
/**
* The default constructor
*
* @param attWildCard
* @param annot
* @param xsModel
* @param manager The configurable memory manager
*/
XSWildcard
(
SchemaAttDef* const attWildCard
, XSAnnotation* const annot
, XSModel* const xsModel
, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
XSWildcard
(
const ContentSpecNode* const elmWildCard
, XSAnnotation* const annot
, XSModel* const xsModel
, MemoryManager* const manager = XMLPlatformUtils::fgMemoryManager
);
//@}
/** @name Destructor */
//@{
~XSWildcard();
//@}
//---------------------
/** @name XSWildcard methods */
//@{
/**
* Namespace constraint: A constraint type: any, not, list.
*/
NAMESPACE_CONSTRAINT getConstraintType() const;
/**
* Namespace constraint. For <code>constraintType</code>
* <code>NSCONSTRAINT_DERIVATION_LIST</code>, the list contains allowed namespaces.
* For <code>constraintType</code> <code>NSCONSTRAINT_NOT</code>, the
* list contains disallowed namespaces.
*/
StringList *getNsConstraintList();
/**
* [process contents]: one of skip, lax or strict. Valid constants values
* are: <code>PC_SKIP, PC_LAX, PC_STRICT</code>.
*/
PROCESS_CONTENTS getProcessContents() const;
/**
* Optional. An [annotation].
*/
XSAnnotation *getAnnotation() const;
//@}
//----------------------------------
/** methods needed by implementation */
//@{
//@}
private:
// -----------------------------------------------------------------------
// Unimplemented constructors and operators
// -----------------------------------------------------------------------
XSWildcard(const XSWildcard&);
XSWildcard & operator=(const XSWildcard &);
/**
* Build namespace list
*/
void buildNamespaceList(const ContentSpecNode* const rootNode);
protected:
// -----------------------------------------------------------------------
// data members
// -----------------------------------------------------------------------
NAMESPACE_CONSTRAINT fConstraintType;
PROCESS_CONTENTS fProcessContents;
StringList* fNsConstraintList;
XSAnnotation* fAnnotation;
};
inline XSAnnotation *XSWildcard::getAnnotation() const
{
return fAnnotation;
}
inline XSWildcard::PROCESS_CONTENTS XSWildcard::getProcessContents() const
{
return fProcessContents;
}
inline StringList* XSWildcard::getNsConstraintList()
{
return fNsConstraintList;
}
inline XSWildcard::NAMESPACE_CONSTRAINT XSWildcard::getConstraintType() const
{
return fConstraintType;
}
XERCES_CPP_NAMESPACE_END
#endif