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$
*/
#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() const;
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
XSNamedMap.hpp
XSObject.hpp
XMLPARSER_EXPORT
#define XMLPARSER_EXPORT
Definition XercesDefs.hpp:163
XERCES_CPP_NAMESPACE_BEGIN
#define XERCES_CPP_NAMESPACE_BEGIN
Definition XercesDefs.hpp:112
XERCES_CPP_NAMESPACE_END
#define XERCES_CPP_NAMESPACE_END
Definition XercesDefs.hpp:113
XMLCh
char16_t XMLCh
Definition Xerces_autoconf_config.hpp:120
MemoryManager
Configurable memory manager.
Definition MemoryManager.hpp:40
XMLPlatformUtils::fgMemoryManager
static MemoryManager * fgMemoryManager
The configurable memory manager.
Definition PlatformUtils.hpp:121
XSAnnotation
Definition XSAnnotation.hpp:42
XSComplexTypeDefinition
Definition XSComplexTypeDefinition.hpp:46
XSConstants::DERIVATION_TYPE
DERIVATION_TYPE
Definition XSConstants.hpp:122
XSConstants::VALUE_CONSTRAINT
VALUE_CONSTRAINT
Definition XSConstants.hpp:172
XSConstants::SCOPE
SCOPE
Definition XSConstants.hpp:152
XSConstants::SCOPE_ABSENT
@ SCOPE_ABSENT
The scope of a declaration within named model groups or attribute groups is absent.
Definition XSConstants.hpp:159
XSElementDeclaration
Definition XSElementDeclaration.hpp:45
XSElementDeclaration::getScope
XSConstants::SCOPE getScope() const
Optional.
Definition XSElementDeclaration.hpp:285
XSElementDeclaration::fDisallowedSubstitutions
short fDisallowedSubstitutions
Definition XSElementDeclaration.hpp:244
XSElementDeclaration::getEnclosingCTDefinition
XSComplexTypeDefinition * getEnclosingCTDefinition() const
The complex type definition for locally scoped declarations (see scope).
Definition XSElementDeclaration.hpp:290
XSElementDeclaration::fIdentityConstraints
XSNamedMap< XSIDCDefinition > * fIdentityConstraints
Definition XSElementDeclaration.hpp:252
XSElementDeclaration::XSElementDeclaration
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)
The default constructor.
XSElementDeclaration::~XSElementDeclaration
~XSElementDeclaration()
XSElementDeclaration::getNamespaceItem
XSNamespaceItem * getNamespaceItem()
A namespace schema information item corresponding to the target namespace of the component,...
XSElementDeclaration::getDisallowedSubstitutions
short getDisallowedSubstitutions() const
[disallowed substitutions]: the returned value is a bit combination of the subset of { DERIVATION_SUB...
Definition XSElementDeclaration.hpp:275
XSElementDeclaration::fScope
XSConstants::SCOPE fScope
Definition XSElementDeclaration.hpp:246
XSElementDeclaration::fAnnotation
XSAnnotation * fAnnotation
Definition XSElementDeclaration.hpp:251
XSElementDeclaration::setTypeDefinition
void setTypeDefinition(XSTypeDefinition *typeDefinition)
methods needed by implementation
Definition XSElementDeclaration.hpp:295
XSElementDeclaration::getNamespace
const XMLCh * getNamespace() const
The [target namespace] of this object, or null if it is unspecified.
XSElementDeclaration::getConstraintType
XSConstants::VALUE_CONSTRAINT getConstraintType() const
[Value constraint]: one of VC_NONE, VC_DEFAULT, VC_FIXED.
XSElementDeclaration::fSubstitutionGroupAffiliation
XSElementDeclaration * fSubstitutionGroupAffiliation
Definition XSElementDeclaration.hpp:250
XSElementDeclaration::fSchemaElementDecl
SchemaElementDecl * fSchemaElementDecl
Definition XSElementDeclaration.hpp:247
XSElementDeclaration::fTypeDefinition
XSTypeDefinition * fTypeDefinition
Definition XSElementDeclaration.hpp:248
XSElementDeclaration::isDisallowedSubstitution
bool isDisallowedSubstitution(XSConstants::DERIVATION_TYPE disallowed)
Convenience method.
XSElementDeclaration::getSubstitutionGroupAffiliation
XSElementDeclaration * getSubstitutionGroupAffiliation() const
[substitution group affiliation]: optional.
Definition XSElementDeclaration.hpp:265
XSElementDeclaration::getAbstract
bool getAbstract() const
{abstract} A boolean.
XSElementDeclaration::getAnnotation
XSAnnotation * getAnnotation() const
Optional.
Definition XSElementDeclaration.hpp:280
XSElementDeclaration::fSubstitutionGroupExclusions
short fSubstitutionGroupExclusions
Definition XSElementDeclaration.hpp:245
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::isSubstitutionGroupExclusion
bool isSubstitutionGroupExclusion(XSConstants::DERIVATION_TYPE exclusion)
Convenience method.
XSElementDeclaration::getIdentityConstraints
XSNamedMap< XSIDCDefinition > * getIdentityConstraints()
identity-constraint definitions: a set of constraint definitions.
Definition XSElementDeclaration.hpp:260
XSElementDeclaration::getTypeDefinition
XSTypeDefinition * getTypeDefinition() const
[type definition]: either a simple type definition or a complex type definition.
Definition XSElementDeclaration.hpp:255
XSElementDeclaration::getConstraintValue
const XMLCh * getConstraintValue()
[Value constraint]: the actual value with respect to the [type definition].
XSElementDeclaration::fEnclosingTypeDefinition
XSComplexTypeDefinition * fEnclosingTypeDefinition
Definition XSElementDeclaration.hpp:249
XSElementDeclaration::getNillable
bool getNillable() const
If nillable is true, then an element may also be valid if it carries the namespace qualified attribut...
XSElementDeclaration::getName
const XMLCh * getName() const
The name of type NCName of this declaration as defined in XML Namespaces.
XSIDCDefinition
Definition XSIDCDefinition.hpp:41
XSModel
Definition XSModel.hpp:60
XSNamedMap
Definition XSNamedMap.hpp:41
XSNamespaceItem
Definition XSNamespaceItem.hpp:54
XSObject
Definition XSObject.hpp:43
XSTypeDefinition
This class represents a complexType or simpleType definition.
Definition XSTypeDefinition.hpp:40