Rename RL to Plural
This commit is contained in:
parent
bbf1a3af6f
commit
99087f7e71
|
@ -387,7 +387,7 @@ public class BaseValidator implements IValidationContextResourceLoader {
|
||||||
return thePass;
|
return thePass;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean rulePL(List<ValidationMessage> errors, IssueType type, int line, int col, String path, boolean thePass, int num, String theMessage, Object... theMessageArguments) {
|
protected boolean rulePlural(List<ValidationMessage> errors, IssueType type, int line, int col, String path, boolean thePass, int num, String theMessage, Object... theMessageArguments) {
|
||||||
if (!thePass && doingErrors()) {
|
if (!thePass && doingErrors()) {
|
||||||
String message = context.formatMessagePlural(num, theMessage, theMessageArguments);
|
String message = context.formatMessagePlural(num, theMessage, theMessageArguments);
|
||||||
addValidationMessage(errors, type, line, col, path, message, IssueSeverity.ERROR, theMessage);
|
addValidationMessage(errors, type, line, col, path, message, IssueSeverity.ERROR, theMessage);
|
||||||
|
@ -454,7 +454,7 @@ public class BaseValidator implements IValidationContextResourceLoader {
|
||||||
return thePass;
|
return thePass;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected boolean rulePL(List<ValidationMessage> errors, IssueType type, String path, boolean thePass, int num, String theMessage, Object... theMessageArguments) {
|
protected boolean rulePlural(List<ValidationMessage> errors, IssueType type, String path, boolean thePass, int num, String theMessage, Object... theMessageArguments) {
|
||||||
if (!thePass && doingErrors()) {
|
if (!thePass && doingErrors()) {
|
||||||
String message = context.formatMessagePlural(num, theMessage, theMessageArguments);
|
String message = context.formatMessagePlural(num, theMessage, theMessageArguments);
|
||||||
addValidationMessage(errors, type, -1, -1, path, message, IssueSeverity.ERROR, theMessage);
|
addValidationMessage(errors, type, -1, -1, path, message, IssueSeverity.ERROR, theMessage);
|
||||||
|
|
|
@ -669,7 +669,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (logicals.size() > 0) {
|
if (logicals.size() > 0) {
|
||||||
if (rulePL(errors, IssueType.BUSINESSRULE, "Configuration", logicals.size() == 1, logicals.size(), I18nConstants.MULTIPLE_LOGICAL_MODELS_PLURAL, ResourceUtilities.listUrls(logicals))) {
|
if (rulePlural(errors, IssueType.BUSINESSRULE, "Configuration", logicals.size() == 1, logicals.size(), I18nConstants.MULTIPLE_LOGICAL_MODELS_PLURAL, ResourceUtilities.listUrls(logicals))) {
|
||||||
parser.setLogical(logicals.get(0));
|
parser.setLogical(logicals.get(0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5095,7 +5095,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
|
||||||
for (CanonicalType u : typeForResource.getProfile()) {
|
for (CanonicalType u : typeForResource.getProfile()) {
|
||||||
b.append(u.asStringValue());
|
b.append(u.asStringValue());
|
||||||
}
|
}
|
||||||
ok = rulePL(errors, IssueType.INVALID, element.line(), element.col(), stack.getLiteralPath(),
|
ok = rulePlural(errors, IssueType.INVALID, element.line(), element.col(), stack.getLiteralPath(),
|
||||||
false, typeForResource.getProfile().size(), I18nConstants.BUNDLE_BUNDLE_ENTRY_MULTIPLE_PROFILES_PLURAL, special.toHuman(), typeForResource.getCode(), b.toString()) && ok;
|
false, typeForResource.getProfile().size(), I18nConstants.BUNDLE_BUNDLE_ENTRY_MULTIPLE_PROFILES_PLURAL, special.toHuman(), typeForResource.getCode(), b.toString()) && ok;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5112,7 +5112,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
|
||||||
false, I18nConstants.BUNDLE_BUNDLE_ENTRY_TYPE2, resourceName, types.get(0)) && ok;
|
false, I18nConstants.BUNDLE_BUNDLE_ENTRY_TYPE2, resourceName, types.get(0)) && ok;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
ok = rulePL(errors, IssueType.INFORMATIONAL, element.line(), element.col(), stack.getLiteralPath(),
|
ok = rulePlural(errors, IssueType.INFORMATIONAL, element.line(), element.col(), stack.getLiteralPath(),
|
||||||
false, types.size(), I18nConstants.BUNDLE_BUNDLE_ENTRY_TYPE3_PLURAL, resourceName, types) && ok;
|
false, types.size(), I18nConstants.BUNDLE_BUNDLE_ENTRY_TYPE3_PLURAL, resourceName, types) && ok;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5664,7 +5664,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
|
||||||
hintPL(errors, IssueType.NOTSUPPORTED, element.line(), element.col(), stack.getLiteralPath(), count >= ed.getMin(), count, I18nConstants.VALIDATION_VAL_PROFILE_NOCHECKMIN_PLURAL, profile.getUrl(), ed.getPath(), ed.getId(), ed.getSliceName(),ed.getLabel(), stack.getLiteralPath(), Integer.toString(ed.getMin()));
|
hintPL(errors, IssueType.NOTSUPPORTED, element.line(), element.col(), stack.getLiteralPath(), count >= ed.getMin(), count, I18nConstants.VALIDATION_VAL_PROFILE_NOCHECKMIN_PLURAL, profile.getUrl(), ed.getPath(), ed.getId(), ed.getSliceName(),ed.getLabel(), stack.getLiteralPath(), Integer.toString(ed.getMin()));
|
||||||
else {
|
else {
|
||||||
if (count < ed.getMin()) {
|
if (count < ed.getMin()) {
|
||||||
ok = rulePL(errors, IssueType.STRUCTURE, element.line(), element.col(), stack.getLiteralPath(), false, count, I18nConstants.VALIDATION_VAL_PROFILE_MINIMUM_PLURAL, profile.getUrl(), ed.getPath(), ed.getId(), ed.getSliceName(),ed.getLabel(), stack.getLiteralPath(), Integer.toString(ed.getMin())) && ok;
|
ok = rulePlural(errors, IssueType.STRUCTURE, element.line(), element.col(), stack.getLiteralPath(), false, count, I18nConstants.VALIDATION_VAL_PROFILE_MINIMUM_PLURAL, profile.getUrl(), ed.getPath(), ed.getId(), ed.getSliceName(),ed.getLabel(), stack.getLiteralPath(), Integer.toString(ed.getMin())) && ok;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5672,7 +5672,7 @@ public class InstanceValidator extends BaseValidator implements IResourceValidat
|
||||||
if (problematicPaths.contains(ed.getPath()))
|
if (problematicPaths.contains(ed.getPath()))
|
||||||
hintPL(errors, IssueType.NOTSUPPORTED, element.line(), element.col(), stack.getLiteralPath(), count <= Integer.parseInt(ed.getMax()), count, I18nConstants.VALIDATION_VAL_PROFILE_NOCHECKMAX_PLURAL, profile.getUrl(), ed.getPath(), ed.getId(), ed.getSliceName(),ed.getLabel(), stack.getLiteralPath(), ed.getMax());
|
hintPL(errors, IssueType.NOTSUPPORTED, element.line(), element.col(), stack.getLiteralPath(), count <= Integer.parseInt(ed.getMax()), count, I18nConstants.VALIDATION_VAL_PROFILE_NOCHECKMAX_PLURAL, profile.getUrl(), ed.getPath(), ed.getId(), ed.getSliceName(),ed.getLabel(), stack.getLiteralPath(), ed.getMax());
|
||||||
else if (count > Integer.parseInt(ed.getMax())) {
|
else if (count > Integer.parseInt(ed.getMax())) {
|
||||||
ok = rulePL(errors, IssueType.STRUCTURE, element.line(), element.col(), stack.getLiteralPath(), false, count, I18nConstants.VALIDATION_VAL_PROFILE_MAXIMUM_PLURAL, profile.getUrl(), ed.getPath(), ed.getId(), ed.getSliceName(),ed.getLabel(), stack.getLiteralPath(), ed.getMax(), Integer.toString(count)) && ok;
|
ok = rulePlural(errors, IssueType.STRUCTURE, element.line(), element.col(), stack.getLiteralPath(), false, count, I18nConstants.VALIDATION_VAL_PROFILE_MAXIMUM_PLURAL, profile.getUrl(), ed.getPath(), ed.getId(), ed.getSliceName(),ed.getLabel(), stack.getLiteralPath(), ed.getMax(), Integer.toString(count)) && ok;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -402,7 +402,7 @@ public class QuestionnaireValidator extends BaseValidator {
|
||||||
private boolean validateQuestionnaireResponseItem(ValidatorHostContext hostcontext, QuestionnaireWithContext qsrc, QuestionnaireItemComponent qItem, List<ValidationMessage> errors, List<ElementWithIndex> elements, NodeStack stack, boolean inProgress, Element questionnaireResponseRoot, QStack qstack) {
|
private boolean validateQuestionnaireResponseItem(ValidatorHostContext hostcontext, QuestionnaireWithContext qsrc, QuestionnaireItemComponent qItem, List<ValidationMessage> errors, List<ElementWithIndex> elements, NodeStack stack, boolean inProgress, Element questionnaireResponseRoot, QStack qstack) {
|
||||||
boolean ok = true;
|
boolean ok = true;
|
||||||
if (elements.size() > 1) {
|
if (elements.size() > 1) {
|
||||||
ok = rulePL(errors, IssueType.INVALID, elements.get(1).getElement().line(), elements.get(1).getElement().col(), stack.getLiteralPath(), qItem.getRepeats(), elements.size(), I18nConstants.QUESTIONNAIRE_QR_ITEM_ONLYONEI_PLURAL, qItem.getLinkId()) && ok;
|
ok = rulePlural(errors, IssueType.INVALID, elements.get(1).getElement().line(), elements.get(1).getElement().col(), stack.getLiteralPath(), qItem.getRepeats(), elements.size(), I18nConstants.QUESTIONNAIRE_QR_ITEM_ONLYONEI_PLURAL, qItem.getLinkId()) && ok;
|
||||||
}
|
}
|
||||||
for (ElementWithIndex element : elements) {
|
for (ElementWithIndex element : elements) {
|
||||||
NodeStack ns = stack.push(element.getElement(), element.getIndex(), null, null);
|
NodeStack ns = stack.push(element.getElement(), element.getIndex(), null, null);
|
||||||
|
@ -519,7 +519,7 @@ public class QuestionnaireValidator extends BaseValidator {
|
||||||
return (s);
|
return (s);
|
||||||
}
|
}
|
||||||
|
|
||||||
ok.see(rulePL(errors, IssueType.STRUCTURE, values.get(0).line(), values.get(0).col(), ns.getLiteralPath(), false, types.length, I18nConstants.QUESTIONNAIRE_QR_ITEM_WRONGTYPE_PLURAL, l.toString()));
|
ok.see(rulePlural(errors, IssueType.STRUCTURE, values.get(0).line(), values.get(0).col(), ns.getLiteralPath(), false, types.length, I18nConstants.QUESTIONNAIRE_QR_ITEM_WRONGTYPE_PLURAL, l.toString()));
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue