📄 schemaelementdecl.hpp
字号:
* The {name} of the type definition, if it is not absent. * @deprecated; not thread-safe (will not work with xsi:type and shared grammars) */ const XMLCh* getTypeName() const; /** * true if the {name} of the type definition is absent, otherwise false. * @deprecated; not thread-safe (will not work with xsi:type and shared grammars) */ bool getTypeAnonymous() const; /** * If this method returns true and validity is VALID then the next three * produce accurate results * @return true if the element is validated using a union type * @deprecated; not thread-safe (will not work with xsi:type and shared grammars) */ bool isTypeDefinitionUnion() const; /** * The {target namespace} of the actual member type definition. * @deprecated; not thread-safe (will not work with xsi:type and shared grammars) */ const XMLCh* getMemberTypeUri() const; /** * @return true if the {name} of the actual member type definition is absent, otherwise false. * @deprecated; not thread-safe (will not work with xsi:type and shared grammars) */ bool getMemberTypeAnonymous() const; /** * @return the {name} of the actual member type definition, if it is not absent. * @deprecated; not thread-safe (will not work with xsi:type and shared grammars) */ const XMLCh* getMemberTypeName() const; /** * @deprecated; not thread-safe (will not work with xsi:type and shared grammars) */ virtual const XMLCh* getDOMTypeInfoUri() const; /** * @deprecated; not thread-safe (will not work with xsi:type and shared grammars) */ virtual const XMLCh* getDOMTypeInfoName() const; // ----------------------------------------------------------------------- // Setter methods // ----------------------------------------------------------------------- /** * @deprecated; not actually used */ void setElemId(unsigned int elemId); void setModelType(const SchemaElementDecl::ModelTypes toSet); void setPSVIScope(const PSVIDefs::PSVIScope toSet); void setDatatypeValidator(DatatypeValidator* newDatatypeValidator); void setEnclosingScope(const int enclosingScope); void setFinalSet(const int finalSet); void setBlockSet(const int blockSet); void setMiscFlags(const int flags); void setDefaultValue(const XMLCh* const value); void setComplexTypeInfo(ComplexTypeInfo* const typeInfo); /** * @deprecated; not thread-safe (will not work with xsi:type and shared grammars) */ void setXsiComplexTypeInfo(ComplexTypeInfo* const typeInfo); /** * @deprecated; not thread-safe (will not work with xsi:type and shared grammars) */ void setXsiSimpleTypeInfo(const DatatypeValidator* const dtv); void setAttWildCard(SchemaAttDef* const attWildCard); void setSubstitutionGroupElem(SchemaElementDecl* const elemDecl); /** * @deprecated; not thread-safe (will not work with xsi:type and shared grammars) */ void setValidity(PSVIDefs::Validity valid); /** * @deprecated; not thread-safe (will not work with xsi:type and shared grammars) */ void setValidationAttempted(PSVIDefs::Validation validation); /** * called when element content of this element was validated * @deprecated; not thread-safe (will not work with xsi:type and shared grammars) */ void updateValidityFromElement(const XMLElementDecl *decl, Grammar::GrammarType eleGrammar); //called when attribute content of this element was validated // @deprecated; should not be needed in a thread-safe implementation void updateValidityFromAttribute(const SchemaAttDef *def); /** * cleans up inbetween uses of the SchemaElementDecl. Resets xsiType, Validity etc. * @deprecated; not thread-safe (will not work with xsi:type and shared grammars) */ void reset(); // ----------------------------------------------------------------------- // IC methods // ----------------------------------------------------------------------- void addIdentityConstraint(IdentityConstraint* const ic); unsigned int getIdentityConstraintCount() const; IdentityConstraint* getIdentityConstraintAt(unsigned int index) const; /*** * Support for Serialization/De-serialization ***/ DECL_XSERIALIZABLE(SchemaElementDecl) virtual XMLElementDecl::objectType getObjectType() const;private : // ----------------------------------------------------------------------- // Unimplemented constructors and operators // ----------------------------------------------------------------------- SchemaElementDecl(const SchemaElementDecl&); SchemaElementDecl& operator=(const SchemaElementDecl&); // ----------------------------------------------------------------------- // Private data members // // fModelType // The content model type of this element. This tells us what kind // of content model to create. // // fDatatypeValidator // The DatatypeValidator used to validate this element type. // // fEnclosingScope // The enclosing scope where this element is declared. // // fFinalSet // The value set of the 'final' attribute. // // fBlockSet // The value set of the 'block' attribute. // // fMiscFlags // Stores 'abstract/nullable' values // // fDefaultValue // The defalut/fixed value // // fComplexTypeInfo // Stores complex type information // (no need to delete - handled by schema grammar) // // fAttDefs // The list of attributes that are faulted in for this element // when ComplexTypeInfo does not exist. We want to keep track // of these faulted in attributes to avoid duplicate redundant // error. // // fXsiComplexTypeInfo // Temporary store the xsi:type ComplexType here for validation // If it presents, then it takes precedence than its own fComplexTypeInfo. // // fXsiSimpleTypeInfo // Temporary store the xsi:type SimpleType here for validation // If it present then the information from it will be returned rather than fDatatypeValidator // // fIdentityConstraints // Store information about an element identity constraints. // // fAttWildCard // Store wildcard attribute in the case of an element with a type of // 'anyType'. // // fSubstitutionGroupElem // The substitution group element declaration. // // fValidity // After this attr has been validated this is its validity // // fValidation // The type of validation that happened to this attr // // fSeenValidation // set to true when a piece of content of this element is validated // // fSeenNoValidation // set to true when a piece of content of this element is laxly or skip validated // // fHadContent // true when this element actually had content. // ----------------------------------------------------------------------- // ----------------------------------------------------------------------- ModelTypes fModelType; PSVIDefs::PSVIScope fPSVIScope; DatatypeValidator* fDatatypeValidator; int fEnclosingScope; int fFinalSet; int fBlockSet; int fMiscFlags; XMLCh* fDefaultValue; ComplexTypeInfo* fComplexTypeInfo; RefHash2KeysTableOf<SchemaAttDef>* fAttDefs; ComplexTypeInfo* fXsiComplexTypeInfo; const DatatypeValidator* fXsiSimpleTypeInfo; RefVectorOf<IdentityConstraint>* fIdentityConstraints; SchemaAttDef* fAttWildCard; SchemaElementDecl* fSubstitutionGroupElem; PSVIDefs::Validity fValidity; PSVIDefs::Validation fValidation; bool fSeenValidation; bool fSeenNoValidation; bool fHadContent;};// ---------------------------------------------------------------------------// SchemaElementDecl: XMLElementDecl virtual interface implementation// ---------------------------------------------------------------------------inline ContentSpecNode* SchemaElementDecl::getContentSpec(){ if (fComplexTypeInfo != 0) { return fComplexTypeInfo->getContentSpec(); } return 0;}inline const ContentSpecNode* SchemaElementDecl::getContentSpec() const{ if (fComplexTypeInfo != 0) { return fComplexTypeInfo->getContentSpec(); } return 0;}inline voidSchemaElementDecl::setContentSpec(ContentSpecNode*){ //Handled by complexType}inline XMLContentModel* SchemaElementDecl::getContentModel(){ if (fComplexTypeInfo != 0) { return fComplexTypeInfo->getContentModel(); } return 0;}inline voidSchemaElementDecl::setContentModel(XMLContentModel* const){ //Handled by complexType}// ---------------------------------------------------------------------------// SchemaElementDecl: Getter methods// ---------------------------------------------------------------------------inline SchemaElementDecl::ModelTypes SchemaElementDecl::getModelType() const{ if (fComplexTypeInfo) { return (SchemaElementDecl::ModelTypes) fComplexTypeInfo->getContentType(); } return fModelType;}inline PSVIDefs::PSVIScope SchemaElementDecl::getPSVIScope() const{ return fPSVIScope;}inline DatatypeValidator* SchemaElementDecl::getDatatypeValidator() const{ return fDatatypeValidator;}inline int SchemaElementDecl::getEnclosingScope() const{ return fEnclosingScope;}inline int SchemaElementDecl::getFinalSet() const{ return fFinalSet;}inline int SchemaElementDecl::getBlockSet() const{ return fBlockSet;}inline int SchemaElementDecl::getMiscFlags() const{ return fMiscFlags;}inline XMLCh* SchemaElementDecl::getDefaultValue() const{ return fDefaultValue;}inline ComplexTypeInfo* SchemaElementDecl::getComplexTypeInfo() const{ return fComplexTypeInfo;}inline const SchemaAttDef* SchemaElementDecl::getAttWildCard() const { return fAttWildCard;}inline SchemaAttDef* SchemaElementDecl::getAttWildCard() { return fAttWildCard;}inline bool SchemaElementDecl::isGlobalDecl() const { return (fEnclosingScope == Grammar::TOP_LEVEL_SCOPE);}inline SchemaElementDecl*SchemaElementDecl::getSubstitutionGroupElem() const { return fSubstitutionGroupElem;}inline const XMLCh* SchemaElementDecl::getTypeName() const { // removing fXsi* references would break DOMTypeInfo implementation completely; // will have to wait for now if (fXsiComplexTypeInfo) return fXsiComplexTypeInfo->getTypeLocalName(); else if (fComplexTypeInfo) return fComplexTypeInfo->getTypeLocalName(); else if(fXsiSimpleTypeInfo) return fXsiSimpleTypeInfo->getTypeLocalName(); else if(fDatatypeValidator)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -