added i18N handling to JsonParser, TurtleParser, XMLParser
This commit is contained in:
parent
9443b1c1c3
commit
14a0f7d687
|
@ -9,9 +9,9 @@ package org.hl7.fhir.r5.elementmodel;
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
* You may obtain a copy of the License at
|
* You may obtain a copy of the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
@ -91,20 +91,20 @@ public class JsonParser extends ParserBase {
|
||||||
map = new IdentityHashMap<JsonElement, LocationData>();
|
map = new IdentityHashMap<JsonElement, LocationData>();
|
||||||
String source = TextFile.streamToString(stream);
|
String source = TextFile.streamToString(stream);
|
||||||
if (policy == ValidationPolicy.EVERYTHING) {
|
if (policy == ValidationPolicy.EVERYTHING) {
|
||||||
JsonObject obj = null;
|
JsonObject obj = null;
|
||||||
try {
|
try {
|
||||||
obj = JsonTrackingParser.parse(source, map);
|
obj = JsonTrackingParser.parse(source, map);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logError(-1, -1, "(document)", IssueType.INVALID, context.formatMessage(I18nConstants.ERROR_PARSING_JSON_, e.getMessage()), IssueSeverity.FATAL);
|
logError(-1, -1, "(document)", IssueType.INVALID, context.formatMessage(I18nConstants.ERROR_PARSING_JSON_, e.getMessage()), IssueSeverity.FATAL);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
assert (map.containsKey(obj));
|
assert (map.containsKey(obj));
|
||||||
return parse(obj);
|
return parse(obj);
|
||||||
} else {
|
} else {
|
||||||
JsonObject obj = JsonTrackingParser.parse(source, null); // (JsonObject) new com.google.gson.JsonParser().parse(source);
|
JsonObject obj = JsonTrackingParser.parse(source, null); // (JsonObject) new com.google.gson.JsonParser().parse(source);
|
||||||
// assert (map.containsKey(obj));
|
// assert (map.containsKey(obj));
|
||||||
return parse(obj);
|
return parse(obj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Element parse(JsonObject object, Map<JsonElement, LocationData> map) throws FHIRException {
|
public Element parse(JsonObject object, Map<JsonElement, LocationData> map) throws FHIRException {
|
||||||
|
@ -233,10 +233,10 @@ public class JsonParser extends ParserBase {
|
||||||
parseResource(npath, child, n, property);
|
parseResource(npath, child, n, property);
|
||||||
else
|
else
|
||||||
parseChildren(npath, child, n, false);
|
parseChildren(npath, child, n, false);
|
||||||
} else
|
} else
|
||||||
logError(line(e), col(e), npath, IssueType.INVALID, context.formatMessage(I18nConstants.THIS_PROPERTY_MUST_BE__NOT_, (property.isList() ? "an Array" : "an Object"), describe(e)), IssueSeverity.ERROR);
|
logError(line(e), col(e), npath, IssueType.INVALID, context.formatMessage(I18nConstants.THIS_PROPERTY_MUST_BE__NOT_, (property.isList() ? "an Array" : "an Object"), describe(e)), IssueSeverity.ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
private String describe(JsonElement e) {
|
private String describe(JsonElement e) {
|
||||||
if (e instanceof JsonArray) {
|
if (e instanceof JsonArray) {
|
||||||
return "an array";
|
return "an array";
|
||||||
|
@ -251,7 +251,7 @@ public class JsonParser extends ParserBase {
|
||||||
String npath = path+"."+property.getName();
|
String npath = path+"."+property.getName();
|
||||||
processed.add(name);
|
processed.add(name);
|
||||||
processed.add("_"+name);
|
processed.add("_"+name);
|
||||||
JsonElement main = object.has(name) ? object.get(name) : null;
|
JsonElement main = object.has(name) ? object.get(name) : null;
|
||||||
JsonElement fork = object.has("_"+name) ? object.get("_"+name) : null;
|
JsonElement fork = object.has("_"+name) ? object.get("_"+name) : null;
|
||||||
if (main != null || fork != null) {
|
if (main != null || fork != null) {
|
||||||
if (property.isList() && ((main == null) || (main instanceof JsonArray)) &&((fork == null) || (fork instanceof JsonArray)) ) {
|
if (property.isList() && ((main == null) || (main instanceof JsonArray)) &&((fork == null) || (fork instanceof JsonArray)) ) {
|
||||||
|
@ -329,7 +329,7 @@ public class JsonParser extends ParserBase {
|
||||||
String name = rt.getAsString();
|
String name = rt.getAsString();
|
||||||
StructureDefinition sd = context.fetchResource(StructureDefinition.class, ProfileUtilities.sdNs(name, context.getOverrideVersionNs()));
|
StructureDefinition sd = context.fetchResource(StructureDefinition.class, ProfileUtilities.sdNs(name, context.getOverrideVersionNs()));
|
||||||
if (sd == null)
|
if (sd == null)
|
||||||
throw new FHIRFormatError("Contained resource does not appear to be a FHIR resource (unknown name '"+name+"')");
|
throw new FHIRFormatError(context.formatMessage(I18nConstants.CONTAINED_RESOURCE_DOES_NOT_APPEAR_TO_BE_A_FHIR_RESOURCE_UNKNOWN_NAME_, name));
|
||||||
parent.updateProperty(new Property(context, sd.getSnapshot().getElement().get(0), sd), SpecialElement.fromProperty(parent.getProperty()), elementProperty);
|
parent.updateProperty(new Property(context, sd.getSnapshot().getElement().get(0), sd), SpecialElement.fromProperty(parent.getProperty()), elementProperty);
|
||||||
parent.setType(name);
|
parent.setType(name);
|
||||||
parseChildren(npath, res, parent, true);
|
parseChildren(npath, res, parent, true);
|
||||||
|
@ -369,7 +369,7 @@ public class JsonParser extends ParserBase {
|
||||||
|
|
||||||
protected void open(String name, String link) throws IOException {
|
protected void open(String name, String link) throws IOException {
|
||||||
json.link(link);
|
json.link(link);
|
||||||
if (name != null)
|
if (name != null)
|
||||||
json.name(name);
|
json.name(name);
|
||||||
json.beginObject();
|
json.beginObject();
|
||||||
}
|
}
|
||||||
|
@ -380,7 +380,7 @@ public class JsonParser extends ParserBase {
|
||||||
|
|
||||||
protected void openArray(String name, String link) throws IOException {
|
protected void openArray(String name, String link) throws IOException {
|
||||||
json.link(link);
|
json.link(link);
|
||||||
if (name != null)
|
if (name != null)
|
||||||
json.name(name);
|
json.name(name);
|
||||||
json.beginArray();
|
json.beginArray();
|
||||||
}
|
}
|
||||||
|
@ -412,7 +412,7 @@ public class JsonParser extends ParserBase {
|
||||||
public void compose(Element e, JsonCreator json) throws Exception {
|
public void compose(Element e, JsonCreator json) throws Exception {
|
||||||
this.json = json;
|
this.json = json;
|
||||||
json.beginObject();
|
json.beginObject();
|
||||||
|
|
||||||
prop("resourceType", e.getType(), linkResolver == null ? null : linkResolver.resolveProperty(e.getProperty()));
|
prop("resourceType", e.getType(), linkResolver == null ? null : linkResolver.resolveProperty(e.getProperty()));
|
||||||
Set<String> done = new HashSet<String>();
|
Set<String> done = new HashSet<String>();
|
||||||
for (Element child : e.getChildren()) {
|
for (Element child : e.getChildren()) {
|
||||||
|
@ -440,7 +440,7 @@ public class JsonParser extends ParserBase {
|
||||||
if (list.get(0).isPrimitive()) {
|
if (list.get(0).isPrimitive()) {
|
||||||
boolean prim = false;
|
boolean prim = false;
|
||||||
complex = false;
|
complex = false;
|
||||||
for (Element item : list) {
|
for (Element item : list) {
|
||||||
if (item.hasValue())
|
if (item.hasValue())
|
||||||
prim = true;
|
prim = true;
|
||||||
if (item.hasChildren())
|
if (item.hasChildren())
|
||||||
|
@ -448,19 +448,19 @@ public class JsonParser extends ParserBase {
|
||||||
}
|
}
|
||||||
if (prim) {
|
if (prim) {
|
||||||
openArray(name, linkResolver == null ? null : linkResolver.resolveProperty(list.get(0).getProperty()));
|
openArray(name, linkResolver == null ? null : linkResolver.resolveProperty(list.get(0).getProperty()));
|
||||||
for (Element item : list) {
|
for (Element item : list) {
|
||||||
if (item.hasValue())
|
if (item.hasValue())
|
||||||
primitiveValue(null, item);
|
primitiveValue(null, item);
|
||||||
else
|
else
|
||||||
json.nullValue();
|
json.nullValue();
|
||||||
}
|
}
|
||||||
closeArray();
|
closeArray();
|
||||||
}
|
}
|
||||||
name = "_"+name;
|
name = "_"+name;
|
||||||
}
|
}
|
||||||
if (complex) {
|
if (complex) {
|
||||||
openArray(name, linkResolver == null ? null : linkResolver.resolveProperty(list.get(0).getProperty()));
|
openArray(name, linkResolver == null ? null : linkResolver.resolveProperty(list.get(0).getProperty()));
|
||||||
for (Element item : list) {
|
for (Element item : list) {
|
||||||
if (item.hasChildren()) {
|
if (item.hasChildren()) {
|
||||||
open(null,null);
|
open(null,null);
|
||||||
if (item.getProperty().isResource()) {
|
if (item.getProperty().isResource()) {
|
||||||
|
@ -473,9 +473,9 @@ public class JsonParser extends ParserBase {
|
||||||
close();
|
close();
|
||||||
} else
|
} else
|
||||||
json.nullValue();
|
json.nullValue();
|
||||||
}
|
}
|
||||||
closeArray();
|
closeArray();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void primitiveValue(String name, Element item) throws IOException {
|
private void primitiveValue(String name, Element item) throws IOException {
|
||||||
|
@ -493,10 +493,10 @@ public class JsonParser extends ParserBase {
|
||||||
try {
|
try {
|
||||||
json.value(new BigDecimal(item.getValue()));
|
json.value(new BigDecimal(item.getValue()));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
throw new NumberFormatException("error writing number '"+item.getValue()+"' to JSON");
|
throw new NumberFormatException(context.formatMessage(I18nConstants.ERROR_WRITING_NUMBER__TO_JSON, item.getValue()));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
json.value(item.getValue());
|
json.value(item.getValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void compose(String path, Element element) throws IOException {
|
private void compose(String path, Element element) throws IOException {
|
||||||
|
|
|
@ -46,6 +46,7 @@ import org.hl7.fhir.r5.utils.formats.Turtle.TTLList;
|
||||||
import org.hl7.fhir.r5.utils.formats.Turtle.TTLLiteral;
|
import org.hl7.fhir.r5.utils.formats.Turtle.TTLLiteral;
|
||||||
import org.hl7.fhir.r5.utils.formats.Turtle.TTLObject;
|
import org.hl7.fhir.r5.utils.formats.Turtle.TTLObject;
|
||||||
import org.hl7.fhir.r5.utils.formats.Turtle.TTLURL;
|
import org.hl7.fhir.r5.utils.formats.Turtle.TTLURL;
|
||||||
|
import org.hl7.fhir.utilities.I18nConstants;
|
||||||
import org.hl7.fhir.utilities.TextFile;
|
import org.hl7.fhir.utilities.TextFile;
|
||||||
import org.hl7.fhir.utilities.Utilities;
|
import org.hl7.fhir.utilities.Utilities;
|
||||||
import org.hl7.fhir.utilities.validation.ValidationMessage.IssueSeverity;
|
import org.hl7.fhir.utilities.validation.ValidationMessage.IssueSeverity;
|
||||||
|
@ -69,7 +70,7 @@ public class TurtleParser extends ParserBase {
|
||||||
try {
|
try {
|
||||||
src.parse(TextFile.streamToString(input));
|
src.parse(TextFile.streamToString(input));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logError(-1, -1, "(document)", IssueType.INVALID, "Error parsing Turtle: "+e.getMessage(), IssueSeverity.FATAL);
|
logError(-1, -1, "(document)", IssueType.INVALID, context.formatMessage(I18nConstants.ERROR_PARSING_TURTLE_, e.getMessage()), IssueSeverity.FATAL);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return parse(src);
|
return parse(src);
|
||||||
|
@ -101,7 +102,7 @@ public class TurtleParser extends ParserBase {
|
||||||
private Element parse(Turtle src, TTLComplex cmp) throws FHIRException {
|
private Element parse(Turtle src, TTLComplex cmp) throws FHIRException {
|
||||||
TTLObject type = cmp.getPredicates().get("http://www.w3.org/2000/01/rdf-schema#type");
|
TTLObject type = cmp.getPredicates().get("http://www.w3.org/2000/01/rdf-schema#type");
|
||||||
if (type == null) {
|
if (type == null) {
|
||||||
logError(cmp.getLine(), cmp.getCol(), "(document)", IssueType.INVALID, "Unknown resource type (missing rdfs:type)", IssueSeverity.FATAL);
|
logError(cmp.getLine(), cmp.getCol(), "(document)", IssueType.INVALID, context.formatMessage(I18nConstants.UNKNOWN_RESOURCE_TYPE_MISSING_RDFSTYPE), IssueSeverity.FATAL);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
if (type instanceof TTLList) {
|
if (type instanceof TTLList) {
|
||||||
|
@ -114,7 +115,7 @@ public class TurtleParser extends ParserBase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!(type instanceof TTLURL)) {
|
if (!(type instanceof TTLURL)) {
|
||||||
logError(cmp.getLine(), cmp.getCol(), "(document)", IssueType.INVALID, "Unexpected datatype for rdfs:type)", IssueSeverity.FATAL);
|
logError(cmp.getLine(), cmp.getCol(), "(document)", IssueType.INVALID, context.formatMessage(I18nConstants.UNEXPECTED_DATATYPE_FOR_RDFSTYPE), IssueSeverity.FATAL);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
String name = ((TTLURL) type).getUri();
|
String name = ((TTLURL) type).getUri();
|
||||||
|
@ -134,9 +135,9 @@ public class TurtleParser extends ParserBase {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void parseChildren(Turtle src, String path, TTLComplex object, Element context, boolean primitive) throws FHIRException {
|
private void parseChildren(Turtle src, String path, TTLComplex object, Element element, boolean primitive) throws FHIRException {
|
||||||
|
|
||||||
List<Property> properties = context.getProperty().getChildProperties(context.getName(), null);
|
List<Property> properties = element.getProperty().getChildProperties(element.getName(), null);
|
||||||
Set<String> processed = new HashSet<String>();
|
Set<String> processed = new HashSet<String>();
|
||||||
if (primitive)
|
if (primitive)
|
||||||
processed.add(FHIR_URI_BASE + "value");
|
processed.add(FHIR_URI_BASE + "value");
|
||||||
|
@ -147,10 +148,10 @@ public class TurtleParser extends ParserBase {
|
||||||
if (property.isChoice()) {
|
if (property.isChoice()) {
|
||||||
for (TypeRefComponent type : property.getDefinition().getType()) {
|
for (TypeRefComponent type : property.getDefinition().getType()) {
|
||||||
String eName = property.getName().substring(0, property.getName().length()-3) + Utilities.capitalize(type.getCode());
|
String eName = property.getName().substring(0, property.getName().length()-3) + Utilities.capitalize(type.getCode());
|
||||||
parseChild(src, object, context, processed, property, path, getFormalName(property, eName));
|
parseChild(src, object, element, processed, property, path, getFormalName(property, eName));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
parseChild(src, object, context, processed, property, path, getFormalName(property));
|
parseChild(src, object, element, processed, property, path, getFormalName(property));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -159,7 +160,7 @@ public class TurtleParser extends ParserBase {
|
||||||
for (String u : object.getPredicates().keySet()) {
|
for (String u : object.getPredicates().keySet()) {
|
||||||
if (!processed.contains(u)) {
|
if (!processed.contains(u)) {
|
||||||
TTLObject n = object.getPredicates().get(u);
|
TTLObject n = object.getPredicates().get(u);
|
||||||
logError(n.getLine(), n.getCol(), path, IssueType.STRUCTURE, "Unrecognised predicate '"+u+"'", IssueSeverity.ERROR);
|
logError(n.getLine(), n.getCol(), path, IssueType.STRUCTURE, context.formatMessage(I18nConstants.UNRECOGNISED_PREDICATE_, u), IssueSeverity.ERROR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -181,13 +182,13 @@ public class TurtleParser extends ParserBase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void parseChildInstance(Turtle src, String npath, TTLComplex object, Element context, Property property, String name, TTLObject e) throws FHIRException {
|
private void parseChildInstance(Turtle src, String npath, TTLComplex object, Element element, Property property, String name, TTLObject e) throws FHIRException {
|
||||||
if (property.isResource())
|
if (property.isResource())
|
||||||
parseResource(src, npath, object, context, property, name, e);
|
parseResource(src, npath, object, element, property, name, e);
|
||||||
else if (e instanceof TTLComplex) {
|
else if (e instanceof TTLComplex) {
|
||||||
TTLComplex child = (TTLComplex) e;
|
TTLComplex child = (TTLComplex) e;
|
||||||
Element n = new Element(tail(name), property).markLocation(e.getLine(), e.getCol());
|
Element n = new Element(tail(name), property).markLocation(e.getLine(), e.getCol());
|
||||||
context.getChildren().add(n);
|
element.getChildren().add(n);
|
||||||
if (property.isPrimitive(property.getType(tail(name)))) {
|
if (property.isPrimitive(property.getType(tail(name)))) {
|
||||||
parseChildren(src, npath, child, n, true);
|
parseChildren(src, npath, child, n, true);
|
||||||
TTLObject val = child.getPredicates().get(FHIR_URI_BASE + "value");
|
TTLObject val = child.getPredicates().get(FHIR_URI_BASE + "value");
|
||||||
|
@ -198,13 +199,13 @@ public class TurtleParser extends ParserBase {
|
||||||
// todo: check type
|
// todo: check type
|
||||||
n.setValue(value);
|
n.setValue(value);
|
||||||
} else
|
} else
|
||||||
logError(object.getLine(), object.getCol(), npath, IssueType.INVALID, "This property must be a Literal, not a "+e.getClass().getName(), IssueSeverity.ERROR);
|
logError(object.getLine(), object.getCol(), npath, IssueType.INVALID, context.formatMessage(I18nConstants.THIS_PROPERTY_MUST_BE_A_LITERAL_NOT_A_, e.getClass().getName()), IssueSeverity.ERROR);
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
parseChildren(src, npath, child, n, false);
|
parseChildren(src, npath, child, n, false);
|
||||||
|
|
||||||
} else
|
} else
|
||||||
logError(object.getLine(), object.getCol(), npath, IssueType.INVALID, "This property must be a URI or bnode, not a "+e.getClass().getName(), IssueSeverity.ERROR);
|
logError(object.getLine(), object.getCol(), npath, IssueType.INVALID, context.formatMessage(I18nConstants.THIS_PROPERTY_MUST_BE_A_URI_OR_BNODE_NOT_A_, e.getClass().getName()), IssueSeverity.ERROR);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -212,7 +213,7 @@ public class TurtleParser extends ParserBase {
|
||||||
return name.substring(name.lastIndexOf(".")+1);
|
return name.substring(name.lastIndexOf(".")+1);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void parseResource(Turtle src, String npath, TTLComplex object, Element context, Property property, String name, TTLObject e) throws FHIRException {
|
private void parseResource(Turtle src, String npath, TTLComplex object, Element element, Property property, String name, TTLObject e) throws FHIRException {
|
||||||
TTLComplex obj;
|
TTLComplex obj;
|
||||||
if (e instanceof TTLComplex)
|
if (e instanceof TTLComplex)
|
||||||
obj = (TTLComplex) e;
|
obj = (TTLComplex) e;
|
||||||
|
@ -220,15 +221,15 @@ public class TurtleParser extends ParserBase {
|
||||||
String url = ((TTLURL) e).getUri();
|
String url = ((TTLURL) e).getUri();
|
||||||
obj = src.getObject(url);
|
obj = src.getObject(url);
|
||||||
if (obj == null) {
|
if (obj == null) {
|
||||||
logError(e.getLine(), e.getCol(), npath, IssueType.INVALID, "reference to "+url+" cannot be resolved", IssueSeverity.FATAL);
|
logError(e.getLine(), e.getCol(), npath, IssueType.INVALID, context.formatMessage(I18nConstants.REFERENCE_TO__CANNOT_BE_RESOLVED, url), IssueSeverity.FATAL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
throw new FHIRFormatError("Wrong type for resource");
|
throw new FHIRFormatError(context.formatMessage(I18nConstants.WRONG_TYPE_FOR_RESOURCE));
|
||||||
|
|
||||||
TTLObject type = obj.getPredicates().get("http://www.w3.org/2000/01/rdf-schema#type");
|
TTLObject type = obj.getPredicates().get("http://www.w3.org/2000/01/rdf-schema#type");
|
||||||
if (type == null) {
|
if (type == null) {
|
||||||
logError(object.getLine(), object.getCol(), npath, IssueType.INVALID, "Unknown resource type (missing rdfs:type)", IssueSeverity.FATAL);
|
logError(object.getLine(), object.getCol(), npath, IssueType.INVALID, context.formatMessage(I18nConstants.UNKNOWN_RESOURCE_TYPE_MISSING_RDFSTYPE), IssueSeverity.FATAL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (type instanceof TTLList) {
|
if (type instanceof TTLList) {
|
||||||
|
@ -241,7 +242,7 @@ public class TurtleParser extends ParserBase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!(type instanceof TTLURL)) {
|
if (!(type instanceof TTLURL)) {
|
||||||
logError(object.getLine(), object.getCol(), npath, IssueType.INVALID, "Unexpected datatype for rdfs:type)", IssueSeverity.FATAL);
|
logError(object.getLine(), object.getCol(), npath, IssueType.INVALID, context.formatMessage(I18nConstants.UNEXPECTED_DATATYPE_FOR_RDFSTYPE), IssueSeverity.FATAL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
String rt = ((TTLURL) type).getUri();
|
String rt = ((TTLURL) type).getUri();
|
||||||
|
@ -253,7 +254,7 @@ public class TurtleParser extends ParserBase {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Element n = new Element(tail(name), property).markLocation(object.getLine(), object.getCol());
|
Element n = new Element(tail(name), property).markLocation(object.getLine(), object.getCol());
|
||||||
context.getChildren().add(n);
|
element.getChildren().add(n);
|
||||||
n.updateProperty(new Property(this.context, sd.getSnapshot().getElement().get(0), sd), SpecialElement.fromProperty(n.getProperty()), property);
|
n.updateProperty(new Property(this.context, sd.getSnapshot().getElement().get(0), sd), SpecialElement.fromProperty(n.getProperty()), property);
|
||||||
n.setType(rt);
|
n.setType(rt);
|
||||||
parseChildren(src, npath, obj, n, false);
|
parseChildren(src, npath, obj, n, false);
|
||||||
|
@ -278,7 +279,7 @@ public class TurtleParser extends ParserBase {
|
||||||
if (en == null)
|
if (en == null)
|
||||||
en = property.getDefinition().getPath();
|
en = property.getDefinition().getPath();
|
||||||
if (!en.endsWith("[x]"))
|
if (!en.endsWith("[x]"))
|
||||||
throw new Error("Attempt to replace element name for a non-choice type");
|
throw new Error(context.formatMessage(I18nConstants.ATTEMPT_TO_REPLACE_ELEMENT_NAME_FOR_A_NONCHOICE_TYPE));
|
||||||
return en.substring(0, en.lastIndexOf(".")+1)+elementName;
|
return en.substring(0, en.lastIndexOf(".")+1)+elementName;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -54,6 +54,7 @@ import org.hl7.fhir.r5.utils.ToolingExtensions;
|
||||||
import org.hl7.fhir.r5.utils.formats.XmlLocationAnnotator;
|
import org.hl7.fhir.r5.utils.formats.XmlLocationAnnotator;
|
||||||
import org.hl7.fhir.r5.utils.formats.XmlLocationData;
|
import org.hl7.fhir.r5.utils.formats.XmlLocationData;
|
||||||
import org.hl7.fhir.utilities.ElementDecoration;
|
import org.hl7.fhir.utilities.ElementDecoration;
|
||||||
|
import org.hl7.fhir.utilities.I18nConstants;
|
||||||
import org.hl7.fhir.utilities.Utilities;
|
import org.hl7.fhir.utilities.Utilities;
|
||||||
import org.hl7.fhir.utilities.validation.ValidationMessage.IssueSeverity;
|
import org.hl7.fhir.utilities.validation.ValidationMessage.IssueSeverity;
|
||||||
import org.hl7.fhir.utilities.validation.ValidationMessage.IssueType;
|
import org.hl7.fhir.utilities.validation.ValidationMessage.IssueType;
|
||||||
|
@ -140,7 +141,8 @@ public class XmlParser extends ParserBase {
|
||||||
Node node = document.getFirstChild();
|
Node node = document.getFirstChild();
|
||||||
while (node != null) {
|
while (node != null) {
|
||||||
if (node.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE)
|
if (node.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE)
|
||||||
logError(line(document), col(document), "(document)", IssueType.INVALID, "No processing instructions allowed in resources", IssueSeverity.ERROR);
|
logError(line(document), col(document), "(document)", IssueType.INVALID, context.formatMessage(
|
||||||
|
I18nConstants.NO_PROCESSING_INSTRUCTIONS_ALLOWED_IN_RESOURCES), IssueSeverity.ERROR);
|
||||||
node = node.getNextSibling();
|
node = node.getNextSibling();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -214,14 +216,14 @@ public class XmlParser extends ParserBase {
|
||||||
private void checkElement(org.w3c.dom.Element element, String path, Property prop) throws FHIRFormatError {
|
private void checkElement(org.w3c.dom.Element element, String path, Property prop) throws FHIRFormatError {
|
||||||
if (policy == ValidationPolicy.EVERYTHING) {
|
if (policy == ValidationPolicy.EVERYTHING) {
|
||||||
if (empty(element) && FormatUtilities.FHIR_NS.equals(element.getNamespaceURI())) // this rule only applies to FHIR Content
|
if (empty(element) && FormatUtilities.FHIR_NS.equals(element.getNamespaceURI())) // this rule only applies to FHIR Content
|
||||||
logError(line(element), col(element), path, IssueType.INVALID, "Element must have some content", IssueSeverity.ERROR);
|
logError(line(element), col(element), path, IssueType.INVALID, context.formatMessage(I18nConstants.ELEMENT_MUST_HAVE_SOME_CONTENT), IssueSeverity.ERROR);
|
||||||
String ns = FormatUtilities.FHIR_NS;
|
String ns = FormatUtilities.FHIR_NS;
|
||||||
if (ToolingExtensions.hasExtension(prop.getDefinition(), "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace"))
|
if (ToolingExtensions.hasExtension(prop.getDefinition(), "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace"))
|
||||||
ns = ToolingExtensions.readStringExtension(prop.getDefinition(), "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace");
|
ns = ToolingExtensions.readStringExtension(prop.getDefinition(), "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace");
|
||||||
else if (ToolingExtensions.hasExtension(prop.getStructure(), "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace"))
|
else if (ToolingExtensions.hasExtension(prop.getStructure(), "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace"))
|
||||||
ns = ToolingExtensions.readStringExtension(prop.getStructure(), "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace");
|
ns = ToolingExtensions.readStringExtension(prop.getStructure(), "http://hl7.org/fhir/StructureDefinition/elementdefinition-namespace");
|
||||||
if (!element.getNamespaceURI().equals(ns))
|
if (!element.getNamespaceURI().equals(ns))
|
||||||
logError(line(element), col(element), path, IssueType.INVALID, "Wrong namespace - expected '"+ns+"'", IssueSeverity.ERROR);
|
logError(line(element), col(element), path, IssueType.INVALID, context.formatMessage(I18nConstants.WRONG_NAMESPACE__EXPECTED_, ns), IssueSeverity.ERROR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -236,10 +238,10 @@ public class XmlParser extends ParserBase {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void parseChildren(String path, org.w3c.dom.Element node, Element context) throws FHIRFormatError, FHIRException, IOException, DefinitionException {
|
private void parseChildren(String path, org.w3c.dom.Element node, Element element) throws FHIRFormatError, FHIRException, IOException, DefinitionException {
|
||||||
// this parsing routine retains the original order in a the XML file, to support validation
|
// this parsing routine retains the original order in a the XML file, to support validation
|
||||||
reapComments(node, context);
|
reapComments(node, element);
|
||||||
List<Property> properties = context.getProperty().getChildProperties(context.getName(), XMLUtil.getXsiType(node));
|
List<Property> properties = element.getProperty().getChildProperties(element.getName(), XMLUtil.getXsiType(node));
|
||||||
|
|
||||||
String text = XMLUtil.getDirectText(node).trim();
|
String text = XMLUtil.getDirectText(node).trim();
|
||||||
if (!Utilities.noString(text)) {
|
if (!Utilities.noString(text)) {
|
||||||
|
@ -247,17 +249,17 @@ public class XmlParser extends ParserBase {
|
||||||
if (property != null) {
|
if (property != null) {
|
||||||
if ("ED.data[x]".equals(property.getDefinition().getId()) || (property.getDefinition()!=null && property.getDefinition().getBase()!=null && "ED.data[x]".equals(property.getDefinition().getBase().getPath()))) {
|
if ("ED.data[x]".equals(property.getDefinition().getId()) || (property.getDefinition()!=null && property.getDefinition().getBase()!=null && "ED.data[x]".equals(property.getDefinition().getBase().getPath()))) {
|
||||||
if ("B64".equals(node.getAttribute("representation"))) {
|
if ("B64".equals(node.getAttribute("representation"))) {
|
||||||
context.getChildren().add(new Element("dataBase64Binary", property, "base64Binary", text).markLocation(line(node), col(node)));
|
element.getChildren().add(new Element("dataBase64Binary", property, "base64Binary", text).markLocation(line(node), col(node)));
|
||||||
} else {
|
} else {
|
||||||
context.getChildren().add(new Element("dataString", property, "string", text).markLocation(line(node), col(node)));
|
element.getChildren().add(new Element("dataString", property, "string", text).markLocation(line(node), col(node)));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
context.getChildren().add(
|
element.getChildren().add(
|
||||||
new Element(property.getName(), property, property.getType(), text).markLocation(line(node), col(node)));
|
new Element(property.getName(), property, property.getType(), text).markLocation(line(node), col(node)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
logError(line(node), col(node), path, IssueType.STRUCTURE, "Text should not be present", IssueSeverity.ERROR);
|
logError(line(node), col(node), path, IssueType.STRUCTURE, context.formatMessage(I18nConstants.TEXT_SHOULD_NOT_BE_PRESENT), IssueSeverity.ERROR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -269,10 +271,10 @@ public class XmlParser extends ParserBase {
|
||||||
String av = attr.getNodeValue();
|
String av = attr.getNodeValue();
|
||||||
if (ToolingExtensions.hasExtension(property.getDefinition(), "http://www.healthintersections.com.au/fhir/StructureDefinition/elementdefinition-dateformat"))
|
if (ToolingExtensions.hasExtension(property.getDefinition(), "http://www.healthintersections.com.au/fhir/StructureDefinition/elementdefinition-dateformat"))
|
||||||
av = convertForDateFormatFromExternal(ToolingExtensions.readStringExtension(property.getDefinition(), "http://www.healthintersections.com.au/fhir/StructureDefinition/elementdefinition-dateformat"), av);
|
av = convertForDateFormatFromExternal(ToolingExtensions.readStringExtension(property.getDefinition(), "http://www.healthintersections.com.au/fhir/StructureDefinition/elementdefinition-dateformat"), av);
|
||||||
if (property.getName().equals("value") && context.isPrimitive())
|
if (property.getName().equals("value") && element.isPrimitive())
|
||||||
context.setValue(av);
|
element.setValue(av);
|
||||||
else
|
else
|
||||||
context.getChildren().add(new Element(property.getName(), property, property.getType(), av).markLocation(line(node), col(node)));
|
element.getChildren().add(new Element(property.getName(), property, property.getType(), av).markLocation(line(node), col(node)));
|
||||||
} else {
|
} else {
|
||||||
boolean ok = false;
|
boolean ok = false;
|
||||||
if (FormatUtilities.FHIR_NS.equals(node.getNamespaceURI())) {
|
if (FormatUtilities.FHIR_NS.equals(node.getNamespaceURI())) {
|
||||||
|
@ -281,9 +283,9 @@ public class XmlParser extends ParserBase {
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
ok = ok || (attr.getLocalName().equals("schemaLocation")); // xsi:schemalocation allowed for non FHIR content
|
ok = ok || (attr.getLocalName().equals("schemaLocation")); // xsi:schemalocation allowed for non FHIR content
|
||||||
ok = ok || (hasTypeAttr(context) && attr.getLocalName().equals("type") && FormatUtilities.NS_XSI.equals(attr.getNamespaceURI())); // xsi:type allowed if element says so
|
ok = ok || (hasTypeAttr(element) && attr.getLocalName().equals("type") && FormatUtilities.NS_XSI.equals(attr.getNamespaceURI())); // xsi:type allowed if element says so
|
||||||
if (!ok)
|
if (!ok)
|
||||||
logError(line(node), col(node), path, IssueType.STRUCTURE, "Undefined attribute '@"+attr.getNodeName()+"' on "+node.getNodeName()+" for type "+context.fhirType()+" (properties = "+properties+")", IssueSeverity.ERROR);
|
logError(line(node), col(node), path, IssueType.STRUCTURE, context.formatMessage(I18nConstants.UNDEFINED_ATTRIBUTE__ON__FOR_TYPE__PROPERTIES__, attr.getNodeName(), node.getNodeName(), element.fhirType(), properties), IssueSeverity.ERROR);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -295,11 +297,11 @@ public class XmlParser extends ParserBase {
|
||||||
if (property != null) {
|
if (property != null) {
|
||||||
if (!property.isChoice() && "xhtml".equals(property.getType())) {
|
if (!property.isChoice() && "xhtml".equals(property.getType())) {
|
||||||
XhtmlNode xhtml;
|
XhtmlNode xhtml;
|
||||||
if (property.getDefinition().hasRepresentation(PropertyRepresentation.CDATEXT))
|
if (property.getDefinition().hasRepresentation(PropertyRepresentation.CDATEXT))
|
||||||
xhtml = new CDANarrativeFormat().convert((org.w3c.dom.Element) child);
|
xhtml = new CDANarrativeFormat().convert((org.w3c.dom.Element) child);
|
||||||
else
|
else
|
||||||
xhtml = new XhtmlParser().setValidatorMode(true).parseHtmlNode((org.w3c.dom.Element) child);
|
xhtml = new XhtmlParser().setValidatorMode(true).parseHtmlNode((org.w3c.dom.Element) child);
|
||||||
context.getChildren().add(new Element(property.getName(), property, "xhtml", new XhtmlComposer(XhtmlComposer.XML, false).compose(xhtml)).setXhtml(xhtml).markLocation(line(child), col(child)));
|
element.getChildren().add(new Element(property.getName(), property, "xhtml", new XhtmlComposer(XhtmlComposer.XML, false).compose(xhtml)).setXhtml(xhtml).markLocation(line(child), col(child)));
|
||||||
} else {
|
} else {
|
||||||
String npath = path+"/"+pathPrefix(child.getNamespaceURI())+child.getLocalName();
|
String npath = path+"/"+pathPrefix(child.getNamespaceURI())+child.getLocalName();
|
||||||
Element n = new Element(child.getLocalName(), property).markLocation(line(child), col(child));
|
Element n = new Element(child.getLocalName(), property).markLocation(line(child), col(child));
|
||||||
|
@ -313,7 +315,7 @@ public class XmlParser extends ParserBase {
|
||||||
xsiType = ToolingExtensions.readStringExtension(property.getDefinition(), "http://hl7.org/fhir/StructureDefinition/elementdefinition-defaulttype");
|
xsiType = ToolingExtensions.readStringExtension(property.getDefinition(), "http://hl7.org/fhir/StructureDefinition/elementdefinition-defaulttype");
|
||||||
n.setType(xsiType);
|
n.setType(xsiType);
|
||||||
} else {
|
} else {
|
||||||
logError(line(child), col(child), path, IssueType.STRUCTURE, "No type found on '"+child.getLocalName()+'"', IssueSeverity.ERROR);
|
logError(line(child), col(child), path, IssueType.STRUCTURE, context.formatMessage(I18nConstants.NO_TYPE_FOUND_ON_, child.getLocalName()), IssueSeverity.ERROR);
|
||||||
ok = false;
|
ok = false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -325,7 +327,7 @@ public class XmlParser extends ParserBase {
|
||||||
} else
|
} else
|
||||||
n.setType(n.getType());
|
n.setType(n.getType());
|
||||||
}
|
}
|
||||||
context.getChildren().add(n);
|
element.getChildren().add(n);
|
||||||
if (ok) {
|
if (ok) {
|
||||||
if (property.isResource())
|
if (property.isResource())
|
||||||
parseResource(npath, (org.w3c.dom.Element) child, n, property);
|
parseResource(npath, (org.w3c.dom.Element) child, n, property);
|
||||||
|
@ -334,11 +336,11 @@ public class XmlParser extends ParserBase {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
logError(line(child), col(child), path, IssueType.STRUCTURE, "Undefined element '"+child.getLocalName()+"'", IssueSeverity.ERROR);
|
logError(line(child), col(child), path, IssueType.STRUCTURE, context.formatMessage(I18nConstants.UNDEFINED_ELEMENT_, child.getLocalName()), IssueSeverity.ERROR);
|
||||||
} else if (child.getNodeType() == Node.CDATA_SECTION_NODE){
|
} else if (child.getNodeType() == Node.CDATA_SECTION_NODE){
|
||||||
logError(line(child), col(child), path, IssueType.STRUCTURE, "CDATA is not allowed", IssueSeverity.ERROR);
|
logError(line(child), col(child), path, IssueType.STRUCTURE, context.formatMessage(I18nConstants.CDATA_IS_NOT_ALLOWED), IssueSeverity.ERROR);
|
||||||
} else if (!Utilities.existsInList(child.getNodeType(), 3, 8)) {
|
} else if (!Utilities.existsInList(child.getNodeType(), 3, 8)) {
|
||||||
logError(line(child), col(child), path, IssueType.STRUCTURE, "Node type "+Integer.toString(child.getNodeType())+" is not allowed", IssueSeverity.ERROR);
|
logError(line(child), col(child), path, IssueType.STRUCTURE, context.formatMessage(I18nConstants.NODE_TYPE__IS_NOT_ALLOWED, Integer.toString(child.getNodeType())), IssueSeverity.ERROR);
|
||||||
}
|
}
|
||||||
child = child.getNextSibling();
|
child = child.getNextSibling();
|
||||||
}
|
}
|
||||||
|
@ -355,7 +357,8 @@ public class XmlParser extends ParserBase {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
for (Property p : propsSortedByLongestFirst)
|
for (Property p : propsSortedByLongestFirst)
|
||||||
if (!p.getDefinition().hasRepresentation(PropertyRepresentation.XMLATTR) && !p.getDefinition().hasRepresentation(PropertyRepresentation.XMLTEXT)) {
|
if (!p.getDefinition().hasRepresentation(PropertyRepresentation.XMLATTR) && !p.getDefinition().hasRepresentation(
|
||||||
|
PropertyRepresentation.XMLTEXT)) {
|
||||||
if (p.getName().equals(nodeName))
|
if (p.getName().equals(nodeName))
|
||||||
return p;
|
return p;
|
||||||
if (p.getName().endsWith("[x]") && nodeName.length() > p.getName().length()-3 && p.getName().substring(0, p.getName().length()-3).equals(nodeName.substring(0, p.getName().length()-3)))
|
if (p.getName().endsWith("[x]") && nodeName.length() > p.getName().length()-3 && p.getName().substring(0, p.getName().length()-3).equals(nodeName.substring(0, p.getName().length()-3)))
|
||||||
|
@ -366,7 +369,8 @@ public class XmlParser extends ParserBase {
|
||||||
|
|
||||||
private Property getAttrProp(List<Property> properties, String nodeName) {
|
private Property getAttrProp(List<Property> properties, String nodeName) {
|
||||||
for (Property p : properties)
|
for (Property p : properties)
|
||||||
if (p.getName().equals(nodeName) && p.getDefinition().hasRepresentation(PropertyRepresentation.XMLATTR))
|
if (p.getName().equals(nodeName) && p.getDefinition().hasRepresentation(
|
||||||
|
PropertyRepresentation.XMLATTR))
|
||||||
return p;
|
return p;
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -383,7 +387,7 @@ public class XmlParser extends ParserBase {
|
||||||
DateTimeType d = DateTimeType.parseV3(av);
|
DateTimeType d = DateTimeType.parseV3(av);
|
||||||
return d.asStringValue();
|
return d.asStringValue();
|
||||||
} else
|
} else
|
||||||
throw new FHIRException("Unknown Data format '"+fmt+"'");
|
throw new FHIRException(context.formatMessage(I18nConstants.UNKNOWN_DATA_FORMAT_, fmt));
|
||||||
}
|
}
|
||||||
|
|
||||||
private String convertForDateFormatToExternal(String fmt, String av) throws FHIRException {
|
private String convertForDateFormatToExternal(String fmt, String av) throws FHIRException {
|
||||||
|
@ -391,7 +395,7 @@ public class XmlParser extends ParserBase {
|
||||||
DateTimeType d = new DateTimeType(av);
|
DateTimeType d = new DateTimeType(av);
|
||||||
return d.getAsV3();
|
return d.getAsV3();
|
||||||
} else
|
} else
|
||||||
throw new FHIRException("Unknown Date format '"+fmt+"'");
|
throw new FHIRException(context.formatMessage(I18nConstants.UNKNOWN_DATE_FORMAT_, fmt));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void parseResource(String string, org.w3c.dom.Element container, Element parent, Property elementProperty) throws FHIRFormatError, DefinitionException, FHIRException, IOException {
|
private void parseResource(String string, org.w3c.dom.Element container, Element parent, Property elementProperty) throws FHIRFormatError, DefinitionException, FHIRException, IOException {
|
||||||
|
@ -399,7 +403,7 @@ public class XmlParser extends ParserBase {
|
||||||
String name = res.getLocalName();
|
String name = res.getLocalName();
|
||||||
StructureDefinition sd = context.fetchResource(StructureDefinition.class, ProfileUtilities.sdNs(name, context.getOverrideVersionNs()));
|
StructureDefinition sd = context.fetchResource(StructureDefinition.class, ProfileUtilities.sdNs(name, context.getOverrideVersionNs()));
|
||||||
if (sd == null)
|
if (sd == null)
|
||||||
throw new FHIRFormatError("Contained resource does not appear to be a FHIR resource (unknown name '"+res.getLocalName()+"')");
|
throw new FHIRFormatError(context.formatMessage(I18nConstants.CONTAINED_RESOURCE_DOES_NOT_APPEAR_TO_BE_A_FHIR_RESOURCE_UNKNOWN_NAME_, res.getLocalName()));
|
||||||
parent.updateProperty(new Property(context, sd.getSnapshot().getElement().get(0), sd), SpecialElement.fromProperty(parent.getProperty()), elementProperty);
|
parent.updateProperty(new Property(context, sd.getSnapshot().getElement().get(0), sd), SpecialElement.fromProperty(parent.getProperty()), elementProperty);
|
||||||
parent.setType(name);
|
parent.setType(name);
|
||||||
parseChildren(res.getLocalName(), res, parent);
|
parseChildren(res.getLocalName(), res, parent);
|
||||||
|
|
|
@ -364,5 +364,27 @@ public class I18nConstants {
|
||||||
public final static String UNRECOGNISED_PROPERTY_ = "Unrecognised_property_";
|
public final static String UNRECOGNISED_PROPERTY_ = "Unrecognised_property_";
|
||||||
public final static String OBJECT_MUST_HAVE_SOME_CONTENT = "Object_must_have_some_content";
|
public final static String OBJECT_MUST_HAVE_SOME_CONTENT = "Object_must_have_some_content";
|
||||||
public final static String ERROR_PARSING_JSON_ = "Error_parsing_JSON_";
|
public final static String ERROR_PARSING_JSON_ = "Error_parsing_JSON_";
|
||||||
|
public final static String NODE_TYPE__IS_NOT_ALLOWED = "Node_type__is_not_allowed";
|
||||||
|
public final static String CDATA_IS_NOT_ALLOWED = "CDATA_is_not_allowed";
|
||||||
|
public final static String UNDEFINED_ELEMENT_ = "Undefined_element_";
|
||||||
|
public final static String UNDEFINED_ATTRIBUTE__ON__FOR_TYPE__PROPERTIES__ = "Undefined_attribute__on__for_type__properties__";
|
||||||
|
public final static String TEXT_SHOULD_NOT_BE_PRESENT = "Text_should_not_be_present";
|
||||||
|
public final static String WRONG_NAMESPACE__EXPECTED_ = "Wrong_namespace__expected_";
|
||||||
|
public final static String ELEMENT_MUST_HAVE_SOME_CONTENT = "Element_must_have_some_content";
|
||||||
|
public final static String NO_PROCESSING_INSTRUCTIONS_ALLOWED_IN_RESOURCES = "No_processing_instructions_allowed_in_resources";
|
||||||
|
public final static String UNKNOWN_RESOURCE_TYPE_MISSING_RDFSTYPE = "Unknown_resource_type_missing_rdfstype";
|
||||||
|
public final static String REFERENCE_TO__CANNOT_BE_RESOLVED = "reference_to__cannot_be_resolved";
|
||||||
|
public final static String THIS_PROPERTY_MUST_BE_A_URI_OR_BNODE_NOT_A_ = "This_property_must_be_a_URI_or_bnode_not_a_";
|
||||||
|
public final static String THIS_PROPERTY_MUST_BE_A_LITERAL_NOT_A_ = "This_property_must_be_a_Literal_not_a_";
|
||||||
|
public final static String UNRECOGNISED_PREDICATE_ = "Unrecognised_predicate_";
|
||||||
|
public final static String ERROR_PARSING_TURTLE_ = "Error_parsing_Turtle_";
|
||||||
|
public final static String UNEXPECTED_DATATYPE_FOR_RDFSTYPE = "Unexpected_datatype_for_rdfstype";
|
||||||
|
public final static String ATTEMPT_TO_REPLACE_ELEMENT_NAME_FOR_A_NONCHOICE_TYPE = "Attempt_to_replace_element_name_for_a_nonchoice_type";
|
||||||
|
public final static String WRONG_TYPE_FOR_RESOURCE = "Wrong_type_for_resource";
|
||||||
|
public final static String CONTAINED_RESOURCE_DOES_NOT_APPEAR_TO_BE_A_FHIR_RESOURCE_UNKNOWN_NAME_ = "Contained_resource_does_not_appear_to_be_a_FHIR_resource_unknown_name_";
|
||||||
|
public final static String UNKNOWN_DATE_FORMAT_ = "Unknown_Date_format_";
|
||||||
|
public final static String UNKNOWN_DATA_FORMAT_ = "Unknown_Data_format_";
|
||||||
|
public final static String NO_TYPE_FOUND_ON_ = "No_type_found_on_";
|
||||||
|
public final static String ERROR_WRITING_NUMBER__TO_JSON = "error_writing_number__to_JSON";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -361,3 +361,27 @@ This_property_must_be_an_Array_not_ = This property must be an Array, not {0}
|
||||||
Unrecognised_property_ = Unrecognised property ''@{0}''
|
Unrecognised_property_ = Unrecognised property ''@{0}''
|
||||||
Object_must_have_some_content = Object must have some content
|
Object_must_have_some_content = Object must have some content
|
||||||
Error_parsing_JSON_ = Error parsing JSON: {0}
|
Error_parsing_JSON_ = Error parsing JSON: {0}
|
||||||
|
Node_type__is_not_allowed = Node type {0} is not allowed
|
||||||
|
CDATA_is_not_allowed = CDATA is not allowed
|
||||||
|
Undefined_element_ = Undefined element ''{0}''
|
||||||
|
Undefined_attribute__on__for_type__properties__ = Undefined attribute ''@{0}'' on {1} for type {2} (properties = {3})
|
||||||
|
Text_should_not_be_present = Text should not be present
|
||||||
|
Wrong_namespace__expected_ = Wrong namespace - expected ''{0}''
|
||||||
|
Element_must_have_some_content = Element must have some content
|
||||||
|
No_processing_instructions_allowed_in_resources = No processing instructions allowed in resources
|
||||||
|
Unknown_resource_type_missing_rdfstype = Unknown resource type (missing rdfs:type)
|
||||||
|
reference_to__cannot_be_resolved = reference to {0} cannot be resolved
|
||||||
|
This_property_must_be_a_URI_or_bnode_not_a_ = This property must be a URI or bnode, not a {0}
|
||||||
|
This_property_must_be_a_Literal_not_a_ = This property must be a Literal, not a {0}
|
||||||
|
Unrecognised_predicate_ = Unrecognised predicate ''{0}''
|
||||||
|
Error_parsing_Turtle_ = Error parsing Turtle: {0}
|
||||||
|
Unexpected_datatype_for_rdfstype = Unexpected datatype for rdfs:type
|
||||||
|
Attempt_to_replace_element_name_for_a_nonchoice_type = Attempt to replace element name for a non-choice type
|
||||||
|
Wrong_type_for_resource = Wrong type for resource
|
||||||
|
Contained_resource_does_not_appear_to_be_a_FHIR_resource_unknown_name_ = Contained resource does not appear to be a FHIR resource (unknown name ''{0}'')
|
||||||
|
Unknown_Date_format_ = Unknown Date format ''{0}''
|
||||||
|
Unknown_Data_format_ = Unknown Data format ''{0}''
|
||||||
|
No_type_found_on_ = No type found on ''{0}''
|
||||||
|
error_writing_number__to_JSON = error writing number ''{0}'' to JSON
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue