summaryrefslogtreecommitdiff
path: root/src/core/model
diff options
context:
space:
mode:
authorBenjamin Paassen <bpaassen@techfak.uni-bielefeld.de>2015-02-08 19:49:08 +0100
committerBenjamin Paassen <bpaassen@techfak.uni-bielefeld.de>2015-02-08 19:49:08 +0100
commit05e5a4ab340d0f9f3490e7db9c8e42f70cc471da (patch)
tree686f61b26762f7af2574aacbcd5427772ed6c93c /src/core/model
parent0cbcba73332ee79e6041febec97575079400267b (diff)
added check for name attribute in Descriptor.
Diffstat (limited to 'src/core/model')
-rw-r--r--src/core/model/Domain.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/core/model/Domain.cpp b/src/core/model/Domain.cpp
index 62ee65d..20a9d42 100644
--- a/src/core/model/Domain.cpp
+++ b/src/core/model/Domain.cpp
@@ -153,9 +153,22 @@ bool Descriptor::doValidate(Logger &logger) const
} else {
valid = valid & validateName(logger);
}
+ // ensure that no attribute with the key "name" exists.
+ if (attributesDescriptor == nullptr) {
+ logger.error("This Descriptor has no Attribute specification!");
+ valid = false;
+ } else {
+ if (attributesDescriptor->hasAttribute("name")) {
+ logger.error(
+ "This Descriptor has an attribute \"name\" which is a reserved "
+ "word!");
+ valid = false;
+ }
+ valid = valid & attributesDescriptor->validate(logger);
+ }
+
// check attributes and the FieldDescriptors
- return valid & attributesDescriptor->validate(logger) &
- continueValidationCheckDuplicates(fieldDescriptors, logger);
+ return valid & continueValidationCheckDuplicates(fieldDescriptors, logger);
}
std::vector<Rooted<Node>> Descriptor::pathTo(