MessageConfig fieldMessage = getFieldConfig().getMessageConfig();
if (fieldMessage != null && fieldMessage.getKey() != null) {
baseMessage = fieldMessage;
}
if (baseMessage == null) {
throw new ConfigException("No base message in validator '" + name + "' in '" + toInlineString() + "'");
} else if (baseMessage.getKey() == null) {
throw new ConfigException("No key for message in validator '" + name + "' in '" + toInlineString() + "'");
}
Iterator args = message.getArgConfigs();
while (args.hasNext()) {
ArgConfig arg = (ArgConfig)args.next();
if (arg.getName() == null) {
throw new ConfigException("Missing name for argument '" + arg + "' in '" + toInlineString() + "'");
} else if (baseMessage.getArgConfig(arg.getName()) == null) {
throw new ConfigException("No argument with name '" + arg.getName() + "' in base message of validator '" + name + "' in '" + toInlineString() + "'");
}
}
}
// make sure that all properties exist and are not final
Iterator propertyConfigs = getPropertyConfigs();
while (propertyConfigs.hasNext()) {
PropertyConfig propertyConfig = (PropertyConfig)propertyConfigs.next();
String name = propertyConfig.getName();
ValidatorPropertyConfig validatorPropertyConfig =
validatorConfig.getValidatorPropertyConfig(name);
if (validatorPropertyConfig == null) {
throw new ConfigException("Unknown property " + name + " in '" + toInlineString() + "'");
}
if (validatorPropertyConfig.isFinal()) {
throw new ConfigException("Must not override property " + name + " in '" + toInlineString() + "'");
}
}
// make sure abstract validator properties are defined
// Iterator validatorPropertyConfigs = validatorConfig.getValidatorPropertyConfigs();
// while (validatorPropertyConfigs.hasNext()) {