XSElementDeclaration.hpp
Go to the documentation of this file.
/*
* 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
// forward declarations
class XSAnnotation;
class XSComplexTypeDefinition;
class XSIDCDefinition;
class XSTypeDefinition;
class SchemaElementDecl;
class XMLPARSER_EXPORT XSElementDeclaration : public XSObject
{
public:
// Constructors and Destructor
// -----------------------------------------------------------------------
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
);
~XSElementDeclaration();
//---------------------
const XMLCh* getName() const;
const XMLCh* getNamespace();
XSNamespaceItem *getNamespaceItem();
//---------------------
XSTypeDefinition *getTypeDefinition() const;
XSConstants::SCOPE getScope() const;
XSComplexTypeDefinition *getEnclosingCTDefinition() const;
XSConstants::VALUE_CONSTRAINT getConstraintType() const;
const XMLCh *getConstraintValue();
bool getNillable() const;
XSNamedMap <XSIDCDefinition> *getIdentityConstraints();
XSElementDeclaration *getSubstitutionGroupAffiliation() const;
bool isSubstitutionGroupExclusion(XSConstants::DERIVATION_TYPE exclusion);
short getSubstitutionGroupExclusions() const;
bool isDisallowedSubstitution(XSConstants::DERIVATION_TYPE disallowed);
short getDisallowedSubstitutions() const;
bool getAbstract() const;
XSAnnotation *getAnnotation() const;
//----------------------------------
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
XSIDCDefinition
Definition: XSIDCDefinition.hpp:40
XSElementDeclaration::fIdentityConstraints
XSNamedMap< XSIDCDefinition > * fIdentityConstraints
Definition: XSElementDeclaration.hpp:252
XSElementDeclaration::getScope
XSConstants::SCOPE getScope() const
Optional.
Definition: XSElementDeclaration.hpp:285
XSComplexTypeDefinition
Definition: XSComplexTypeDefinition.hpp:45
XMLPlatformUtils::fgMemoryManager
static MemoryManager * fgMemoryManager
The configurable memory manager.
Definition: PlatformUtils.hpp:121
XSElementDeclaration::getDisallowedSubstitutions
short getDisallowedSubstitutions() const
[disallowed substitutions]: the returned value is a bit combination of the subset of { DERIVATION_SUB...
Definition: XSElementDeclaration.hpp:275
XSConstants::DERIVATION_TYPE
DERIVATION_TYPE
Definition: XSConstants.hpp:122
XSObject::getNamespaceItem
virtual XSNamespaceItem * getNamespaceItem()
A namespace schema information item corresponding to the target namespace of the component, if it&#39;s globally declared; or null otherwise.
XSObject::getName
virtual const XMLCh * getName() const
The name of type NCName of this declaration as defined in XML Namespaces.
XSElementDeclaration::fSubstitutionGroupAffiliation
XSElementDeclaration * fSubstitutionGroupAffiliation
Definition: XSElementDeclaration.hpp:250
XSElementDeclaration::fSubstitutionGroupExclusions
short fSubstitutionGroupExclusions
Definition: XSElementDeclaration.hpp:245
XSElementDeclaration::getTypeDefinition
XSTypeDefinition * getTypeDefinition() const
[type definition]: either a simple type definition or a complex type definition.
Definition: XSElementDeclaration.hpp:255
XSElementDeclaration::getSubstitutionGroupExclusions
short getSubstitutionGroupExclusions() const
[substitution group exclusions]: the returned value is a bit combination of the subset of { DERIVATIO...
Definition: XSElementDeclaration.hpp:270
XSElementDeclaration::fScope
XSConstants::SCOPE fScope
Definition: XSElementDeclaration.hpp:246
XSNamespaceItem
Definition: XSNamespaceItem.hpp:53
XSElementDeclaration::fTypeDefinition
XSTypeDefinition * fTypeDefinition
Definition: XSElementDeclaration.hpp:248
XSElementDeclaration
Definition: XSElementDeclaration.hpp:44
XMLPARSER_EXPORT
#define XMLPARSER_EXPORT
Definition: XercesDefs.hpp:163
XSElementDeclaration::getEnclosingCTDefinition
XSComplexTypeDefinition * getEnclosingCTDefinition() const
The complex type definition for locally scoped declarations (see scope).
Definition: XSElementDeclaration.hpp:290
XSObject::getNamespace
virtual const XMLCh * getNamespace()
The [target namespace] of this object, or null if it is unspecified.
XSModel
Definition: XSModel.hpp:59
XSAnnotation
Definition: XSAnnotation.hpp:41
XSNamedMap.hpp
MemoryManager
Configurable memory manager.
Definition: MemoryManager.hpp:39
XSConstants::SCOPE_ABSENT
The scope of a declaration within named model groups or attribute groups is absent.
Definition: XSConstants.hpp:159
XERCES_CPP_NAMESPACE_BEGIN
#define XERCES_CPP_NAMESPACE_BEGIN
Definition: XercesDefs.hpp:112
XMLCh
wchar_t XMLCh
Definition: Xerces_autoconf_config.borland.hpp:92
XSConstants::SCOPE
SCOPE
Definition: XSConstants.hpp:152
XSElementDeclaration::fAnnotation
XSAnnotation * fAnnotation
Definition: XSElementDeclaration.hpp:251
XSObject
Definition: XSObject.hpp:42
XERCES_CPP_NAMESPACE_END
#define XERCES_CPP_NAMESPACE_END
Definition: XercesDefs.hpp:113
XSElementDeclaration::getSubstitutionGroupAffiliation
XSElementDeclaration * getSubstitutionGroupAffiliation() const
Definition: XSElementDeclaration.hpp:265
XSObject.hpp
XSElementDeclaration::setTypeDefinition
void setTypeDefinition(XSTypeDefinition *typeDefinition)
methods needed by implementation
Definition: XSElementDeclaration.hpp:295
XSNamedMap< XSIDCDefinition >
XSElementDeclaration::getAnnotation
XSAnnotation * getAnnotation() const
Optional.
Definition: XSElementDeclaration.hpp:280
XSElementDeclaration::fSchemaElementDecl
SchemaElementDecl * fSchemaElementDecl
Definition: XSElementDeclaration.hpp:247
XSElementDeclaration::fDisallowedSubstitutions
short fDisallowedSubstitutions
Definition: XSElementDeclaration.hpp:244
XSElementDeclaration::getIdentityConstraints
XSNamedMap< XSIDCDefinition > * getIdentityConstraints()
identity-constraint definitions: a set of constraint definitions.
Definition: XSElementDeclaration.hpp:260
XSConstants::VALUE_CONSTRAINT
VALUE_CONSTRAINT
Definition: XSConstants.hpp:172
XSElementDeclaration::fEnclosingTypeDefinition
XSComplexTypeDefinition * fEnclosingTypeDefinition
Definition: XSElementDeclaration.hpp:249
XSTypeDefinition
This class represents a complexType or simpleType definition.
Definition: XSTypeDefinition.hpp:39