Qt 4.8
|
The class that provides methods for checking a string against a type. More...
#include <qxsdtypechecker_p.h>
Public Functions | |
bool | isValidString (const QString &normalizedString, const AnySimpleType::Ptr &type, QString &errorMsg, AnySimpleType::Ptr *boundType=0) const |
bool | valuesAreEqual (const QString &value, const QString &otherValue, const AnySimpleType::Ptr &type) const |
XsdTypeChecker (const XsdSchemaContext::Ptr &context, const QVector< QXmlName > &namespaceBindings, const QSourceLocation &location) | |
~XsdTypeChecker () | |
Static Public Functions | |
static XsdFacet::Hash | mergedFacetsForType (const SchemaType::Ptr &type, const XsdSchemaContext::Ptr &context) |
static QString | normalizedValue (const QString &value, const XsdFacet::Hash &facets) |
Private Functions | |
bool | checkConstrainingFacets (const AtomicValue::Ptr &value, const QString &lexicalValue, const AnySimpleType::Ptr &type, QString &errorMsg) const |
bool | checkConstrainingFacetsBinary (const QByteArray &value, const XsdFacet::Hash &facets, const AnySimpleType::Ptr &type, QString &errorMsg) const |
bool | checkConstrainingFacetsBoolean (bool value, const QString &lexicalValue, const XsdFacet::Hash &facets, QString &errorMsg) const |
bool | checkConstrainingFacetsDateTime (const QDateTime &value, const QString &lexicalValue, const XsdFacet::Hash &facets, const AnySimpleType::Ptr &type, QString &errorMsg) const |
bool | checkConstrainingFacetsDecimal (const AtomicValue::Ptr &value, const QString &lexicalValue, const XsdFacet::Hash &facets, QString &errorMsg) const |
bool | checkConstrainingFacetsDouble (double value, const QString &lexicalValue, const XsdFacet::Hash &facets, QString &errorMsg) const |
bool | checkConstrainingFacetsDuration (const AtomicValue::Ptr &value, const QString &lexicalValue, const XsdFacet::Hash &facets, QString &errorMsg) const |
bool | checkConstrainingFacetsList (const QStringList &values, const QString &lexicalValue, const AnySimpleType::Ptr &itemType, const XsdFacet::Hash &facets, QString &errorMsg) const |
bool | checkConstrainingFacetsNotation (const QXmlName &value, const XsdFacet::Hash &facets, QString &errorMsg) const |
bool | checkConstrainingFacetsQName (const QXmlName &, const QString &lexicalValue, const XsdFacet::Hash &facets, QString &errorMsg) const |
bool | checkConstrainingFacetsSignedInteger (long long value, const QString &lexicalValue, const XsdFacet::Hash &facets, QString &errorMsg) const |
bool | checkConstrainingFacetsString (const QString &value, const XsdFacet::Hash &facets, const AnySimpleType::Ptr &type, QString &errorMsg) const |
bool | checkConstrainingFacetsUnion (const QString &value, const QString &lexicalValue, const XsdSimpleType::Ptr &simpleType, const XsdFacet::Hash &facets, QString &errorMsg) const |
bool | checkConstrainingFacetsUnsignedInteger (unsigned long long value, const QString &lexicalValue, const XsdFacet::Hash &facets, QString &errorMsg) const |
QXmlName | convertToQName (const QString &name) const |
AtomicValue::Ptr | fromLexical (const QString &value, const SchemaType::Ptr &type, const ReportContext::Ptr &context, const SourceLocationReflection *const reflection) const |
Properties | |
XsdSchemaContext::Ptr | m_context |
const NamePool::Ptr | m_namePool |
QVector< QXmlName > | m_namespaceBindings |
SourceLocationReflection * | m_reflection |
XsdSchema::Ptr | m_schema |
The class that provides methods for checking a string against a type.
The class provides functionality for type-aware string handling.
Definition at line 92 of file qxsdtypechecker_p.h.
XsdTypeChecker::XsdTypeChecker | ( | const XsdSchemaContext::Ptr & | context, |
const QVector< QXmlName > & | namespaceBindings, | ||
const QSourceLocation & | location | ||
) |
Creates a new type checker.
context | The schema context that is used for error reporting. |
namespaceBindings | The namespace bindings that shall be used to check against xs:QName based types. |
location | The source location that is used for error reporting. |
Definition at line 165 of file qxsdtypechecker.cpp.
XsdTypeChecker::~XsdTypeChecker | ( | ) |
Destroys the type checker.
Definition at line 173 of file qxsdtypechecker.cpp.
|
private |
Checks the given value against the facets of type
.
Definition at line 370 of file qxsdtypechecker.cpp.
Referenced by isValidString().
|
private |
Definition at line 956 of file qxsdtypechecker.cpp.
Referenced by checkConstrainingFacets().
|
private |
Definition at line 929 of file qxsdtypechecker.cpp.
Referenced by checkConstrainingFacets().
|
private |
Definition at line 774 of file qxsdtypechecker.cpp.
Referenced by checkConstrainingFacets().
|
private |
Definition at line 750 of file qxsdtypechecker.cpp.
Referenced by checkConstrainingFacets().
|
private |
Definition at line 665 of file qxsdtypechecker.cpp.
Referenced by checkConstrainingFacets(), and checkConstrainingFacetsDecimal().
|
private |
Definition at line 848 of file qxsdtypechecker.cpp.
Referenced by checkConstrainingFacets().
|
private |
Definition at line 1108 of file qxsdtypechecker.cpp.
Referenced by isValidString().
|
private |
Definition at line 1069 of file qxsdtypechecker.cpp.
Referenced by checkConstrainingFacets().
|
private |
Definition at line 1010 of file qxsdtypechecker.cpp.
Referenced by checkConstrainingFacets().
|
private |
Definition at line 493 of file qxsdtypechecker.cpp.
Referenced by checkConstrainingFacets().
|
private |
Definition at line 424 of file qxsdtypechecker.cpp.
Referenced by checkConstrainingFacets().
|
private |
Definition at line 1246 of file qxsdtypechecker.cpp.
Referenced by isValidString().
|
private |
Definition at line 579 of file qxsdtypechecker.cpp.
Referenced by checkConstrainingFacets().
Converts a qualified name into a QXmlName according to the namespace mappings of the current node.
Definition at line 1316 of file qxsdtypechecker.cpp.
Referenced by checkConstrainingFacetsList(), fromLexical(), and valuesAreEqual().
|
private |
Creates an atomic value of type
from the given string value
.
Definition at line 1303 of file qxsdtypechecker.cpp.
Referenced by isValidString().
bool XsdTypeChecker::isValidString | ( | const QString & | normalizedString, |
const AnySimpleType::Ptr & | type, | ||
QString & | errorMsg, | ||
AnySimpleType::Ptr * | boundType = 0 |
||
) | const |
Checks whether the normalizedString
is valid according the given type
.
normalizedString | The string in normalized form (whitespace facets applied). |
type | The type the string shall be tested against. |
errorMsg | Contains the error message if the normalizedString does not match the type. |
boundType | The type the data was bound to during validation. |
boundType
only differs from type
if the type is derived from an based union value. Definition at line 222 of file qxsdtypechecker.cpp.
Referenced by QPatternist::XsdSchemaChecker::checkConstrainingFacets(), QPatternist::XsdSchemaChecker::isValidValue(), QPatternist::XsdValidatingInstanceReader::validateAttribute(), QPatternist::XsdValidatingInstanceReader::validateElementComplexType(), and QPatternist::XsdValidatingInstanceReader::validateElementSimpleType().
|
static |
Returns all facets for the given type
.
The list of facets is created by following the type hierarchy from xs:anyType down to the given type and merging the facets in each step.
Definition at line 203 of file qxsdtypechecker.cpp.
Referenced by checkConstrainingFacets(), QPatternist::XsdSchemaChecker::checkConstrainingFacets(), isValidString(), QPatternist::XsdSchemaChecker::isValidValue(), QPatternist::XsdValidatingInstanceReader::validateAttribute(), QPatternist::XsdValidatingInstanceReader::validateElementComplexType(), and QPatternist::XsdValidatingInstanceReader::validateElementSimpleType().
|
static |
Returns the normalized value for the given value
.
The normalized value is the original value with all the white space facets applied on it.
value | The original value. |
facets | The hash of all facets of the values type. |
Definition at line 178 of file qxsdtypechecker.cpp.
Referenced by QPatternist::XsdSchemaChecker::checkConstrainingFacets(), isValidString(), QPatternist::XsdSchemaChecker::isValidValue(), QPatternist::XsdValidatingInstanceReader::validateAttribute(), QPatternist::XsdValidatingInstanceReader::validateElementComplexType(), and QPatternist::XsdValidatingInstanceReader::validateElementSimpleType().
bool XsdTypeChecker::valuesAreEqual | ( | const QString & | value, |
const QString & | otherValue, | ||
const AnySimpleType::Ptr & | type | ||
) | const |
Returns whether the given value
and otherValue
are of type
and are equal.
Definition at line 322 of file qxsdtypechecker.cpp.
Referenced by QPatternist::XsdSchemaChecker::checkAttributeUseConstraints(), derivedTermValid(), QPatternist::XsdSchemaHelper::isValidAttributeUsesRestriction(), QPatternist::XsdValidatingInstanceReader::validateAttribute(), QPatternist::XsdValidatingInstanceReader::validateElementComplexType(), and QPatternist::XsdValidatingInstanceReader::validateElementSimpleType().
|
private |
Definition at line 177 of file qxsdtypechecker_p.h.
Referenced by checkConstrainingFacets(), checkConstrainingFacetsBinary(), checkConstrainingFacetsBoolean(), checkConstrainingFacetsDateTime(), checkConstrainingFacetsDouble(), checkConstrainingFacetsDuration(), checkConstrainingFacetsList(), checkConstrainingFacetsQName(), checkConstrainingFacetsSignedInteger(), checkConstrainingFacetsString(), checkConstrainingFacetsUnion(), checkConstrainingFacetsUnsignedInteger(), convertToQName(), isValidString(), and valuesAreEqual().
|
private |
Definition at line 179 of file qxsdtypechecker_p.h.
Referenced by checkConstrainingFacetsDouble(), checkConstrainingFacetsDuration(), checkConstrainingFacetsList(), checkConstrainingFacetsSignedInteger(), checkConstrainingFacetsString(), checkConstrainingFacetsUnion(), checkConstrainingFacetsUnsignedInteger(), fromLexical(), isValidString(), and valuesAreEqual().
Definition at line 180 of file qxsdtypechecker_p.h.
Referenced by convertToQName().
|
private |
Definition at line 181 of file qxsdtypechecker_p.h.
Referenced by checkConstrainingFacetsBinary(), checkConstrainingFacetsBoolean(), checkConstrainingFacetsDateTime(), checkConstrainingFacetsDouble(), checkConstrainingFacetsDuration(), checkConstrainingFacetsList(), checkConstrainingFacetsQName(), checkConstrainingFacetsSignedInteger(), checkConstrainingFacetsString(), checkConstrainingFacetsUnion(), checkConstrainingFacetsUnsignedInteger(), isValidString(), valuesAreEqual(), and ~XsdTypeChecker().
|
private |
Definition at line 178 of file qxsdtypechecker_p.h.