Checkstyle Abstract Class Name (#3966)

* init rev

* checkstyle enforce abstract classes start with "Base" (and vice versa)

* checkstyle enforce abstract classes start with "Base" (and vice versa)

Co-authored-by: Ken Stevens <ken@smilecdr.com>
This commit is contained in:
Ken Stevens 2022-08-30 22:15:32 -04:00 committed by GitHub
parent 7d478f041e
commit 26ca950bce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
98 changed files with 560 additions and 582 deletions

View File

@ -1,7 +1,7 @@
package ca.uhn.fhir.parser;
import ca.uhn.fhir.parser.json.JsonLikeValue.ScalarType;
import ca.uhn.fhir.parser.json.JsonLikeValue.ValueType;
import ca.uhn.fhir.parser.json.BaseJsonLikeValue.ScalarType;
import ca.uhn.fhir.parser.json.BaseJsonLikeValue.ValueType;
/*
* #%L

View File

@ -20,14 +20,13 @@ package ca.uhn.fhir.parser;
* #L%
*/
import java.io.IOException;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.parser.json.BaseJsonLikeWriter;
import ca.uhn.fhir.parser.json.JsonLikeStructure;
import org.hl7.fhir.instance.model.api.IAnyResource;
import org.hl7.fhir.instance.model.api.IBaseResource;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.parser.json.JsonLikeStructure;
import ca.uhn.fhir.parser.json.JsonLikeWriter;
import java.io.IOException;
/**
* An extension to the parser interface that is implemented by parsers that understand a generalized form of
@ -39,7 +38,7 @@ import ca.uhn.fhir.parser.json.JsonLikeWriter;
*/
public interface IJsonLikeParser extends IParser {
void encodeResourceToJsonLikeWriter(IBaseResource theResource, JsonLikeWriter theJsonLikeWriter) throws IOException, DataFormatException;
void encodeResourceToJsonLikeWriter(IBaseResource theResource, BaseJsonLikeWriter theJsonLikeWriter) throws IOException, DataFormatException;
/**
* Parses a resource from a JSON-like data structure

View File

@ -1,7 +1,7 @@
package ca.uhn.fhir.parser;
import ca.uhn.fhir.parser.json.JsonLikeValue.ScalarType;
import ca.uhn.fhir.parser.json.JsonLikeValue.ValueType;
import ca.uhn.fhir.parser.json.BaseJsonLikeValue.ScalarType;
import ca.uhn.fhir.parser.json.BaseJsonLikeValue.ValueType;
/*
* #%L

View File

@ -45,13 +45,13 @@ import ca.uhn.fhir.model.base.composite.BaseContainedDt;
import ca.uhn.fhir.model.primitive.IdDt;
import ca.uhn.fhir.model.primitive.InstantDt;
import ca.uhn.fhir.narrative.INarrativeGenerator;
import ca.uhn.fhir.parser.json.JsonLikeArray;
import ca.uhn.fhir.parser.json.JsonLikeObject;
import ca.uhn.fhir.parser.json.BaseJsonLikeArray;
import ca.uhn.fhir.parser.json.BaseJsonLikeObject;
import ca.uhn.fhir.parser.json.BaseJsonLikeValue;
import ca.uhn.fhir.parser.json.BaseJsonLikeValue.ScalarType;
import ca.uhn.fhir.parser.json.BaseJsonLikeValue.ValueType;
import ca.uhn.fhir.parser.json.BaseJsonLikeWriter;
import ca.uhn.fhir.parser.json.JsonLikeStructure;
import ca.uhn.fhir.parser.json.JsonLikeValue;
import ca.uhn.fhir.parser.json.JsonLikeValue.ScalarType;
import ca.uhn.fhir.parser.json.JsonLikeValue.ValueType;
import ca.uhn.fhir.parser.json.JsonLikeWriter;
import ca.uhn.fhir.parser.json.jackson.JacksonStructure;
import ca.uhn.fhir.rest.api.EncodingEnum;
import ca.uhn.fhir.util.ElementUtil;
@ -177,20 +177,20 @@ public class JsonParser extends BaseParser implements IJsonLikeParser {
// }
// }
private void beginArray(JsonLikeWriter theEventWriter, String arrayName) throws IOException {
private void beginArray(BaseJsonLikeWriter theEventWriter, String arrayName) throws IOException {
theEventWriter.beginArray(arrayName);
}
private void beginObject(JsonLikeWriter theEventWriter, String arrayName) throws IOException {
private void beginObject(BaseJsonLikeWriter theEventWriter, String arrayName) throws IOException {
theEventWriter.beginObject(arrayName);
}
private JsonLikeWriter createJsonWriter(Writer theWriter) throws IOException {
private BaseJsonLikeWriter createJsonWriter(Writer theWriter) throws IOException {
JsonLikeStructure jsonStructure = new JacksonStructure();
return jsonStructure.getJsonLikeWriter(theWriter);
}
public void doEncodeResourceToJsonLikeWriter(IBaseResource theResource, JsonLikeWriter theEventWriter, EncodeContext theEncodeContext) throws IOException {
public void doEncodeResourceToJsonLikeWriter(IBaseResource theResource, BaseJsonLikeWriter theEventWriter, EncodeContext theEncodeContext) throws IOException {
if (myPrettyPrint) {
theEventWriter.setPrettyPrint(myPrettyPrint);
}
@ -203,7 +203,7 @@ public class JsonParser extends BaseParser implements IJsonLikeParser {
@Override
protected void doEncodeResourceToWriter(IBaseResource theResource, Writer theWriter, EncodeContext theEncodeContext) throws IOException {
JsonLikeWriter eventWriter = createJsonWriter(theWriter);
BaseJsonLikeWriter eventWriter = createJsonWriter(theWriter);
doEncodeResourceToJsonLikeWriter(theResource, eventWriter, theEncodeContext);
eventWriter.close();
}
@ -219,9 +219,9 @@ public class JsonParser extends BaseParser implements IJsonLikeParser {
}
public <T extends IBaseResource> T doParseResource(Class<T> theResourceType, JsonLikeStructure theJsonStructure) {
JsonLikeObject object = theJsonStructure.getRootObject();
BaseJsonLikeObject object = theJsonStructure.getRootObject();
JsonLikeValue resourceTypeObj = object.get("resourceType");
BaseJsonLikeValue resourceTypeObj = object.get("resourceType");
if (resourceTypeObj == null || !resourceTypeObj.isString() || isBlank(resourceTypeObj.getAsString())) {
throw new DataFormatException(Msg.code(1838) + "Invalid JSON content detected, missing required element: 'resourceType'");
}
@ -242,7 +242,7 @@ public class JsonParser extends BaseParser implements IJsonLikeParser {
return retVal;
}
private void encodeChildElementToStreamWriter(RuntimeResourceDefinition theResDef, IBaseResource theResource, JsonLikeWriter theEventWriter, IBase theNextValue,
private void encodeChildElementToStreamWriter(RuntimeResourceDefinition theResDef, IBaseResource theResource, BaseJsonLikeWriter theEventWriter, IBase theNextValue,
BaseRuntimeElementDefinition<?> theChildDef, String theChildName, boolean theContainedResource, CompositeChildElement theChildElem,
boolean theForceEmpty, EncodeContext theEncodeContext) throws IOException {
@ -388,7 +388,7 @@ public class JsonParser extends BaseParser implements IJsonLikeParser {
}
private void encodeCompositeElementChildrenToStreamWriter(RuntimeResourceDefinition theResDef, IBaseResource theResource, IBase theElement, JsonLikeWriter theEventWriter,
private void encodeCompositeElementChildrenToStreamWriter(RuntimeResourceDefinition theResDef, IBaseResource theResource, IBase theElement, BaseJsonLikeWriter theEventWriter,
boolean theContainedResource, CompositeChildElement theParent, EncodeContext theEncodeContext) throws IOException {
{
@ -626,14 +626,14 @@ public class JsonParser extends BaseParser implements IJsonLikeParser {
return maxCardinality > 1 || maxCardinality == Child.MAX_UNLIMITED;
}
private void encodeCompositeElementToStreamWriter(RuntimeResourceDefinition theResDef, IBaseResource theResource, IBase theNextValue, JsonLikeWriter theEventWriter, boolean theContainedResource, CompositeChildElement theParent, EncodeContext theEncodeContext) throws IOException, DataFormatException {
private void encodeCompositeElementToStreamWriter(RuntimeResourceDefinition theResDef, IBaseResource theResource, IBase theNextValue, BaseJsonLikeWriter theEventWriter, boolean theContainedResource, CompositeChildElement theParent, EncodeContext theEncodeContext) throws IOException, DataFormatException {
writeCommentsPreAndPost(theNextValue, theEventWriter);
encodeCompositeElementChildrenToStreamWriter(theResDef, theResource, theNextValue, theEventWriter, theContainedResource, theParent, theEncodeContext);
}
@Override
public void encodeResourceToJsonLikeWriter(IBaseResource theResource, JsonLikeWriter theJsonLikeWriter) throws IOException, DataFormatException {
public void encodeResourceToJsonLikeWriter(IBaseResource theResource, BaseJsonLikeWriter theJsonLikeWriter) throws IOException, DataFormatException {
Validate.notNull(theResource, "theResource can not be null");
Validate.notNull(theJsonLikeWriter, "theJsonLikeWriter can not be null");
@ -647,7 +647,7 @@ public class JsonParser extends BaseParser implements IJsonLikeParser {
doEncodeResourceToJsonLikeWriter(theResource, theJsonLikeWriter, encodeContext);
}
private void encodeResourceToJsonStreamWriter(RuntimeResourceDefinition theResDef, IBaseResource theResource, JsonLikeWriter theEventWriter, String theObjectNameOrNull,
private void encodeResourceToJsonStreamWriter(RuntimeResourceDefinition theResDef, IBaseResource theResource, BaseJsonLikeWriter theEventWriter, String theObjectNameOrNull,
boolean theContainedResource, EncodeContext theEncodeContext) throws IOException {
IIdType resourceId = null;
@ -669,7 +669,7 @@ public class JsonParser extends BaseParser implements IJsonLikeParser {
encodeResourceToJsonStreamWriter(theResDef, theResource, theEventWriter, theObjectNameOrNull, theContainedResource, resourceId, theEncodeContext);
}
private void encodeResourceToJsonStreamWriter(RuntimeResourceDefinition theResDef, IBaseResource theResource, JsonLikeWriter theEventWriter, String theObjectNameOrNull,
private void encodeResourceToJsonStreamWriter(RuntimeResourceDefinition theResDef, IBaseResource theResource, BaseJsonLikeWriter theEventWriter, String theObjectNameOrNull,
boolean theContainedResource, IIdType theResourceId, EncodeContext theEncodeContext) throws IOException {
if (!super.shouldEncodeResource(theResDef.getName())) {
@ -792,7 +792,7 @@ public class JsonParser extends BaseParser implements IJsonLikeParser {
boolean theContainedResource,
List<Map.Entry<ResourceMetadataKeyEnum<?>, Object>> extensionMetadataKeys,
RuntimeResourceDefinition resDef,
JsonLikeWriter theEventWriter, EncodeContext theEncodeContext) throws IOException {
BaseJsonLikeWriter theEventWriter, EncodeContext theEncodeContext) throws IOException {
if (extensionMetadataKeys.isEmpty()) {
return;
}
@ -808,7 +808,7 @@ public class JsonParser extends BaseParser implements IJsonLikeParser {
* This is useful only for the two cases where extensions are encoded as direct children (e.g. not in some object
* called _name): resource extensions, and extension extensions
*/
private void extractAndWriteExtensionsAsDirectChild(IBase theElement, JsonLikeWriter theEventWriter, BaseRuntimeElementDefinition<?> theElementDef, RuntimeResourceDefinition theResDef,
private void extractAndWriteExtensionsAsDirectChild(IBase theElement, BaseJsonLikeWriter theEventWriter, BaseRuntimeElementDefinition<?> theElementDef, RuntimeResourceDefinition theResDef,
IBaseResource theResource, CompositeChildElement theChildElem, CompositeChildElement theParent, EncodeContext theEncodeContext, boolean theContainedResource) throws IOException {
List<HeldExtension> extensions = new ArrayList<>(0);
List<HeldExtension> modifierExtensions = new ArrayList<>(0);
@ -921,8 +921,8 @@ public class JsonParser extends BaseParser implements IJsonLikeParser {
return EncodingEnum.JSON;
}
private JsonLikeArray grabJsonArray(JsonLikeObject theObject, String nextName, String thePosition) {
JsonLikeValue object = theObject.get(nextName);
private BaseJsonLikeArray grabJsonArray(BaseJsonLikeObject theObject, String nextName, String thePosition) {
BaseJsonLikeValue object = theObject.get(nextName);
if (object == null || object.isNull()) {
return null;
}
@ -932,13 +932,13 @@ public class JsonParser extends BaseParser implements IJsonLikeParser {
return object.getAsArray();
}
private void parseAlternates(JsonLikeValue theAlternateVal, ParserState<?> theState, String theElementName, String theAlternateName) {
private void parseAlternates(BaseJsonLikeValue theAlternateVal, ParserState<?> theState, String theElementName, String theAlternateName) {
if (theAlternateVal == null || theAlternateVal.isNull()) {
return;
}
if (theAlternateVal.isArray()) {
JsonLikeArray array = theAlternateVal.getAsArray();
BaseJsonLikeArray array = theAlternateVal.getAsArray();
if (array.size() > 1) {
throw new DataFormatException(Msg.code(1842) + "Unexpected array of length " + array.size() + " (expected 0 or 1) for element: " + theElementName);
}
@ -949,24 +949,24 @@ public class JsonParser extends BaseParser implements IJsonLikeParser {
return;
}
JsonLikeValue alternateVal = theAlternateVal;
BaseJsonLikeValue alternateVal = theAlternateVal;
if (alternateVal.isObject() == false) {
getErrorHandler().incorrectJsonType(null, theAlternateName, ValueType.OBJECT, null, alternateVal.getJsonType(), null);
return;
}
JsonLikeObject alternate = alternateVal.getAsObject();
BaseJsonLikeObject alternate = alternateVal.getAsObject();
for (Iterator<String> keyIter = alternate.keyIterator(); keyIter.hasNext(); ) {
String nextKey = keyIter.next();
JsonLikeValue nextVal = alternate.get(nextKey);
BaseJsonLikeValue nextVal = alternate.get(nextKey);
if ("extension".equals(nextKey)) {
boolean isModifier = false;
JsonLikeArray array = nextVal.getAsArray();
BaseJsonLikeArray array = nextVal.getAsArray();
parseExtension(theState, array, isModifier);
} else if ("modifierExtension".equals(nextKey)) {
boolean isModifier = true;
JsonLikeArray array = nextVal.getAsArray();
BaseJsonLikeArray array = nextVal.getAsArray();
parseExtension(theState, array, isModifier);
} else if ("id".equals(nextKey)) {
if (nextVal.isString()) {
@ -980,7 +980,7 @@ public class JsonParser extends BaseParser implements IJsonLikeParser {
}
}
private void parseChildren(JsonLikeObject theObject, ParserState<?> theState) {
private void parseChildren(BaseJsonLikeObject theObject, ParserState<?> theState) {
int allUnderscoreNames = 0;
int handledUnderscoreNames = 0;
@ -989,11 +989,11 @@ public class JsonParser extends BaseParser implements IJsonLikeParser {
if ("resourceType".equals(nextName)) {
continue;
} else if ("extension".equals(nextName)) {
JsonLikeArray array = grabJsonArray(theObject, nextName, "extension");
BaseJsonLikeArray array = grabJsonArray(theObject, nextName, "extension");
parseExtension(theState, array, false);
continue;
} else if ("modifierExtension".equals(nextName)) {
JsonLikeArray array = grabJsonArray(theObject, nextName, "modifierExtension");
BaseJsonLikeArray array = grabJsonArray(theObject, nextName, "modifierExtension");
parseExtension(theState, array, true);
continue;
} else if (nextName.equals("fhir_comments")) {
@ -1004,9 +1004,9 @@ public class JsonParser extends BaseParser implements IJsonLikeParser {
continue;
}
JsonLikeValue nextVal = theObject.get(nextName);
BaseJsonLikeValue nextVal = theObject.get(nextName);
String alternateName = '_' + nextName;
JsonLikeValue alternateVal = theObject.get(alternateName);
BaseJsonLikeValue alternateVal = theObject.get(alternateName);
if (alternateVal != null) {
handledUnderscoreNames++;
}
@ -1034,7 +1034,7 @@ public class JsonParser extends BaseParser implements IJsonLikeParser {
for (Iterator<String> keyIter = theObject.keyIterator(); keyIter.hasNext(); ) {
String alternateName = keyIter.next();
if (alternateName.startsWith("_") && alternateName.length() > 1) {
JsonLikeValue nextValue = theObject.get(alternateName);
BaseJsonLikeValue nextValue = theObject.get(alternateName);
if (nextValue != null) {
if (nextValue.isObject()) {
String nextName = alternateName.substring(1);
@ -1053,7 +1053,7 @@ public class JsonParser extends BaseParser implements IJsonLikeParser {
}
private void parseChildren(ParserState<?> theState, String theName, JsonLikeValue theJsonVal, JsonLikeValue theAlternateVal, String theAlternateName, boolean theInArray) {
private void parseChildren(ParserState<?> theState, String theName, BaseJsonLikeValue theJsonVal, BaseJsonLikeValue theAlternateVal, String theAlternateName, boolean theInArray) {
if (theName.equals("id")) {
if (!theJsonVal.isString()) {
getErrorHandler().incorrectJsonType(null, "id", ValueType.SCALAR, ScalarType.STRING, theJsonVal.getJsonType(), theJsonVal.getDataType());
@ -1061,18 +1061,18 @@ public class JsonParser extends BaseParser implements IJsonLikeParser {
}
if (theJsonVal.isArray()) {
JsonLikeArray nextArray = theJsonVal.getAsArray();
BaseJsonLikeArray nextArray = theJsonVal.getAsArray();
JsonLikeValue alternateVal = theAlternateVal;
BaseJsonLikeValue alternateVal = theAlternateVal;
if (alternateVal != null && alternateVal.isArray() == false) {
getErrorHandler().incorrectJsonType(null, theAlternateName, ValueType.ARRAY, null, alternateVal.getJsonType(), null);
alternateVal = null;
}
JsonLikeArray nextAlternateArray = JsonLikeValue.asArray(alternateVal); // could be null
BaseJsonLikeArray nextAlternateArray = BaseJsonLikeValue.asArray(alternateVal); // could be null
for (int i = 0; i < nextArray.size(); i++) {
JsonLikeValue nextObject = nextArray.get(i);
JsonLikeValue nextAlternate = null;
BaseJsonLikeValue nextObject = nextArray.get(i);
BaseJsonLikeValue nextAlternate = null;
if (nextAlternateArray != null && nextAlternateArray.size() >= (i + 1)) {
nextAlternate = nextAlternateArray.get(i);
}
@ -1085,10 +1085,10 @@ public class JsonParser extends BaseParser implements IJsonLikeParser {
theState.enteringNewElement(null, theName);
parseAlternates(theAlternateVal, theState, theAlternateName, theAlternateName);
JsonLikeObject nextObject = theJsonVal.getAsObject();
BaseJsonLikeObject nextObject = theJsonVal.getAsObject();
boolean preResource = false;
if (theState.isPreResource()) {
JsonLikeValue resType = nextObject.get("resourceType");
BaseJsonLikeValue resType = nextObject.get("resourceType");
if (resType == null || !resType.isString()) {
throw new DataFormatException(Msg.code(1843) + "Missing required element 'resourceType' from JSON resource object, unable to parse");
}
@ -1114,13 +1114,13 @@ public class JsonParser extends BaseParser implements IJsonLikeParser {
}
}
private void parseExtension(ParserState<?> theState, JsonLikeArray theValues, boolean theIsModifier) {
private void parseExtension(ParserState<?> theState, BaseJsonLikeArray theValues, boolean theIsModifier) {
int allUnderscoreNames = 0;
int handledUnderscoreNames = 0;
for (int i = 0; i < theValues.size(); i++) {
JsonLikeObject nextExtObj = JsonLikeValue.asObject(theValues.get(i));
JsonLikeValue jsonElement = nextExtObj.get("url");
BaseJsonLikeObject nextExtObj = BaseJsonLikeValue.asObject(theValues.get(i));
BaseJsonLikeValue jsonElement = nextExtObj.get("url");
String url;
if (null == jsonElement || !(jsonElement.isScalar())) {
String parentElementName;
@ -1140,18 +1140,18 @@ public class JsonParser extends BaseParser implements IJsonLikeParser {
if ("url".equals(next)) {
continue;
} else if ("extension".equals(next)) {
JsonLikeArray jsonVal = JsonLikeValue.asArray(nextExtObj.get(next));
BaseJsonLikeArray jsonVal = BaseJsonLikeValue.asArray(nextExtObj.get(next));
parseExtension(theState, jsonVal, false);
} else if ("modifierExtension".equals(next)) {
JsonLikeArray jsonVal = JsonLikeValue.asArray(nextExtObj.get(next));
BaseJsonLikeArray jsonVal = BaseJsonLikeValue.asArray(nextExtObj.get(next));
parseExtension(theState, jsonVal, true);
} else if (next.charAt(0) == '_') {
allUnderscoreNames++;
continue;
} else {
JsonLikeValue jsonVal = nextExtObj.get(next);
BaseJsonLikeValue jsonVal = nextExtObj.get(next);
String alternateName = '_' + next;
JsonLikeValue alternateVal = nextExtObj.get(alternateName);
BaseJsonLikeValue alternateVal = nextExtObj.get(alternateName);
if (alternateVal != null) {
handledUnderscoreNames++;
}
@ -1169,7 +1169,7 @@ public class JsonParser extends BaseParser implements IJsonLikeParser {
for (Iterator<String> keyIter = nextExtObj.keyIterator(); keyIter.hasNext(); ) {
String alternateName = keyIter.next();
if (alternateName.startsWith("_") && alternateName.length() > 1) {
JsonLikeValue nextValue = nextExtObj.get(alternateName);
BaseJsonLikeValue nextValue = nextExtObj.get(alternateName);
if (nextValue != null) {
if (nextValue.isObject()) {
String nextName = alternateName.substring(1);
@ -1189,11 +1189,11 @@ public class JsonParser extends BaseParser implements IJsonLikeParser {
}
}
private void parseFhirComments(JsonLikeValue theObject, ParserState<?> theState) {
private void parseFhirComments(BaseJsonLikeValue theObject, ParserState<?> theState) {
if (theObject.isArray()) {
JsonLikeArray comments = theObject.getAsArray();
BaseJsonLikeArray comments = theObject.getAsArray();
for (int i = 0; i < comments.size(); i++) {
JsonLikeValue nextComment = comments.get(i);
BaseJsonLikeValue nextComment = comments.get(i);
if (nextComment.isString()) {
String commentText = nextComment.getAsString();
if (commentText != null) {
@ -1281,7 +1281,7 @@ public class JsonParser extends BaseParser implements IJsonLikeParser {
return this;
}
private void write(JsonLikeWriter theEventWriter, String theChildName, Boolean theValue) throws IOException {
private void write(BaseJsonLikeWriter theEventWriter, String theChildName, Boolean theValue) throws IOException {
if (theValue != null) {
theEventWriter.write(theChildName, theValue.booleanValue());
}
@ -1313,15 +1313,15 @@ public class JsonParser extends BaseParser implements IJsonLikeParser {
// theState.endingElement();
// }
private void write(JsonLikeWriter theEventWriter, String theChildName, BigDecimal theDecimalValue) throws IOException {
private void write(BaseJsonLikeWriter theEventWriter, String theChildName, BigDecimal theDecimalValue) throws IOException {
theEventWriter.write(theChildName, theDecimalValue);
}
private void write(JsonLikeWriter theEventWriter, String theChildName, Integer theValue) throws IOException {
private void write(BaseJsonLikeWriter theEventWriter, String theChildName, Integer theValue) throws IOException {
theEventWriter.write(theChildName, theValue);
}
private void writeCommentsPreAndPost(IBase theNextValue, JsonLikeWriter theEventWriter) throws IOException {
private void writeCommentsPreAndPost(IBase theNextValue, BaseJsonLikeWriter theEventWriter) throws IOException {
if (theNextValue.hasFormatComment()) {
beginArray(theEventWriter, "fhir_comments");
List<String> pre = theNextValue.getFormatCommentsPre();
@ -1340,7 +1340,7 @@ public class JsonParser extends BaseParser implements IJsonLikeParser {
}
}
private void writeExtensionsAsDirectChild(IBaseResource theResource, JsonLikeWriter theEventWriter, RuntimeResourceDefinition resDef, List<HeldExtension> extensions,
private void writeExtensionsAsDirectChild(IBaseResource theResource, BaseJsonLikeWriter theEventWriter, RuntimeResourceDefinition resDef, List<HeldExtension> extensions,
List<HeldExtension> modifierExtensions, EncodeContext theEncodeContext, boolean theContainedResource) throws IOException {
// Write Extensions
if (extensions.isEmpty() == false) {
@ -1365,7 +1365,7 @@ public class JsonParser extends BaseParser implements IJsonLikeParser {
}
}
private void writeOptionalTagWithTextNode(JsonLikeWriter theEventWriter, String theElementName, IPrimitiveDatatype<?> thePrimitive) throws IOException {
private void writeOptionalTagWithTextNode(BaseJsonLikeWriter theEventWriter, String theElementName, IPrimitiveDatatype<?> thePrimitive) throws IOException {
if (thePrimitive == null) {
return;
}
@ -1373,13 +1373,13 @@ public class JsonParser extends BaseParser implements IJsonLikeParser {
writeOptionalTagWithTextNode(theEventWriter, theElementName, str);
}
private void writeOptionalTagWithTextNode(JsonLikeWriter theEventWriter, String theElementName, String theValue) throws IOException {
private void writeOptionalTagWithTextNode(BaseJsonLikeWriter theEventWriter, String theElementName, String theValue) throws IOException {
if (StringUtils.isNotBlank(theValue)) {
write(theEventWriter, theElementName, theValue);
}
}
private static void write(JsonLikeWriter theWriter, String theName, String theValue) throws IOException {
private static void write(BaseJsonLikeWriter theWriter, String theName, String theValue) throws IOException {
theWriter.write(theName, theValue);
}
@ -1417,7 +1417,7 @@ public class JsonParser extends BaseParser implements IJsonLikeParser {
return url1.compareTo(url2);
}
private void managePrimitiveExtension(final IBase theValue, final RuntimeResourceDefinition theResDef, final IBaseResource theResource, final JsonLikeWriter theEventWriter, final BaseRuntimeElementDefinition<?> def, final String childName, EncodeContext theEncodeContext, boolean theContainedResource) throws IOException {
private void managePrimitiveExtension(final IBase theValue, final RuntimeResourceDefinition theResDef, final IBaseResource theResource, final BaseJsonLikeWriter theEventWriter, final BaseRuntimeElementDefinition<?> def, final String childName, EncodeContext theEncodeContext, boolean theContainedResource) throws IOException {
if (def.getChildType().equals(ID_DATATYPE) || def.getChildType().equals(PRIMITIVE_DATATYPE)) {
final List<HeldExtension> extensions = new ArrayList<HeldExtension>(0);
final List<HeldExtension> modifierExtensions = new ArrayList<HeldExtension>(0);
@ -1439,7 +1439,7 @@ public class JsonParser extends BaseParser implements IJsonLikeParser {
}
}
public void write(RuntimeResourceDefinition theResDef, IBaseResource theResource, JsonLikeWriter theEventWriter, EncodeContext theEncodeContext, boolean theContainedResource) throws IOException {
public void write(RuntimeResourceDefinition theResDef, IBaseResource theResource, BaseJsonLikeWriter theEventWriter, EncodeContext theEncodeContext, boolean theContainedResource) throws IOException {
if (myUndeclaredExtension != null) {
writeUndeclaredExtension(theResDef, theResource, theEventWriter, myUndeclaredExtension, theEncodeContext, theContainedResource);
} else {
@ -1485,7 +1485,7 @@ public class JsonParser extends BaseParser implements IJsonLikeParser {
}
}
private void writeUndeclaredExtension(RuntimeResourceDefinition theResDef, IBaseResource theResource, JsonLikeWriter theEventWriter, IBaseExtension<?, ?> ext, EncodeContext theEncodeContext, boolean theContainedResource) throws IOException {
private void writeUndeclaredExtension(RuntimeResourceDefinition theResDef, IBaseResource theResource, BaseJsonLikeWriter theEventWriter, IBaseExtension<?, ?> ext, EncodeContext theEncodeContext, boolean theContainedResource) throws IOException {
IBase value = ext.getValue();
final String extensionUrl = getExtensionUrl(ext.getUrl());

View File

@ -1,10 +1,10 @@
package ca.uhn.fhir.parser;
import static org.apache.commons.lang3.StringUtils.isBlank;
import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.parser.json.JsonLikeValue.ScalarType;
import ca.uhn.fhir.parser.json.JsonLikeValue.ValueType;
import ca.uhn.fhir.parser.json.BaseJsonLikeValue.ScalarType;
import ca.uhn.fhir.parser.json.BaseJsonLikeValue.ValueType;
import static org.apache.commons.lang3.StringUtils.isBlank;
/*
* #%L
@ -38,7 +38,7 @@ import ca.uhn.fhir.parser.json.JsonLikeValue.ValueType;
* @see IParser#setParserErrorHandler(IParserErrorHandler)
* @see FhirContext#setParserErrorHandler(IParserErrorHandler)
*/
public class LenientErrorHandler extends BaseErrorHandler implements IParserErrorHandler {
public class LenientErrorHandler extends ParseErrorHandler implements IParserErrorHandler {
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(LenientErrorHandler.class);
private static final StrictErrorHandler STRICT_ERROR_HANDLER = new StrictErrorHandler();

View File

@ -20,7 +20,7 @@ package ca.uhn.fhir.parser;
* #L%
*/
class BaseErrorHandler {
class ParseErrorHandler {
String describeLocation(IParserErrorHandler.IParseLocation theLocation) {
if (theLocation == null) {

View File

@ -46,8 +46,8 @@ import ca.uhn.fhir.model.base.resource.ResourceMetadataMap;
import ca.uhn.fhir.model.primitive.IdDt;
import ca.uhn.fhir.model.primitive.InstantDt;
import ca.uhn.fhir.model.primitive.XhtmlDt;
import ca.uhn.fhir.parser.json.JsonLikeValue.ScalarType;
import ca.uhn.fhir.parser.json.JsonLikeValue.ValueType;
import ca.uhn.fhir.parser.json.BaseJsonLikeValue.ScalarType;
import ca.uhn.fhir.parser.json.BaseJsonLikeValue.ValueType;
import ca.uhn.fhir.util.BundleUtil;
import ca.uhn.fhir.util.FhirTerser;
import ca.uhn.fhir.util.ReflectionUtil;
@ -69,7 +69,6 @@ import org.hl7.fhir.instance.model.api.IBaseReference;
import org.hl7.fhir.instance.model.api.IBaseResource;
import org.hl7.fhir.instance.model.api.IBaseXhtml;
import org.hl7.fhir.instance.model.api.ICompositeType;
import org.hl7.fhir.instance.model.api.IDomainResource;
import org.hl7.fhir.instance.model.api.IIdType;
import org.hl7.fhir.instance.model.api.IPrimitiveType;
@ -194,7 +193,7 @@ class ParserState<T> {
return theDefinition.newInstance();
}
public ICompositeType newCompositeInstance(PreResourceState thePreResourceState, BaseRuntimeChildDefinition theChild, BaseRuntimeElementCompositeDefinition<?> theCompositeTarget) {
public ICompositeType newCompositeInstance(BasePreResourceState thePreResourceState, BaseRuntimeChildDefinition theChild, BaseRuntimeElementCompositeDefinition<?> theCompositeTarget) {
ICompositeType retVal = (ICompositeType) theCompositeTarget.newInstance(theChild.getInstanceConstructorArguments());
if (retVal instanceof IBaseReference) {
IBaseReference ref = (IBaseReference) retVal;
@ -204,7 +203,7 @@ class ParserState<T> {
return retVal;
}
public ICompositeType newCompositeTypeInstance(PreResourceState thePreResourceState, BaseRuntimeElementCompositeDefinition<?> theCompositeTarget) {
public ICompositeType newCompositeTypeInstance(BasePreResourceState thePreResourceState, BaseRuntimeElementCompositeDefinition<?> theCompositeTarget) {
ICompositeType retVal = (ICompositeType) theCompositeTarget.newInstance();
if (retVal instanceof IBaseReference) {
IBaseReference ref = (IBaseReference) retVal;
@ -246,10 +245,10 @@ class ParserState<T> {
private abstract class BaseState {
private PreResourceState myPreResourceState;
private BasePreResourceState myPreResourceState;
private BaseState myStack;
BaseState(PreResourceState thePreResourceState) {
BaseState(BasePreResourceState thePreResourceState) {
super();
myPreResourceState = thePreResourceState;
}
@ -315,7 +314,7 @@ class ParserState<T> {
return null;
}
PreResourceState getPreResourceState() {
BasePreResourceState getPreResourceState() {
return myPreResourceState;
}
@ -352,9 +351,9 @@ class ParserState<T> {
}
private class ContainedResourcesStateHapi extends PreResourceState {
private class ContainedResourcesStateHapi extends BasePreResourceState {
public ContainedResourcesStateHapi(PreResourceState thePreResourcesState) {
public ContainedResourcesStateHapi(BasePreResourceState thePreResourcesState) {
super(thePreResourcesState, thePreResourcesState.myInstance.getStructureFhirVersionEnum());
}
@ -393,9 +392,9 @@ class ParserState<T> {
}
private class ContainedResourcesStateHl7Org extends PreResourceState {
private class ContainedResourcesStateHl7Org extends BasePreResourceState {
public ContainedResourcesStateHl7Org(PreResourceState thePreResourcesState) {
public ContainedResourcesStateHl7Org(BasePreResourceState thePreResourcesState) {
super(thePreResourcesState, thePreResourcesState.myParentVersion);
}
@ -437,9 +436,9 @@ class ParserState<T> {
private IBase myChildInstance;
private RuntimeChildDeclaredExtensionDefinition myDefinition;
private IBase myParentInstance;
private PreResourceState myPreResourceState;
private BasePreResourceState myPreResourceState;
public DeclaredExtensionState(PreResourceState thePreResourceState, RuntimeChildDeclaredExtensionDefinition theDefinition, IBase theParentInstance) {
public DeclaredExtensionState(BasePreResourceState thePreResourceState, RuntimeChildDeclaredExtensionDefinition theDefinition, IBase theParentInstance) {
super(thePreResourceState);
myPreResourceState = thePreResourceState;
myDefinition = theDefinition;
@ -527,7 +526,7 @@ class ParserState<T> {
private final Set<String> myParsedNonRepeatableNames = new HashSet<>();
private final String myElementName;
ElementCompositeState(PreResourceState thePreResourceState, String theElementName, BaseRuntimeElementCompositeDefinition<?> theDef, IBase theInstance) {
ElementCompositeState(BasePreResourceState thePreResourceState, String theElementName, BaseRuntimeElementCompositeDefinition<?> theDef, IBase theInstance) {
super(thePreResourceState);
myDefinition = theDef;
myInstance = theInstance;
@ -697,7 +696,7 @@ class ParserState<T> {
private final IBaseElement myElement;
ElementIdState(ParserState<T>.PreResourceState thePreResourceState, IBaseElement theElement) {
ElementIdState(BasePreResourceState thePreResourceState, IBaseElement theElement) {
super(thePreResourceState);
myElement = theElement;
}
@ -718,7 +717,7 @@ class ParserState<T> {
private final IBaseExtension<?, ?> myExtension;
ExtensionState(PreResourceState thePreResourceState, IBaseExtension<?, ?> theExtension) {
ExtensionState(BasePreResourceState thePreResourceState, IBaseExtension<?, ?> theExtension) {
super(thePreResourceState);
myExtension = theExtension;
}
@ -811,7 +810,7 @@ class ParserState<T> {
private final IIdentifiableElement myElement;
public IdentifiableElementIdState(ParserState<T>.PreResourceState thePreResourceState, IIdentifiableElement theElement) {
public IdentifiableElementIdState(BasePreResourceState thePreResourceState, IIdentifiableElement theElement) {
super(thePreResourceState);
myElement = theElement;
}
@ -831,7 +830,7 @@ class ParserState<T> {
private class MetaElementState extends BaseState {
private final ResourceMetadataMap myMap;
public MetaElementState(ParserState<T>.PreResourceState thePreResourceState, ResourceMetadataMap theMap) {
public MetaElementState(BasePreResourceState thePreResourceState, ResourceMetadataMap theMap) {
super(thePreResourceState);
myMap = theMap;
}
@ -920,7 +919,7 @@ class ParserState<T> {
private final ResourceMetadataMap myMap;
MetaVersionElementState(ParserState<T>.PreResourceState thePreResourceState, ResourceMetadataMap theMap) {
MetaVersionElementState(BasePreResourceState thePreResourceState, ResourceMetadataMap theMap) {
super(thePreResourceState);
myMap = theMap;
}
@ -943,14 +942,14 @@ class ParserState<T> {
}
private abstract class PreResourceState extends BaseState {
private abstract class BasePreResourceState extends BaseState {
private Map<String, IBaseResource> myContainedResources;
private List<IBaseReference> myLocalReferences = new ArrayList<>();
private IBaseResource myInstance;
private FhirVersionEnum myParentVersion;
private Class<? extends IBaseResource> myResourceType;
PreResourceState(Class<? extends IBaseResource> theResourceType) {
BasePreResourceState(Class<? extends IBaseResource> theResourceType) {
super(null);
myResourceType = theResourceType;
myContainedResources = new HashMap<>();
@ -961,7 +960,7 @@ class ParserState<T> {
}
}
PreResourceState(PreResourceState thePreResourcesState, FhirVersionEnum theParentVersion) {
BasePreResourceState(BasePreResourceState thePreResourcesState, FhirVersionEnum theParentVersion) {
super(thePreResourcesState);
Validate.notNull(theParentVersion);
myParentVersion = theParentVersion;
@ -1026,7 +1025,7 @@ class ParserState<T> {
return myInstance;
}
private PreResourceState getRootPreResourceState() {
private BasePreResourceState getRootPreResourceState() {
if (getPreResourceState() != null) {
return getPreResourceState();
}
@ -1171,7 +1170,7 @@ class ParserState<T> {
}
private class PreResourceStateHapi extends PreResourceState {
private class PreResourceStateHapi extends BasePreResourceState {
private IMutator myMutator;
private IBase myTarget;
@ -1222,7 +1221,7 @@ class ParserState<T> {
}
private class PreResourceStateHl7Org extends PreResourceState {
private class PreResourceStateHl7Org extends BasePreResourceState {
private IMutator myMutator;
private IBase myTarget;
@ -1307,7 +1306,7 @@ class ParserState<T> {
private final String myTypeName;
private IPrimitiveType<?> myInstance;
PrimitiveState(PreResourceState thePreResourceState, IPrimitiveType<?> theInstance, String theChildName, String theTypeName) {
PrimitiveState(BasePreResourceState thePreResourceState, IPrimitiveType<?> theInstance, String theChildName, String theTypeName) {
super(thePreResourceState);
myInstance = theInstance;
myChildName = theChildName;
@ -1385,7 +1384,7 @@ class ParserState<T> {
private IResource myInstance;
public ResourceStateHapi(PreResourceState thePreResourceState, BaseRuntimeElementCompositeDefinition<?> theDef, IResource theInstance, Map<String, IBaseResource> theContainedResources) {
public ResourceStateHapi(BasePreResourceState thePreResourceState, BaseRuntimeElementCompositeDefinition<?> theDef, IResource theInstance, Map<String, IBaseResource> theContainedResources) {
super(thePreResourceState, theDef.getName(), theDef, theInstance);
myInstance = theInstance;
}
@ -1404,7 +1403,7 @@ class ParserState<T> {
private class ResourceStateHl7Org extends ElementCompositeState {
ResourceStateHl7Org(PreResourceState thePreResourceState, BaseRuntimeElementCompositeDefinition<?> theDef, IBaseResource theInstance) {
ResourceStateHl7Org(BasePreResourceState thePreResourceState, BaseRuntimeElementCompositeDefinition<?> theDef, IBaseResource theInstance) {
super(thePreResourceState, theDef.getName(), theDef, theInstance);
}
@ -1412,7 +1411,7 @@ class ParserState<T> {
private class SecurityLabelElementStateHapi extends ElementCompositeState {
SecurityLabelElementStateHapi(ParserState<T>.PreResourceState thePreResourceState, BaseRuntimeElementCompositeDefinition<?> theDef, IBase codingDt) {
SecurityLabelElementStateHapi(BasePreResourceState thePreResourceState, BaseRuntimeElementCompositeDefinition<?> theDef, IBase codingDt) {
super(thePreResourceState, theDef.getName(), theDef, codingDt);
}
@ -1427,7 +1426,7 @@ class ParserState<T> {
private int myDepth;
SwallowChildrenWholeState(PreResourceState thePreResourceState) {
SwallowChildrenWholeState(BasePreResourceState thePreResourceState) {
super(thePreResourceState);
}
@ -1563,7 +1562,7 @@ class ParserState<T> {
private List<XMLEvent> myEvents = new ArrayList<XMLEvent>();
private boolean myIncludeOuterEvent;
private XhtmlState(PreResourceState thePreResourceState, XhtmlDt theXhtmlDt, boolean theIncludeOuterEvent) throws DataFormatException {
private XhtmlState(BasePreResourceState thePreResourceState, XhtmlDt theXhtmlDt, boolean theIncludeOuterEvent) throws DataFormatException {
super(thePreResourceState);
myDepth = 0;
myDt = theXhtmlDt;
@ -1634,7 +1633,7 @@ class ParserState<T> {
private class XhtmlStateHl7Org extends XhtmlState {
private IBaseXhtml myHl7OrgDatatype;
private XhtmlStateHl7Org(PreResourceState thePreResourceState, IBaseXhtml theHl7OrgDatatype) {
private XhtmlStateHl7Org(BasePreResourceState thePreResourceState, IBaseXhtml theHl7OrgDatatype) {
super(thePreResourceState, new XhtmlDt(), true);
myHl7OrgDatatype = theHl7OrgDatatype;
}

View File

@ -2,8 +2,8 @@ package ca.uhn.fhir.parser;
import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.i18n.Msg;
import ca.uhn.fhir.parser.json.JsonLikeValue.ScalarType;
import ca.uhn.fhir.parser.json.JsonLikeValue.ValueType;
import ca.uhn.fhir.parser.json.BaseJsonLikeValue.ScalarType;
import ca.uhn.fhir.parser.json.BaseJsonLikeValue.ValueType;
import ca.uhn.fhir.util.UrlUtil;
/*
@ -33,7 +33,7 @@ import ca.uhn.fhir.util.UrlUtil;
* @see IParser#setParserErrorHandler(IParserErrorHandler)
* @see FhirContext#setParserErrorHandler(IParserErrorHandler)
*/
public class StrictErrorHandler extends BaseErrorHandler implements IParserErrorHandler {
public class StrictErrorHandler extends ParseErrorHandler implements IParserErrorHandler {
@Override
public void containedResourceWithNoId(IParseLocation theLocation) {

View File

@ -20,7 +20,7 @@ package ca.uhn.fhir.parser.json;
* #L%
*/
public abstract class JsonLikeArray extends JsonLikeValue {
public abstract class BaseJsonLikeArray extends BaseJsonLikeValue {
@Override
public ValueType getJsonType() {
@ -38,7 +38,7 @@ public abstract class JsonLikeArray extends JsonLikeValue {
}
@Override
public JsonLikeArray getAsArray() {
public BaseJsonLikeArray getAsArray() {
return this;
}
@ -49,5 +49,5 @@ public abstract class JsonLikeArray extends JsonLikeValue {
public abstract int size ();
public abstract JsonLikeValue get (int index);
public abstract BaseJsonLikeValue get (int index);
}

View File

@ -22,7 +22,7 @@ import java.util.Iterator;
* #L%
*/
public abstract class JsonLikeObject extends JsonLikeValue {
public abstract class BaseJsonLikeObject extends BaseJsonLikeValue {
@Override
public ValueType getJsonType() {
@ -40,7 +40,7 @@ public abstract class JsonLikeObject extends JsonLikeValue {
}
@Override
public JsonLikeObject getAsObject() {
public BaseJsonLikeObject getAsObject() {
return this;
}
@ -51,6 +51,6 @@ public abstract class JsonLikeObject extends JsonLikeValue {
public abstract Iterator<String> keyIterator();
public abstract JsonLikeValue get(String key);
public abstract BaseJsonLikeValue get(String key);
}

View File

@ -26,7 +26,7 @@ package ca.uhn.fhir.parser.json;
* or a null.
*
*/
public abstract class JsonLikeValue {
public abstract class BaseJsonLikeValue {
public enum ValueType {
ARRAY, OBJECT, SCALAR, NULL
@ -66,10 +66,10 @@ public abstract class JsonLikeValue {
return this.getJsonType() == ValueType.NULL;
}
public JsonLikeArray getAsArray () {
public BaseJsonLikeArray getAsArray () {
return null;
}
public JsonLikeObject getAsObject () {
public BaseJsonLikeObject getAsObject () {
return null;
}
public String getAsString () {
@ -82,25 +82,25 @@ public abstract class JsonLikeValue {
return !isNull();
}
public static JsonLikeArray asArray (JsonLikeValue element) {
public static BaseJsonLikeArray asArray (BaseJsonLikeValue element) {
if (element != null) {
return element.getAsArray();
}
return null;
}
public static JsonLikeObject asObject (JsonLikeValue element) {
public static BaseJsonLikeObject asObject (BaseJsonLikeValue element) {
if (element != null) {
return element.getAsObject();
}
return null;
}
public static String asString (JsonLikeValue element) {
public static String asString (BaseJsonLikeValue element) {
if (element != null) {
return element.getAsString();
}
return null;
}
public static boolean asBoolean (JsonLikeValue element) {
public static boolean asBoolean (BaseJsonLikeValue element) {
if (element != null) {
return element.getAsBoolean();
}
@ -108,7 +108,7 @@ public abstract class JsonLikeValue {
}
public static final JsonLikeValue NULL = new JsonLikeValue() {
public static final BaseJsonLikeValue NULL = new BaseJsonLikeValue() {
@Override
public ValueType getJsonType() {
return ValueType.NULL;
@ -129,8 +129,8 @@ public abstract class JsonLikeValue {
if (this == obj){
return true;
}
if (obj instanceof JsonLikeValue) {
return getJsonType().equals(((JsonLikeValue)obj).getJsonType());
if (obj instanceof BaseJsonLikeValue) {
return getJsonType().equals(((BaseJsonLikeValue)obj).getJsonType());
}
return false;
}
@ -146,7 +146,7 @@ public abstract class JsonLikeValue {
}
};
public static final JsonLikeValue TRUE = new JsonLikeValue() {
public static final BaseJsonLikeValue TRUE = new BaseJsonLikeValue() {
@Override
public ValueType getJsonType() {
return ValueType.SCALAR;
@ -167,10 +167,10 @@ public abstract class JsonLikeValue {
if (this == obj){
return true;
}
if (obj instanceof JsonLikeValue) {
return getJsonType().equals(((JsonLikeValue)obj).getJsonType())
&& getDataType().equals(((JsonLikeValue)obj).getDataType())
&& toString().equals(((JsonLikeValue)obj).toString());
if (obj instanceof BaseJsonLikeValue) {
return getJsonType().equals(((BaseJsonLikeValue)obj).getJsonType())
&& getDataType().equals(((BaseJsonLikeValue)obj).getDataType())
&& toString().equals(((BaseJsonLikeValue)obj).toString());
}
return false;
}
@ -186,7 +186,7 @@ public abstract class JsonLikeValue {
}
};
public static final JsonLikeValue FALSE = new JsonLikeValue() {
public static final BaseJsonLikeValue FALSE = new BaseJsonLikeValue() {
@Override
public ValueType getJsonType() {
return ValueType.SCALAR;
@ -207,10 +207,10 @@ public abstract class JsonLikeValue {
if (this == obj){
return true;
}
if (obj instanceof JsonLikeValue) {
return getJsonType().equals(((JsonLikeValue)obj).getJsonType())
&& getDataType().equals(((JsonLikeValue)obj).getDataType())
&& toString().equals(((JsonLikeValue)obj).toString());
if (obj instanceof BaseJsonLikeValue) {
return getJsonType().equals(((BaseJsonLikeValue)obj).getJsonType())
&& getDataType().equals(((BaseJsonLikeValue)obj).getDataType())
&& toString().equals(((BaseJsonLikeValue)obj).toString());
}
return false;
}

View File

@ -0,0 +1,101 @@
package ca.uhn.fhir.parser.json;
import java.io.IOException;
import java.io.Writer;
import java.math.BigDecimal;
import java.math.BigInteger;
/*
* #%L
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 - 2022 Smile CDR, Inc.
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
public abstract class BaseJsonLikeWriter {
private boolean prettyPrint;
private Writer writer;
public BaseJsonLikeWriter() {
super();
}
public boolean isPrettyPrint() {
return prettyPrint;
}
public void setPrettyPrint(boolean tf) {
prettyPrint = tf;
}
public Writer getWriter() {
return writer;
}
public void setWriter(Writer writer) {
this.writer = writer;
}
public abstract BaseJsonLikeWriter init() throws IOException;
public abstract BaseJsonLikeWriter flush() throws IOException;
public abstract void close() throws IOException;
public abstract BaseJsonLikeWriter beginObject() throws IOException;
public abstract BaseJsonLikeWriter beginObject(String name) throws IOException;
public abstract BaseJsonLikeWriter beginArray(String name) throws IOException;
public abstract BaseJsonLikeWriter write(String value) throws IOException;
public abstract BaseJsonLikeWriter write(BigInteger value) throws IOException;
public abstract BaseJsonLikeWriter write(BigDecimal value) throws IOException;
public abstract BaseJsonLikeWriter write(long value) throws IOException;
public abstract BaseJsonLikeWriter write(double value) throws IOException;
public abstract BaseJsonLikeWriter write(Boolean value) throws IOException;
public abstract BaseJsonLikeWriter write(boolean value) throws IOException;
public abstract BaseJsonLikeWriter writeNull() throws IOException;
public abstract BaseJsonLikeWriter write(String name, String value) throws IOException;
public abstract BaseJsonLikeWriter write(String name, BigInteger value) throws IOException;
public abstract BaseJsonLikeWriter write(String name, BigDecimal value) throws IOException;
public abstract BaseJsonLikeWriter write(String name, long value) throws IOException;
public abstract BaseJsonLikeWriter write(String name, double value) throws IOException;
public abstract BaseJsonLikeWriter write(String name, Boolean value) throws IOException;
public abstract BaseJsonLikeWriter write(String name, boolean value) throws IOException;
public abstract BaseJsonLikeWriter endObject() throws IOException;
public abstract BaseJsonLikeWriter endArray() throws IOException;
public abstract BaseJsonLikeWriter endBlock() throws IOException;
}

View File

@ -48,9 +48,9 @@ public interface JsonLikeStructure {
void load(Reader theReader, boolean allowArray) throws DataFormatException;
JsonLikeObject getRootObject() throws DataFormatException;
BaseJsonLikeObject getRootObject() throws DataFormatException;
JsonLikeWriter getJsonLikeWriter();
BaseJsonLikeWriter getJsonLikeWriter();
JsonLikeWriter getJsonLikeWriter(Writer writer) throws IOException;
BaseJsonLikeWriter getJsonLikeWriter(Writer writer) throws IOException;
}

View File

@ -1,101 +0,0 @@
package ca.uhn.fhir.parser.json;
import java.io.IOException;
import java.io.Writer;
import java.math.BigDecimal;
import java.math.BigInteger;
/*
* #%L
* HAPI FHIR - Core Library
* %%
* Copyright (C) 2014 - 2022 Smile CDR, Inc.
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
public abstract class JsonLikeWriter {
private boolean prettyPrint;
private Writer writer;
public JsonLikeWriter() {
super();
}
public boolean isPrettyPrint() {
return prettyPrint;
}
public void setPrettyPrint(boolean tf) {
prettyPrint = tf;
}
public Writer getWriter() {
return writer;
}
public void setWriter(Writer writer) {
this.writer = writer;
}
public abstract JsonLikeWriter init() throws IOException;
public abstract JsonLikeWriter flush() throws IOException;
public abstract void close() throws IOException;
public abstract JsonLikeWriter beginObject() throws IOException;
public abstract JsonLikeWriter beginObject(String name) throws IOException;
public abstract JsonLikeWriter beginArray(String name) throws IOException;
public abstract JsonLikeWriter write(String value) throws IOException;
public abstract JsonLikeWriter write(BigInteger value) throws IOException;
public abstract JsonLikeWriter write(BigDecimal value) throws IOException;
public abstract JsonLikeWriter write(long value) throws IOException;
public abstract JsonLikeWriter write(double value) throws IOException;
public abstract JsonLikeWriter write(Boolean value) throws IOException;
public abstract JsonLikeWriter write(boolean value) throws IOException;
public abstract JsonLikeWriter writeNull() throws IOException;
public abstract JsonLikeWriter write(String name, String value) throws IOException;
public abstract JsonLikeWriter write(String name, BigInteger value) throws IOException;
public abstract JsonLikeWriter write(String name, BigDecimal value) throws IOException;
public abstract JsonLikeWriter write(String name, long value) throws IOException;
public abstract JsonLikeWriter write(String name, double value) throws IOException;
public abstract JsonLikeWriter write(String name, Boolean value) throws IOException;
public abstract JsonLikeWriter write(String name, boolean value) throws IOException;
public abstract JsonLikeWriter endObject() throws IOException;
public abstract JsonLikeWriter endArray() throws IOException;
public abstract JsonLikeWriter endBlock() throws IOException;
}

View File

@ -22,11 +22,11 @@ package ca.uhn.fhir.parser.json.jackson;
import ca.uhn.fhir.i18n.Msg;
import ca.uhn.fhir.parser.DataFormatException;
import ca.uhn.fhir.parser.json.JsonLikeArray;
import ca.uhn.fhir.parser.json.JsonLikeObject;
import ca.uhn.fhir.parser.json.BaseJsonLikeArray;
import ca.uhn.fhir.parser.json.BaseJsonLikeObject;
import ca.uhn.fhir.parser.json.BaseJsonLikeValue;
import ca.uhn.fhir.parser.json.BaseJsonLikeWriter;
import ca.uhn.fhir.parser.json.JsonLikeStructure;
import ca.uhn.fhir.parser.json.JsonLikeValue;
import ca.uhn.fhir.parser.json.JsonLikeWriter;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.databind.DeserializationFeature;
@ -119,7 +119,7 @@ public class JacksonStructure implements JsonLikeStructure {
}
@Override
public JsonLikeWriter getJsonLikeWriter(Writer writer) throws IOException {
public BaseJsonLikeWriter getJsonLikeWriter(Writer writer) throws IOException {
if (null == jacksonWriter) {
jacksonWriter = new JacksonWriter(OBJECT_MAPPER.getFactory(), writer);
}
@ -128,7 +128,7 @@ public class JacksonStructure implements JsonLikeStructure {
}
@Override
public JsonLikeWriter getJsonLikeWriter() {
public BaseJsonLikeWriter getJsonLikeWriter() {
if (null == jacksonWriter) {
jacksonWriter = new JacksonWriter();
}
@ -136,7 +136,7 @@ public class JacksonStructure implements JsonLikeStructure {
}
@Override
public JsonLikeObject getRootObject() throws DataFormatException {
public BaseJsonLikeObject getRootObject() throws DataFormatException {
if (rootType == ROOT_TYPE.OBJECT) {
if (null == jsonLikeRoot) {
jsonLikeRoot = nativeRoot;
@ -150,7 +150,7 @@ public class JacksonStructure implements JsonLikeStructure {
private enum ROOT_TYPE {OBJECT, ARRAY}
private static class JacksonJsonObject extends JsonLikeObject {
private static class JacksonJsonObject extends BaseJsonLikeObject {
private final ObjectNode nativeObject;
public JacksonJsonObject(ObjectNode json) {
@ -168,7 +168,7 @@ public class JacksonStructure implements JsonLikeStructure {
}
@Override
public JsonLikeValue get(String key) {
public BaseJsonLikeValue get(String key) {
JsonNode child = nativeObject.get(key);
if (child != null) {
return new JacksonJsonValue(child);
@ -222,9 +222,9 @@ public class JacksonStructure implements JsonLikeStructure {
}
}
private static class JacksonJsonArray extends JsonLikeArray {
private static class JacksonJsonArray extends BaseJsonLikeArray {
private final ArrayNode nativeArray;
private final Map<Integer, JsonLikeValue> jsonLikeMap = new LinkedHashMap<Integer, JsonLikeValue>();
private final Map<Integer, BaseJsonLikeValue> jsonLikeMap = new LinkedHashMap<Integer, BaseJsonLikeValue>();
public JacksonJsonArray(ArrayNode json) {
this.nativeArray = json;
@ -241,9 +241,9 @@ public class JacksonStructure implements JsonLikeStructure {
}
@Override
public JsonLikeValue get(int index) {
public BaseJsonLikeValue get(int index) {
Integer key = index;
JsonLikeValue result = null;
BaseJsonLikeValue result = null;
if (jsonLikeMap.containsKey(key)) {
result = jsonLikeMap.get(key);
} else {
@ -257,10 +257,10 @@ public class JacksonStructure implements JsonLikeStructure {
}
}
private static class JacksonJsonValue extends JsonLikeValue {
private static class JacksonJsonValue extends BaseJsonLikeValue {
private final JsonNode nativeValue;
private JsonLikeObject jsonLikeObject = null;
private JsonLikeArray jsonLikeArray = null;
private BaseJsonLikeObject jsonLikeObject = null;
private BaseJsonLikeArray jsonLikeArray = null;
public JacksonJsonValue(JsonNode jsonNode) {
this.nativeValue = jsonNode;
@ -325,7 +325,7 @@ public class JacksonStructure implements JsonLikeStructure {
}
@Override
public JsonLikeArray getAsArray() {
public BaseJsonLikeArray getAsArray() {
if (nativeValue != null && nativeValue.isArray()) {
if (null == jsonLikeArray) {
jsonLikeArray = new JacksonJsonArray((ArrayNode) nativeValue);
@ -335,7 +335,7 @@ public class JacksonStructure implements JsonLikeStructure {
}
@Override
public JsonLikeObject getAsObject() {
public BaseJsonLikeObject getAsObject() {
if (nativeValue != null && nativeValue.isObject()) {
if (null == jsonLikeObject) {
jsonLikeObject = new JacksonJsonObject((ObjectNode) nativeValue);

View File

@ -20,10 +20,9 @@ package ca.uhn.fhir.parser.json.jackson;
* #L%
*/
import ca.uhn.fhir.parser.json.JsonLikeWriter;
import ca.uhn.fhir.parser.json.BaseJsonLikeWriter;
import com.fasterxml.jackson.core.JsonFactory;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.PrettyPrinter;
import com.fasterxml.jackson.core.util.DefaultIndenter;
import com.fasterxml.jackson.core.util.DefaultPrettyPrinter;
import com.fasterxml.jackson.core.util.Separators;
@ -33,7 +32,7 @@ import java.io.Writer;
import java.math.BigDecimal;
import java.math.BigInteger;
public class JacksonWriter extends JsonLikeWriter {
public class JacksonWriter extends BaseJsonLikeWriter {
private JsonGenerator myJsonGenerator;
@ -46,7 +45,7 @@ public class JacksonWriter extends JsonLikeWriter {
}
@Override
public JsonLikeWriter init() {
public BaseJsonLikeWriter init() {
if (isPrettyPrint()) {
DefaultPrettyPrinter prettyPrinter = new DefaultPrettyPrinter() {
@ -80,7 +79,7 @@ public class JacksonWriter extends JsonLikeWriter {
}
@Override
public JsonLikeWriter flush() {
public BaseJsonLikeWriter flush() {
return this;
}
@ -90,127 +89,127 @@ public class JacksonWriter extends JsonLikeWriter {
}
@Override
public JsonLikeWriter beginObject() throws IOException {
public BaseJsonLikeWriter beginObject() throws IOException {
myJsonGenerator.writeStartObject();
return this;
}
@Override
public JsonLikeWriter beginObject(String name) throws IOException {
public BaseJsonLikeWriter beginObject(String name) throws IOException {
myJsonGenerator.writeObjectFieldStart(name);
return this;
}
@Override
public JsonLikeWriter beginArray(String name) throws IOException {
public BaseJsonLikeWriter beginArray(String name) throws IOException {
myJsonGenerator.writeArrayFieldStart(name);
return this;
}
@Override
public JsonLikeWriter write(String value) throws IOException {
public BaseJsonLikeWriter write(String value) throws IOException {
myJsonGenerator.writeObject(value);
return this;
}
@Override
public JsonLikeWriter write(BigInteger value) throws IOException {
public BaseJsonLikeWriter write(BigInteger value) throws IOException {
myJsonGenerator.writeObject(value);
return this;
}
@Override
public JsonLikeWriter write(BigDecimal value) throws IOException {
public BaseJsonLikeWriter write(BigDecimal value) throws IOException {
myJsonGenerator.writeObject(value);
return this;
}
@Override
public JsonLikeWriter write(long value) throws IOException {
public BaseJsonLikeWriter write(long value) throws IOException {
myJsonGenerator.writeObject(value);
return this;
}
@Override
public JsonLikeWriter write(double value) throws IOException {
public BaseJsonLikeWriter write(double value) throws IOException {
myJsonGenerator.writeObject(value);
return this;
}
@Override
public JsonLikeWriter write(Boolean value) throws IOException {
public BaseJsonLikeWriter write(Boolean value) throws IOException {
myJsonGenerator.writeObject(value);
return this;
}
@Override
public JsonLikeWriter write(boolean value) throws IOException {
public BaseJsonLikeWriter write(boolean value) throws IOException {
myJsonGenerator.writeObject(value);
return this;
}
@Override
public JsonLikeWriter writeNull() throws IOException {
public BaseJsonLikeWriter writeNull() throws IOException {
myJsonGenerator.writeNull();
return this;
}
@Override
public JsonLikeWriter write(String name, String value) throws IOException {
public BaseJsonLikeWriter write(String name, String value) throws IOException {
myJsonGenerator.writeObjectField(name, value);
return this;
}
@Override
public JsonLikeWriter write(String name, BigInteger value) throws IOException {
public BaseJsonLikeWriter write(String name, BigInteger value) throws IOException {
myJsonGenerator.writeObjectField(name, value);
return this;
}
@Override
public JsonLikeWriter write(String name, BigDecimal value) throws IOException {
public BaseJsonLikeWriter write(String name, BigDecimal value) throws IOException {
myJsonGenerator.writeObjectField(name, value);
return this;
}
@Override
public JsonLikeWriter write(String name, long value) throws IOException {
public BaseJsonLikeWriter write(String name, long value) throws IOException {
myJsonGenerator.writeObjectField(name, value);
return this;
}
@Override
public JsonLikeWriter write(String name, double value) throws IOException {
public BaseJsonLikeWriter write(String name, double value) throws IOException {
myJsonGenerator.writeObjectField(name, value);
return this;
}
@Override
public JsonLikeWriter write(String name, Boolean value) throws IOException {
public BaseJsonLikeWriter write(String name, Boolean value) throws IOException {
myJsonGenerator.writeObjectField(name, value);
return this;
}
@Override
public JsonLikeWriter write(String name, boolean value) throws IOException {
public BaseJsonLikeWriter write(String name, boolean value) throws IOException {
myJsonGenerator.writeObjectField(name, value);
return this;
}
@Override
public JsonLikeWriter endObject() throws IOException {
public BaseJsonLikeWriter endObject() throws IOException {
myJsonGenerator.writeEndObject();
return this;
}
@Override
public JsonLikeWriter endArray() throws IOException {
public BaseJsonLikeWriter endArray() throws IOException {
myJsonGenerator.writeEndArray();
return this;
}
@Override
public JsonLikeWriter endBlock() throws IOException {
public BaseJsonLikeWriter endBlock() throws IOException {
myJsonGenerator.writeEndObject();
return this;
}

View File

@ -29,7 +29,7 @@ import ca.uhn.fhir.rest.server.exceptions.InternalErrorException;
import java.lang.reflect.Constructor;
import java.util.List;
class BaseBinder<T> {
abstract class BaseBinder<T> {
private List<Class<? extends IQueryParameterType>> myCompositeTypes;
private Constructor<? extends T> myConstructor;
private final Class<? extends T> myType;

View File

@ -25,7 +25,7 @@ import org.apache.commons.io.FilenameUtils;
import static org.apache.commons.lang3.StringUtils.isBlank;
public abstract class StoreInfo {
public abstract class BaseStoreInfo {
private final String myFilePath;
private final PathType myPathType;
@ -33,7 +33,7 @@ public abstract class StoreInfo {
private final String myAlias;
private final KeyStoreType myType;
public StoreInfo(String theFilePath, String theStorePass, String theAlias) {
public BaseStoreInfo(String theFilePath, String theStorePass, String theAlias) {
if(theFilePath.startsWith(PathType.RESOURCE.getPrefix())){
myFilePath = theFilePath.substring(PathType.RESOURCE.getPrefix().length());
myPathType = PathType.RESOURCE;

View File

@ -20,7 +20,7 @@ package ca.uhn.fhir.tls;
* #L%
*/
public class KeyStoreInfo extends StoreInfo {
public class KeyStoreInfo extends BaseStoreInfo {
private final char[] myKeyPass;

View File

@ -20,7 +20,7 @@ package ca.uhn.fhir.tls;
* #L%
*/
public class TrustStoreInfo extends StoreInfo{
public class TrustStoreInfo extends BaseStoreInfo {
public TrustStoreInfo(String theFilePath, String theStorePass, String theAlias) {
super(theFilePath, theStorePass, theAlias);

View File

@ -1,13 +1,13 @@
package ca.uhn.fhir.parser.json;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import java.io.StringReader;
import ca.uhn.fhir.parser.json.jackson.JacksonStructure;
import org.junit.jupiter.api.Test;
import java.io.StringReader;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
public class JsonLikeStructureTest {
// private static FhirContext ourCtx;
// private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(JsonLikeStructureTest.class);
@ -43,10 +43,10 @@ public class JsonLikeStructureTest {
JsonLikeStructure jsonStructure = new JacksonStructure();
jsonStructure.load(reader);
JsonLikeObject rootObject = jsonStructure.getRootObject();
BaseJsonLikeObject rootObject = jsonStructure.getRootObject();
assertNotNull(rootObject);
assertEquals(JsonLikeValue.ValueType.OBJECT, rootObject.getJsonType());
assertEquals(BaseJsonLikeValue.ValueType.OBJECT, rootObject.getJsonType());
}
private static final String TEST_JSONTYPES_DATA =
@ -74,21 +74,21 @@ public class JsonLikeStructureTest {
JsonLikeStructure jsonStructure = new JacksonStructure();
jsonStructure.load(reader);
JsonLikeObject rootObject = jsonStructure.getRootObject();
BaseJsonLikeObject rootObject = jsonStructure.getRootObject();
assertNotNull(rootObject);
JsonLikeValue value = rootObject.get("object-value");
BaseJsonLikeValue value = rootObject.get("object-value");
assertNotNull(value);
assertEquals(JsonLikeValue.ValueType.OBJECT, value.getJsonType());
assertEquals(BaseJsonLikeValue.ValueType.OBJECT, value.getJsonType());
assertEquals(true, value.isObject());
assertEquals(false, value.isArray());
assertEquals(false, value.isScalar());
assertEquals(false, value.isNull());
JsonLikeObject obj = value.getAsObject();
BaseJsonLikeObject obj = value.getAsObject();
assertNotNull(obj);
assertEquals(JsonLikeValue.ValueType.OBJECT, obj.getJsonType());
assertEquals(BaseJsonLikeValue.ValueType.OBJECT, obj.getJsonType());
assertEquals(true, obj.isObject());
assertEquals(false, obj.isArray());
assertEquals(false, obj.isScalar());
@ -96,15 +96,15 @@ public class JsonLikeStructureTest {
value = rootObject.get("array-value");
assertNotNull(value);
assertEquals(JsonLikeValue.ValueType.ARRAY, value.getJsonType());
assertEquals(BaseJsonLikeValue.ValueType.ARRAY, value.getJsonType());
assertEquals(false, value.isObject());
assertEquals(true, value.isArray());
assertEquals(false, value.isScalar());
assertEquals(false, value.isNull());
JsonLikeArray array = value.getAsArray();
BaseJsonLikeArray array = value.getAsArray();
assertNotNull(array);
assertEquals(JsonLikeValue.ValueType.ARRAY, array.getJsonType());
assertEquals(BaseJsonLikeValue.ValueType.ARRAY, array.getJsonType());
assertEquals(false, array.isObject());
assertEquals(true, array.isArray());
assertEquals(false, array.isScalar());
@ -112,7 +112,7 @@ public class JsonLikeStructureTest {
value = rootObject.get("null-value");
assertNotNull(value);
assertEquals(JsonLikeValue.ValueType.NULL, value.getJsonType());
assertEquals(BaseJsonLikeValue.ValueType.NULL, value.getJsonType());
assertEquals(false, value.isObject());
assertEquals(false, value.isArray());
assertEquals(false, value.isScalar());
@ -120,24 +120,24 @@ public class JsonLikeStructureTest {
value = rootObject.get("scalar-string");
assertNotNull(value);
assertEquals(JsonLikeValue.ValueType.SCALAR, value.getJsonType());
assertEquals(BaseJsonLikeValue.ValueType.SCALAR, value.getJsonType());
assertEquals(false, value.isObject());
assertEquals(false, value.isArray());
assertEquals(true, value.isScalar());
assertEquals(false, value.isNull());
assertEquals(JsonLikeValue.ScalarType.STRING, value.getDataType());
assertEquals(BaseJsonLikeValue.ScalarType.STRING, value.getDataType());
assertEquals(value.getAsString(), "A scalar string");
value = rootObject.get("scalar-number");
assertNotNull(value);
assertEquals(JsonLikeValue.ValueType.SCALAR, value.getJsonType());
assertEquals(JsonLikeValue.ScalarType.NUMBER, value.getDataType());
assertEquals(BaseJsonLikeValue.ValueType.SCALAR, value.getJsonType());
assertEquals(BaseJsonLikeValue.ScalarType.NUMBER, value.getDataType());
assertEquals(value.getAsString(), "11111");
value = rootObject.get("scalar-boolean");
assertNotNull(value);
assertEquals(JsonLikeValue.ValueType.SCALAR, value.getJsonType());
assertEquals(JsonLikeValue.ScalarType.BOOLEAN, value.getDataType());
assertEquals(BaseJsonLikeValue.ValueType.SCALAR, value.getJsonType());
assertEquals(BaseJsonLikeValue.ScalarType.BOOLEAN, value.getDataType());
assertEquals(value.getAsString(), "true");
}

View File

@ -31,7 +31,7 @@ class ReindexTerminologyCommandTest {
private final FhirContext myContext = FhirContext.forR4();
@Spy
private BaseJpaSystemProvider<?, ?> myProvider = spy(new BaseJpaSystemProvider<>());
private BaseJpaSystemProvider<?, ?> myProvider = spy(new BaseJpaSystemProvider<>() {});
@RegisterExtension
public final RestServerR4Helper myRestServerR4Helper = new RestServerR4Helper(true);

View File

@ -21,9 +21,9 @@ package ca.uhn.fhir.rest.client.tls;
*/
import ca.uhn.fhir.i18n.Msg;
import ca.uhn.fhir.tls.BaseStoreInfo;
import ca.uhn.fhir.tls.KeyStoreInfo;
import ca.uhn.fhir.tls.PathType;
import ca.uhn.fhir.tls.StoreInfo;
import ca.uhn.fhir.tls.TlsAuthentication;
import ca.uhn.fhir.tls.TrustStoreInfo;
import org.apache.commons.lang3.Validate;
@ -80,7 +80,7 @@ public class TlsAuthenticationSvc {
}
}
public static KeyStore createKeyStore(StoreInfo theStoreInfo){
public static KeyStore createKeyStore(BaseStoreInfo theStoreInfo){
try {
KeyStore keyStore = KeyStore.getInstance(theStoreInfo.getType().toString());

View File

@ -5,8 +5,8 @@ import ca.uhn.fhir.parser.IParser;
import ca.uhn.fhir.rest.api.Constants;
import ca.uhn.fhir.rest.api.EncodingEnum;
import ca.uhn.fhir.rest.api.MethodOutcome;
import ca.uhn.fhir.rest.api.server.ParseAction;
import ca.uhn.fhir.rest.server.RestfulResponse;
import ca.uhn.fhir.rest.api.server.BaseParseAction;
import ca.uhn.fhir.rest.server.BaseRestfulResponse;
import ca.uhn.fhir.rest.server.RestfulServerUtils;
import org.apache.commons.lang3.StringUtils;
import org.hl7.fhir.instance.model.api.IBaseBinary;
@ -47,7 +47,7 @@ import static org.apache.commons.lang3.StringUtils.isNotBlank;
*
* @author Peter Van Houte | peter.vanhoute@agfa.com | Agfa Healthcare
*/
public class JaxRsResponse extends RestfulResponse<JaxRsRequest> {
public class JaxRsResponse extends BaseRestfulResponse<JaxRsRequest> {
/**
* The constructor
@ -89,8 +89,8 @@ public class JaxRsResponse extends RestfulResponse<JaxRsRequest> {
}
@Override
public Response returnResponse(ParseAction<?> outcome, int operationStatus, boolean allowPrefer,
MethodOutcome response, String resourceName) throws IOException {
public Response returnResponse(BaseParseAction<?> outcome, int operationStatus, boolean allowPrefer,
MethodOutcome response, String resourceName) throws IOException {
StringWriter writer = new StringWriter();
if (outcome != null) {
FhirContext fhirContext = getRequestDetails().getServer().getFhirContext();

View File

@ -193,9 +193,9 @@ public class SearchFilterParser {
return str.toString();
}
private Filter parse() throws FilterSyntaxException {
private BaseFilter parse() throws FilterSyntaxException {
Filter result = parseOpen();
BaseFilter result = parseOpen();
if (cursor < original.length()) {
throw new FilterSyntaxException(Msg.code(1056) + String.format("Expression did not terminate at %d",
cursor));
@ -203,9 +203,9 @@ public class SearchFilterParser {
return result;
}
private Filter parseOpen() throws FilterSyntaxException {
private BaseFilter parseOpen() throws FilterSyntaxException {
Filter result;
BaseFilter result;
String s;
FilterParameterGroup grp;
if (peek() == FilterLexType.fsltOpen) {
@ -239,9 +239,9 @@ public class SearchFilterParser {
return result;
}
private Filter parseLogical(Filter filter) throws FilterSyntaxException {
private BaseFilter parseLogical(BaseFilter filter) throws FilterSyntaxException {
Filter result = null;
BaseFilter result = null;
String s;
FilterLogical logical;
if (filter == null) {
@ -302,9 +302,9 @@ public class SearchFilterParser {
return result;
}
private Filter parseParameter(String name) throws FilterSyntaxException {
private BaseFilter parseParameter(String name) throws FilterSyntaxException {
Filter result;
BaseFilter result;
String s;
FilterParameter filter = new FilterParameter();
@ -423,7 +423,7 @@ public class SearchFilterParser {
fsltCloseSq
}
abstract public static class Filter {
abstract public static class BaseFilter {
private FilterItemType itemType;
@ -435,7 +435,7 @@ public class SearchFilterParser {
public static class FilterParameterPath {
private String FName;
private Filter FFilter;
private BaseFilter FFilter;
private FilterParameterPath FNext;
public String getName() {
@ -448,12 +448,12 @@ public class SearchFilterParser {
FName = value;
}
public Filter getFilter() {
public BaseFilter getFilter() {
return FFilter;
}
public void setFilter(Filter value) {
public void setFilter(BaseFilter value) {
FFilter = value;
}
@ -483,16 +483,16 @@ public class SearchFilterParser {
}
}
public static class FilterParameterGroup extends Filter {
public static class FilterParameterGroup extends BaseFilter {
private Filter FContained;
private BaseFilter FContained;
public Filter getContained() {
public BaseFilter getContained() {
return FContained;
}
public void setContained(Filter value) {
public void setContained(BaseFilter value) {
FContained = value;
}
@ -505,7 +505,7 @@ public class SearchFilterParser {
}
}
public static class FilterParameter extends Filter {
public static class FilterParameter extends BaseFilter {
private FilterParameterPath FParamPath;
private CompareOperation FOperation;
@ -563,19 +563,19 @@ public class SearchFilterParser {
}
}
public static class FilterLogical extends Filter {
public static class FilterLogical extends BaseFilter {
private Filter FFilter1;
private BaseFilter FFilter1;
private FilterLogicalOperation FOperation;
private Filter FFilter2;
private BaseFilter FFilter2;
public Filter getFilter1() {
public BaseFilter getFilter1() {
return FFilter1;
}
void setFilter1(Filter FFilter1) {
void setFilter1(BaseFilter FFilter1) {
this.FFilter1 = FFilter1;
}
@ -590,12 +590,12 @@ public class SearchFilterParser {
this.FOperation = FOperation;
}
public Filter getFilter2() {
public BaseFilter getFilter2() {
return FFilter2;
}
void setFilter2(Filter FFilter2) {
void setFilter2(BaseFilter FFilter2) {
this.FFilter2 = FFilter2;
}
@ -612,7 +612,7 @@ public class SearchFilterParser {
}
}
static public Filter parse(String expression) throws FilterSyntaxException {
static public BaseFilter parse(String expression) throws FilterSyntaxException {
SearchFilterParser parser = new SearchFilterParser();
parser.original = expression;
parser.cursor = 0;

View File

@ -6,7 +6,6 @@ import ca.uhn.fhir.model.dstu2.resource.Composition;
import ca.uhn.fhir.model.valueset.BundleTypeEnum;
import ca.uhn.fhir.rest.annotation.Operation;
import ca.uhn.fhir.rest.api.server.IBundleProvider;
import org.hl7.fhir.instance.model.api.IBaseBundle;
/*
* #%L
@ -28,7 +27,7 @@ import org.hl7.fhir.instance.model.api.IBaseBundle;
* #L%
*/
public class BaseJpaResourceProviderCompositionDstu2 extends JpaResourceProviderDstu2<Composition> {
public abstract class BaseJpaResourceProviderCompositionDstu2 extends JpaResourceProviderDstu2<Composition> {
/**
* Composition/123/$document

View File

@ -34,7 +34,7 @@ import ca.uhn.fhir.rest.api.SortSpec;
import ca.uhn.fhir.rest.api.server.IBundleProvider;
import ca.uhn.fhir.rest.param.DateRangeParam;
public class BaseJpaResourceProviderEncounterDstu2 extends JpaResourceProviderDstu2<Encounter> {
public abstract class BaseJpaResourceProviderEncounterDstu2 extends JpaResourceProviderDstu2<Encounter> {
/**
* Encounter/123/$everything

View File

@ -22,6 +22,6 @@ import ca.uhn.fhir.model.dstu2.resource.MessageHeader;
* #L%
*/
public class BaseJpaResourceProviderMessageHeaderDstu2 extends JpaResourceProviderDstu2<MessageHeader> {
public abstract class BaseJpaResourceProviderMessageHeaderDstu2 extends JpaResourceProviderDstu2<MessageHeader> {
// nothing now
}

View File

@ -21,8 +21,6 @@ import ca.uhn.fhir.rest.param.StringOrListParam;
import ca.uhn.fhir.rest.param.StringParam;
import ca.uhn.fhir.rest.param.TokenOrListParam;
import ca.uhn.fhir.rest.param.TokenParam;
import org.hl7.fhir.r4.model.IdType;
import org.hl7.fhir.r4.model.StringType;
import java.util.Arrays;
import java.util.List;
@ -49,7 +47,7 @@ import static org.apache.commons.lang3.StringUtils.isNotBlank;
* #L%
*/
public class BaseJpaResourceProviderPatientDstu2 extends JpaResourceProviderDstu2<Patient> {
public abstract class BaseJpaResourceProviderPatientDstu2 extends JpaResourceProviderDstu2<Patient> {
/**
* Patient/123/$everything

View File

@ -22,7 +22,7 @@ package ca.uhn.fhir.jpa.provider;
import ca.uhn.fhir.model.dstu2.resource.StructureDefinition;
public class BaseJpaResourceProviderStructureDefinitionDstu2 extends JpaResourceProviderDstu2<StructureDefinition> {
public abstract class BaseJpaResourceProviderStructureDefinitionDstu2 extends JpaResourceProviderDstu2<StructureDefinition> {
// nothing yet

View File

@ -20,10 +20,10 @@ package ca.uhn.fhir.jpa.provider;
* #L%
*/
import ca.uhn.fhir.i18n.Msg;
import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.context.support.IValidationSupport;
import ca.uhn.fhir.context.support.ValueSetExpansionOptions;
import ca.uhn.fhir.i18n.Msg;
import ca.uhn.fhir.jpa.api.dao.IFhirResourceDaoCodeSystem;
import ca.uhn.fhir.jpa.api.dao.IFhirResourceDaoValueSet;
import ca.uhn.fhir.jpa.model.util.JpaConstants;
@ -49,7 +49,7 @@ import javax.servlet.http.HttpServletRequest;
import static org.apache.commons.lang3.StringUtils.isNotBlank;
public class BaseJpaResourceProviderValueSetDstu2 extends JpaResourceProviderDstu2<ValueSet> {
public abstract class BaseJpaResourceProviderValueSetDstu2 extends JpaResourceProviderDstu2<ValueSet> {
@Operation(name = JpaConstants.OPERATION_EXPAND, idempotent = true)

View File

@ -21,10 +21,6 @@ package ca.uhn.fhir.jpa.provider;
*/
import ca.uhn.fhir.i18n.Msg;
import ca.uhn.fhir.jpa.api.dao.IFhirSystemDao;
import ca.uhn.fhir.jpa.api.model.ExpungeOptions;
import ca.uhn.fhir.jpa.api.model.ExpungeOutcome;
import ca.uhn.fhir.jpa.model.util.JpaConstants;
import ca.uhn.fhir.jpa.search.reindex.IResourceReindexingSvc;
import ca.uhn.fhir.jpa.term.api.ITermReadSvc;
import ca.uhn.fhir.jpa.term.api.ReindexTerminologyResult;
@ -32,7 +28,6 @@ import ca.uhn.fhir.rest.annotation.At;
import ca.uhn.fhir.rest.annotation.History;
import ca.uhn.fhir.rest.annotation.Offset;
import ca.uhn.fhir.rest.annotation.Operation;
import ca.uhn.fhir.rest.annotation.OperationParam;
import ca.uhn.fhir.rest.annotation.Since;
import ca.uhn.fhir.rest.api.server.IBundleProvider;
import ca.uhn.fhir.rest.api.server.RequestDetails;
@ -43,16 +38,14 @@ import ca.uhn.fhir.util.ParametersUtil;
import ca.uhn.fhir.util.StopWatch;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.hl7.fhir.instance.model.api.IBaseParameters;
import org.hl7.fhir.instance.model.api.IPrimitiveType;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Required;
import javax.servlet.http.HttpServletRequest;
import java.util.Date;
public class BaseJpaSystemProvider<T, MT> extends BaseStorageSystemProvider<T, MT> implements IJpaSystemProvider {
public abstract class BaseJpaSystemProvider<T, MT> extends BaseStorageSystemProvider<T, MT> implements IJpaSystemProvider {
private static final Logger ourLog = LoggerFactory.getLogger(BaseJpaSystemProvider.class);
public static final String RESP_PARAM_SUCCESS = "success";

View File

@ -20,8 +20,8 @@ package ca.uhn.fhir.jpa.provider.dstu3;
* #L%
*/
import ca.uhn.fhir.i18n.Msg;
import ca.uhn.fhir.context.support.IValidationSupport;
import ca.uhn.fhir.i18n.Msg;
import ca.uhn.fhir.jpa.api.dao.IFhirResourceDaoCodeSystem;
import ca.uhn.fhir.jpa.model.util.JpaConstants;
import ca.uhn.fhir.rest.annotation.Operation;
@ -41,7 +41,7 @@ import org.hl7.fhir.exceptions.FHIRException;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
public class BaseJpaResourceProviderCodeSystemDstu3 extends JpaResourceProviderDstu3<CodeSystem> {
public abstract class BaseJpaResourceProviderCodeSystemDstu3 extends JpaResourceProviderDstu3<CodeSystem> {
@Operation(name = JpaConstants.OPERATION_LOOKUP, idempotent = true, returnParameters = {
@OperationParam(name = "name", type = StringType.class, min = 1),

View File

@ -13,15 +13,9 @@ import ca.uhn.fhir.rest.api.SortSpec;
import ca.uhn.fhir.rest.api.server.IBundleProvider;
import ca.uhn.fhir.rest.api.server.RequestDetails;
import ca.uhn.fhir.rest.param.DateRangeParam;
import org.hl7.fhir.dstu3.model.Bundle;
import org.hl7.fhir.dstu3.model.Composition;
import org.hl7.fhir.dstu3.model.IdType;
import org.hl7.fhir.dstu3.model.Resource;
import org.hl7.fhir.dstu3.model.UnsignedIntType;
import org.hl7.fhir.instance.model.api.IBaseBundle;
import org.hl7.fhir.instance.model.api.IBaseResource;
import java.util.List;
/*
* #%L
@ -43,7 +37,7 @@ import java.util.List;
* #L%
*/
public class BaseJpaResourceProviderCompositionDstu3 extends JpaResourceProviderDstu3<Composition> {
public abstract class BaseJpaResourceProviderCompositionDstu3 extends JpaResourceProviderDstu3<Composition> {
/**
* Composition/123/$document

View File

@ -20,8 +20,8 @@ package ca.uhn.fhir.jpa.provider.dstu3;
* #L%
*/
import ca.uhn.fhir.i18n.Msg;
import ca.uhn.fhir.context.support.TranslateConceptResults;
import ca.uhn.fhir.i18n.Msg;
import ca.uhn.fhir.jpa.api.dao.IFhirResourceDaoConceptMap;
import ca.uhn.fhir.jpa.api.model.TranslationRequest;
import ca.uhn.fhir.jpa.model.util.JpaConstants;
@ -47,7 +47,7 @@ import org.hl7.fhir.exceptions.FHIRException;
import javax.servlet.http.HttpServletRequest;
public class BaseJpaResourceProviderConceptMapDstu3 extends JpaResourceProviderDstu3<ConceptMap> {
public abstract class BaseJpaResourceProviderConceptMapDstu3 extends JpaResourceProviderDstu3<ConceptMap> {
@Operation(name = JpaConstants.OPERATION_TRANSLATE, idempotent = true, returnParameters = {
@OperationParam(name = "result", type = BooleanType.class, min = 1, max = 1),
@OperationParam(name = "message", type = StringType.class, min = 0, max = 1),

View File

@ -36,7 +36,7 @@ import org.hl7.fhir.dstu3.model.UnsignedIntType;
* #L%
*/
public class BaseJpaResourceProviderEncounterDstu3 extends JpaResourceProviderDstu3<Encounter> {
public abstract class BaseJpaResourceProviderEncounterDstu3 extends JpaResourceProviderDstu3<Encounter> {
/**
* Encounter/123/$everything

View File

@ -22,6 +22,6 @@ import org.hl7.fhir.dstu3.model.MessageHeader;
* #L%
*/
public class BaseJpaResourceProviderMessageHeaderDstu3 extends JpaResourceProviderDstu3<MessageHeader> {
public abstract class BaseJpaResourceProviderMessageHeaderDstu3 extends JpaResourceProviderDstu3<MessageHeader> {
// nothing now
}

View File

@ -40,7 +40,7 @@ import java.util.Map;
* #L%
*/
public class BaseJpaResourceProviderObservationDstu3 extends JpaResourceProviderDstu3<Observation> {
public abstract class BaseJpaResourceProviderObservationDstu3 extends JpaResourceProviderDstu3<Observation> {
/**
* Observation/$lastn

View File

@ -48,7 +48,7 @@ import static org.apache.commons.lang3.StringUtils.isNotBlank;
* #L%
*/
public class BaseJpaResourceProviderPatientDstu3 extends JpaResourceProviderDstu3<Patient> {
public abstract class BaseJpaResourceProviderPatientDstu3 extends JpaResourceProviderDstu3<Patient> {
/**
* Patient/123/$everything

View File

@ -36,7 +36,7 @@ import org.hl7.fhir.dstu3.model.StructureDefinition;
* #L%
*/
public class BaseJpaResourceProviderStructureDefinitionDstu3 extends JpaResourceProviderDstu3<StructureDefinition> {
public abstract class BaseJpaResourceProviderStructureDefinitionDstu3 extends JpaResourceProviderDstu3<StructureDefinition> {
/**
* <code>$snapshot</code> operation

View File

@ -22,6 +22,6 @@ package ca.uhn.fhir.jpa.provider.dstu3;
import org.hl7.fhir.dstu3.model.ValueSet;
public class BaseJpaResourceProviderValueSetDstu3 extends JpaResourceProviderDstu3<ValueSet> {
public abstract class BaseJpaResourceProviderValueSetDstu3 extends JpaResourceProviderDstu3<ValueSet> {
}

View File

@ -50,7 +50,7 @@ import java.util.List;
* #L%
*/
public class BaseJpaResourceProviderCodeSystemR4 extends JpaResourceProviderR4<CodeSystem> {
public abstract class BaseJpaResourceProviderCodeSystemR4 extends JpaResourceProviderR4<CodeSystem> {
@Autowired
@Qualifier(JpaConfig.JPA_VALIDATION_SUPPORT_CHAIN)

View File

@ -1,6 +1,5 @@
package ca.uhn.fhir.jpa.provider.r4;
import ca.uhn.fhir.context.api.BundleInclusionRule;
import ca.uhn.fhir.jpa.api.dao.IFhirResourceDaoComposition;
import ca.uhn.fhir.jpa.model.util.JpaConstants;
import ca.uhn.fhir.model.api.annotation.Description;
@ -9,26 +8,15 @@ import ca.uhn.fhir.rest.annotation.IdParam;
import ca.uhn.fhir.rest.annotation.Operation;
import ca.uhn.fhir.rest.annotation.OperationParam;
import ca.uhn.fhir.rest.annotation.Sort;
import ca.uhn.fhir.rest.api.BundleLinks;
import ca.uhn.fhir.rest.api.Constants;
import ca.uhn.fhir.rest.api.IVersionSpecificBundleFactory;
import ca.uhn.fhir.rest.api.SortSpec;
import ca.uhn.fhir.rest.api.server.IBundleProvider;
import ca.uhn.fhir.rest.api.server.RequestDetails;
import ca.uhn.fhir.rest.param.DateRangeParam;
import org.hl7.fhir.instance.model.api.IBaseBundle;
import org.hl7.fhir.instance.model.api.IBaseResource;
import org.hl7.fhir.r4.hapi.rest.server.R4BundleFactory;
import org.hl7.fhir.r4.model.Bundle;
import org.hl7.fhir.r4.model.Composition;
import org.hl7.fhir.r4.model.DateType;
import org.hl7.fhir.r4.model.IdType;
import org.hl7.fhir.r4.model.Resource;
import org.hl7.fhir.r4.model.UnsignedIntType;
import java.util.Date;
import java.util.List;
/*
* #%L
@ -50,7 +38,7 @@ import java.util.List;
* #L%
*/
public class BaseJpaResourceProviderCompositionR4 extends JpaResourceProviderR4<Composition> {
public abstract class BaseJpaResourceProviderCompositionR4 extends JpaResourceProviderR4<Composition> {
/**
* Composition/123/$document

View File

@ -20,10 +20,10 @@ package ca.uhn.fhir.jpa.provider.r4;
* #L%
*/
import ca.uhn.fhir.context.support.TranslateConceptResults;
import ca.uhn.fhir.i18n.Msg;
import ca.uhn.fhir.jpa.api.dao.IFhirResourceDaoConceptMap;
import ca.uhn.fhir.jpa.api.model.TranslationRequest;
import ca.uhn.fhir.context.support.TranslateConceptResults;
import ca.uhn.fhir.jpa.model.util.JpaConstants;
import ca.uhn.fhir.jpa.term.TermConceptMappingSvcImpl;
import ca.uhn.fhir.rest.annotation.IdParam;
@ -43,7 +43,7 @@ import org.hl7.fhir.r4.model.UriType;
import javax.servlet.http.HttpServletRequest;
public class BaseJpaResourceProviderConceptMapR4 extends JpaResourceProviderR4<ConceptMap> {
public abstract class BaseJpaResourceProviderConceptMapR4 extends JpaResourceProviderR4<ConceptMap> {
@Operation(name = JpaConstants.OPERATION_TRANSLATE, idempotent = true, returnParameters = {
@OperationParam(name = "result", type = BooleanType.class, min = 1, max = 1),
@OperationParam(name = "message", type = StringType.class, min = 0, max = 1),

View File

@ -36,7 +36,7 @@ import org.hl7.fhir.r4.model.UnsignedIntType;
* #L%
*/
public class BaseJpaResourceProviderEncounterR4 extends JpaResourceProviderR4<Encounter> {
public abstract class BaseJpaResourceProviderEncounterR4 extends JpaResourceProviderR4<Encounter> {
/**
* Encounter/123/$everything

View File

@ -22,6 +22,6 @@ import org.hl7.fhir.r4.model.MessageHeader;
* #L%
*/
public class BaseJpaResourceProviderMessageHeaderR4 extends JpaResourceProviderR4<MessageHeader> {
public abstract class BaseJpaResourceProviderMessageHeaderR4 extends JpaResourceProviderR4<MessageHeader> {
// nothing right now
}

View File

@ -40,7 +40,7 @@ import java.util.Map;
* #L%
*/
public class BaseJpaResourceProviderObservationR4 extends JpaResourceProviderR4<Observation> {
public abstract class BaseJpaResourceProviderObservationR4 extends JpaResourceProviderR4<Observation> {
/**
* Observation/$lastn

View File

@ -4,7 +4,6 @@ import ca.uhn.fhir.i18n.Msg;
import ca.uhn.fhir.jpa.api.dao.IFhirResourceDaoPatient;
import ca.uhn.fhir.jpa.model.util.JpaConstants;
import ca.uhn.fhir.model.api.annotation.Description;
import ca.uhn.fhir.model.primitive.StringDt;
import ca.uhn.fhir.model.valueset.BundleTypeEnum;
import ca.uhn.fhir.rest.annotation.IdParam;
import ca.uhn.fhir.rest.annotation.Operation;
@ -57,7 +56,7 @@ import static org.apache.commons.lang3.StringUtils.isNotBlank;
* #L%
*/
public class BaseJpaResourceProviderPatientR4 extends JpaResourceProviderR4<Patient> {
public abstract class BaseJpaResourceProviderPatientR4 extends JpaResourceProviderR4<Patient> {
@Autowired
private MemberMatcherR4Helper myMemberMatcherR4Helper;

View File

@ -36,7 +36,7 @@ import org.hl7.fhir.r4.model.StructureDefinition;
* #L%
*/
public class BaseJpaResourceProviderStructureDefinitionR4 extends JpaResourceProviderR4<StructureDefinition> {
public abstract class BaseJpaResourceProviderStructureDefinitionR4 extends JpaResourceProviderR4<StructureDefinition> {
/**
* <code>$snapshot</code> operation

View File

@ -22,6 +22,6 @@ package ca.uhn.fhir.jpa.provider.r4;
import org.hl7.fhir.r4.model.ValueSet;
public class BaseJpaResourceProviderValueSetR4 extends JpaResourceProviderR4<ValueSet> {
public abstract class BaseJpaResourceProviderValueSetR4 extends JpaResourceProviderR4<ValueSet> {
}

View File

@ -28,13 +28,12 @@ import ca.uhn.fhir.rest.annotation.IdParam;
import ca.uhn.fhir.rest.annotation.Operation;
import ca.uhn.fhir.rest.annotation.OperationParam;
import ca.uhn.fhir.rest.api.server.RequestDetails;
import org.hl7.fhir.r5.model.IdType;
import org.hl7.fhir.r5.model.BooleanType;
import org.hl7.fhir.r5.model.CodeSystem;
import org.hl7.fhir.r5.model.CodeType;
import org.hl7.fhir.r5.model.CodeableConcept;
import org.hl7.fhir.r5.model.Coding;
import org.hl7.fhir.r5.model.IdType;
import org.hl7.fhir.r5.model.Parameters;
import org.hl7.fhir.r5.model.StringType;
import org.hl7.fhir.r5.model.UriType;
@ -42,7 +41,7 @@ import org.hl7.fhir.r5.model.UriType;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
public class BaseJpaResourceProviderCodeSystemR5 extends JpaResourceProviderR5<CodeSystem> {
public abstract class BaseJpaResourceProviderCodeSystemR5 extends JpaResourceProviderR5<CodeSystem> {
/**
* $lookup operation

View File

@ -13,16 +13,10 @@ import ca.uhn.fhir.rest.api.SortSpec;
import ca.uhn.fhir.rest.api.server.IBundleProvider;
import ca.uhn.fhir.rest.api.server.RequestDetails;
import ca.uhn.fhir.rest.param.DateRangeParam;
import org.hl7.fhir.instance.model.api.IBaseBundle;
import org.hl7.fhir.instance.model.api.IBaseResource;
import org.hl7.fhir.r5.model.Bundle;
import org.hl7.fhir.r5.model.Composition;
import org.hl7.fhir.r5.model.IdType;
import org.hl7.fhir.r5.model.Resource;
import org.hl7.fhir.r5.model.UnsignedIntType;
import java.util.List;
/*
* #%L
@ -44,7 +38,7 @@ import java.util.List;
* #L%
*/
public class BaseJpaResourceProviderCompositionR5 extends JpaResourceProviderR5<Composition> {
public abstract class BaseJpaResourceProviderCompositionR5 extends JpaResourceProviderR5<Composition> {
/**
* Composition/123/$document

View File

@ -20,8 +20,8 @@ package ca.uhn.fhir.jpa.provider.r5;
* #L%
*/
import ca.uhn.fhir.i18n.Msg;
import ca.uhn.fhir.context.support.TranslateConceptResults;
import ca.uhn.fhir.i18n.Msg;
import ca.uhn.fhir.jpa.api.dao.IFhirResourceDaoConceptMap;
import ca.uhn.fhir.jpa.api.model.TranslationRequest;
import ca.uhn.fhir.jpa.model.util.JpaConstants;
@ -45,7 +45,7 @@ import org.hl7.fhir.r5.model.UriType;
import javax.servlet.http.HttpServletRequest;
public class BaseJpaResourceProviderConceptMapR5 extends JpaResourceProviderR5<ConceptMap> {
public abstract class BaseJpaResourceProviderConceptMapR5 extends JpaResourceProviderR5<ConceptMap> {
@Operation(name = JpaConstants.OPERATION_TRANSLATE, idempotent = true, returnParameters = {
@OperationParam(name = "result", type = BooleanType.class, min = 1, max = 1),
@OperationParam(name = "message", type = StringType.class, min = 0, max = 1),

View File

@ -36,7 +36,7 @@ import org.hl7.fhir.r5.model.UnsignedIntType;
* #L%
*/
public class BaseJpaResourceProviderEncounterR5 extends JpaResourceProviderR5<Encounter> {
public abstract class BaseJpaResourceProviderEncounterR5 extends JpaResourceProviderR5<Encounter> {
/**
* Encounter/123/$everything

View File

@ -22,6 +22,6 @@ import org.hl7.fhir.r5.model.MessageHeader;
* #L%
*/
public class BaseJpaResourceProviderMessageHeaderR5 extends JpaResourceProviderR5<MessageHeader> {
public abstract class BaseJpaResourceProviderMessageHeaderR5 extends JpaResourceProviderR5<MessageHeader> {
// nothing right now
}

View File

@ -40,7 +40,7 @@ import java.util.Map;
* #L%
*/
public class BaseJpaResourceProviderObservationR5 extends JpaResourceProviderR5<Observation> {
public abstract class BaseJpaResourceProviderObservationR5 extends JpaResourceProviderR5<Observation> {
/**
* Observation/$lastn

View File

@ -48,7 +48,7 @@ import static org.apache.commons.lang3.StringUtils.isNotBlank;
* #L%
*/
public class BaseJpaResourceProviderPatientR5 extends JpaResourceProviderR5<Patient> {
public abstract class BaseJpaResourceProviderPatientR5 extends JpaResourceProviderR5<Patient> {
/**
* Patient/123/$everything

View File

@ -36,7 +36,7 @@ import org.hl7.fhir.r5.model.StructureDefinition;
* #L%
*/
public class BaseJpaResourceProviderStructureDefinitionR5 extends JpaResourceProviderR5<StructureDefinition> {
public abstract class BaseJpaResourceProviderStructureDefinitionR5 extends JpaResourceProviderR5<StructureDefinition> {
/**
* <code>$snapshot</code> operation

View File

@ -22,6 +22,6 @@ package ca.uhn.fhir.jpa.provider.r5;
import org.hl7.fhir.r5.model.ValueSet;
public class BaseJpaResourceProviderValueSetR5 extends JpaResourceProviderR5<ValueSet> {
public abstract class BaseJpaResourceProviderValueSetR5 extends JpaResourceProviderR5<ValueSet> {
// nothing
}

View File

@ -34,13 +34,13 @@ import ca.uhn.fhir.jpa.model.entity.NormalizedQuantitySearchLevel;
import ca.uhn.fhir.jpa.model.entity.TagTypeEnum;
import ca.uhn.fhir.jpa.model.util.UcumServiceUtil;
import ca.uhn.fhir.jpa.search.builder.predicate.BaseJoiningPredicateBuilder;
import ca.uhn.fhir.jpa.search.builder.predicate.BaseQuantityPredicateBuilder;
import ca.uhn.fhir.jpa.search.builder.predicate.ComboNonUniqueSearchParameterPredicateBuilder;
import ca.uhn.fhir.jpa.search.builder.predicate.ComboUniqueSearchParameterPredicateBuilder;
import ca.uhn.fhir.jpa.search.builder.predicate.CoordsPredicateBuilder;
import ca.uhn.fhir.jpa.search.builder.predicate.DatePredicateBuilder;
import ca.uhn.fhir.jpa.search.builder.predicate.ForcedIdPredicateBuilder;
import ca.uhn.fhir.jpa.search.builder.predicate.NumberPredicateBuilder;
import ca.uhn.fhir.jpa.search.builder.predicate.QuantityBasePredicateBuilder;
import ca.uhn.fhir.jpa.search.builder.predicate.ResourceIdPredicateBuilder;
import ca.uhn.fhir.jpa.search.builder.predicate.ResourceLinkPredicateBuilder;
import ca.uhn.fhir.jpa.search.builder.predicate.ResourceTablePredicateBuilder;
@ -214,7 +214,7 @@ public class QueryStack {
public void addSortOnQuantity(String theResourceName, String theParamName, boolean theAscending) {
BaseJoiningPredicateBuilder firstPredicateBuilder = mySqlBuilder.getOrCreateFirstPredicateBuilder();
QuantityBasePredicateBuilder sortPredicateBuilder;
BaseQuantityPredicateBuilder sortPredicateBuilder;
sortPredicateBuilder = mySqlBuilder.addQuantityPredicateBuilder(firstPredicateBuilder.getResourceIdColumn());
Condition hashIdentityPredicate = sortPredicateBuilder.createHashIdentityPredicate(theResourceName, theParamName);
@ -414,7 +414,7 @@ public class QueryStack {
}
private Condition createPredicateFilter(QueryStack theQueryStack3, SearchFilterParser.Filter theFilter, String theResourceName, RequestDetails theRequest, RequestPartitionId theRequestPartitionId) {
private Condition createPredicateFilter(QueryStack theQueryStack3, SearchFilterParser.BaseFilter theFilter, String theResourceName, RequestDetails theRequest, RequestPartitionId theRequestPartitionId) {
if (theFilter instanceof SearchFilterParser.FilterParameter) {
return createPredicateFilter(theQueryStack3, (SearchFilterParser.FilterParameter) theFilter, theResourceName, theRequest, theRequestPartitionId);
@ -645,7 +645,7 @@ public class QueryStack {
String paramName = getParamNameWithPrefix(theSpnamePrefix, theSearchParam.getName());
if (theList.get(0).getMissing() != null) {
QuantityBasePredicateBuilder join = createOrReusePredicateBuilder(PredicateBuilderTypeEnum.QUANTITY, theSourceJoinColumn, theSearchParam.getName(), () -> theSqlBuilder.addQuantityPredicateBuilder(theSourceJoinColumn)).getResult();
BaseQuantityPredicateBuilder join = createOrReusePredicateBuilder(PredicateBuilderTypeEnum.QUANTITY, theSourceJoinColumn, theSearchParam.getName(), () -> theSqlBuilder.addQuantityPredicateBuilder(theSourceJoinColumn)).getResult();
return join.createPredicateParamMissingForNonReference(theResourceName, paramName, theList.get(0).getMissing(), theRequestPartitionId);
}
@ -654,7 +654,7 @@ public class QueryStack {
.map(t -> QuantityParam.toQuantityParam(t))
.collect(Collectors.toList());
QuantityBasePredicateBuilder join = null;
BaseQuantityPredicateBuilder join = null;
boolean normalizedSearchEnabled = myModelConfig.getNormalizedQuantitySearchLevel().equals(NormalizedQuantitySearchLevel.NORMALIZED_QUANTITY_SEARCH_SUPPORTED);
if (normalizedSearchEnabled) {
List<QuantityParam> normalizedQuantityParams = quantityParams
@ -1532,7 +1532,7 @@ public class QueryStack {
// Parse the predicates enumerated in the _filter separated by AND or OR...
if (theAndOrParams.get(0).get(0) instanceof StringParam) {
String filterString = ((StringParam) theAndOrParams.get(0).get(0)).getValue();
SearchFilterParser.Filter filter;
SearchFilterParser.BaseFilter filter;
try {
filter = SearchFilterParser.parse(filterString);
} catch (SearchFilterParser.FilterSyntaxException theE) {

View File

@ -34,7 +34,7 @@ import javax.annotation.Nonnull;
import java.util.Collection;
import java.util.List;
public class BasePredicateBuilder {
public abstract class BasePredicateBuilder {
private final SearchQueryBuilder mySearchSqlBuilder;

View File

@ -24,11 +24,9 @@ import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.interceptor.model.RequestPartitionId;
import ca.uhn.fhir.jpa.dao.predicate.SearchFilterParser;
import ca.uhn.fhir.jpa.model.entity.BaseResourceIndexedSearchParam;
import ca.uhn.fhir.jpa.model.entity.ResourceIndexedSearchParamBaseQuantity;
import ca.uhn.fhir.jpa.model.entity.BaseResourceIndexedSearchParamQuantity;
import ca.uhn.fhir.jpa.search.builder.QueryStack;
import ca.uhn.fhir.jpa.search.builder.sql.SearchQueryBuilder;
import ca.uhn.fhir.model.api.IQueryParameterType;
import ca.uhn.fhir.model.base.composite.BaseQuantityDt;
import ca.uhn.fhir.rest.param.ParamPrefixEnum;
import ca.uhn.fhir.rest.param.QuantityParam;
import com.healthmarketscience.sqlbuilder.BinaryCondition;
@ -45,7 +43,7 @@ import static org.apache.commons.lang3.ObjectUtils.defaultIfNull;
import static org.apache.commons.lang3.StringUtils.isBlank;
public abstract class QuantityBasePredicateBuilder extends BaseSearchParamPredicateBuilder {
public abstract class BaseQuantityPredicateBuilder extends BaseSearchParamPredicateBuilder {
protected DbColumn myColumnHashIdentitySystemUnits;
protected DbColumn myColumnHashIdentityUnits;
@ -57,11 +55,11 @@ public abstract class QuantityBasePredicateBuilder extends BaseSearchParamPredic
/**
* Constructor
*/
public QuantityBasePredicateBuilder(SearchQueryBuilder theSearchSqlBuilder, DbTable theTable) {
public BaseQuantityPredicateBuilder(SearchQueryBuilder theSearchSqlBuilder, DbTable theTable) {
super(theSearchSqlBuilder, theTable);
}
public Condition createPredicateQuantity(QuantityParam theParam, String theResourceName, String theParamName, CriteriaBuilder theBuilder, QuantityBasePredicateBuilder theFrom, SearchFilterParser.CompareOperation theOperation, RequestPartitionId theRequestPartitionId) {
public Condition createPredicateQuantity(QuantityParam theParam, String theResourceName, String theParamName, CriteriaBuilder theBuilder, BaseQuantityPredicateBuilder theFrom, SearchFilterParser.CompareOperation theOperation, RequestPartitionId theRequestPartitionId) {
String systemValue = theParam.getSystem();
String unitsValue = theParam.getUnits();
@ -70,10 +68,10 @@ public abstract class QuantityBasePredicateBuilder extends BaseSearchParamPredic
Condition hashPredicate;
if (!isBlank(systemValue) && !isBlank(unitsValue)) {
long hash = ResourceIndexedSearchParamBaseQuantity.calculateHashSystemAndUnits(getPartitionSettings(), theRequestPartitionId, theResourceName, theParamName, systemValue, unitsValue);
long hash = BaseResourceIndexedSearchParamQuantity.calculateHashSystemAndUnits(getPartitionSettings(), theRequestPartitionId, theResourceName, theParamName, systemValue, unitsValue);
hashPredicate = BinaryCondition.equalTo(myColumnHashIdentitySystemUnits, generatePlaceholder(hash));
} else if (!isBlank(unitsValue)) {
long hash = ResourceIndexedSearchParamBaseQuantity.calculateHashUnits(getPartitionSettings(), theRequestPartitionId, theResourceName, theParamName, unitsValue);
long hash = BaseResourceIndexedSearchParamQuantity.calculateHashUnits(getPartitionSettings(), theRequestPartitionId, theResourceName, theParamName, unitsValue);
hashPredicate = BinaryCondition.equalTo(myColumnHashIdentityUnits, generatePlaceholder(hash));
} else {
long hash = BaseResourceIndexedSearchParam.calculateHashIdentity(getPartitionSettings(), theRequestPartitionId, theResourceName, theParamName);

View File

@ -22,7 +22,7 @@ package ca.uhn.fhir.jpa.search.builder.predicate;
import ca.uhn.fhir.jpa.search.builder.sql.SearchQueryBuilder;
public class QuantityNormalizedPredicateBuilder extends QuantityBasePredicateBuilder {
public class QuantityNormalizedPredicateBuilder extends BaseQuantityPredicateBuilder {
/**
* Constructor

View File

@ -22,7 +22,7 @@ package ca.uhn.fhir.jpa.search.builder.predicate;
import ca.uhn.fhir.jpa.search.builder.sql.SearchQueryBuilder;
public class QuantityPredicateBuilder extends QuantityBasePredicateBuilder {
public class QuantityPredicateBuilder extends BaseQuantityPredicateBuilder {
/**

View File

@ -27,7 +27,7 @@ package ca.uhn.fhir.cql.common.builder;
Tip of the hat to Philips Healthcare developer nly98977
*/
public class BaseBuilder<T> {
public abstract class BaseBuilder<T> {
protected T complexProperty;

View File

@ -20,19 +20,14 @@ package ca.uhn.fhir.jpa.model.entity;
* #L%
*/
import ca.uhn.fhir.interceptor.model.RequestPartitionId;
import org.slf4j.Logger;
import javax.annotation.Nullable;
import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.MappedSuperclass;
import java.io.Serializable;
import static org.slf4j.LoggerFactory.getLogger;
@MappedSuperclass
public class BasePartitionable implements Serializable {
public abstract class BasePartitionable implements Serializable {
@Embedded

View File

@ -29,7 +29,7 @@ import javax.persistence.Column;
import javax.persistence.MappedSuperclass;
@MappedSuperclass
public abstract class ResourceIndexedSearchParamBaseQuantity extends BaseResourceIndexedSearchParam {
public abstract class BaseResourceIndexedSearchParamQuantity extends BaseResourceIndexedSearchParam {
private static final int MAX_LENGTH = 200;
@ -62,7 +62,7 @@ public abstract class ResourceIndexedSearchParamBaseQuantity extends BaseResourc
/**
* Constructor
*/
public ResourceIndexedSearchParamBaseQuantity() {
public BaseResourceIndexedSearchParamQuantity() {
super();
}

View File

@ -21,15 +21,13 @@ package ca.uhn.fhir.jpa.model.entity;
*/
import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.MappedSuperclass;
import java.io.Serializable;
@MappedSuperclass
public class BaseTag extends BasePartitionable implements Serializable {
public abstract class BaseTag extends BasePartitionable implements Serializable {
private static final long serialVersionUID = 1L;

View File

@ -57,7 +57,7 @@ import static org.apache.commons.lang3.StringUtils.isBlank;
@Index(name = "IDX_SP_QUANTITY_HASH_SYSUN_V2", columnList = "HASH_IDENTITY_SYS_UNITS,SP_VALUE,RES_ID,PARTITION_ID"),
@Index(name = "IDX_SP_QUANTITY_RESID_V2", columnList = "RES_ID,HASH_IDENTITY,HASH_IDENTITY_SYS_UNITS,HASH_IDENTITY_AND_UNITS,SP_VALUE,PARTITION_ID")
})
public class ResourceIndexedSearchParamQuantity extends ResourceIndexedSearchParamBaseQuantity {
public class ResourceIndexedSearchParamQuantity extends BaseResourceIndexedSearchParamQuantity {
private static final long serialVersionUID = 1L;

View File

@ -63,7 +63,7 @@ import static org.apache.commons.lang3.StringUtils.isBlank;
* @since 5.3.0
*
*/
public class ResourceIndexedSearchParamQuantityNormalized extends ResourceIndexedSearchParamBaseQuantity {
public class ResourceIndexedSearchParamQuantityNormalized extends BaseResourceIndexedSearchParamQuantity {
private static final long serialVersionUID = 1L;

View File

@ -11,11 +11,11 @@ public class ResourceIndexedSearchParamQuantityNormalizedTest {
@Test
public void testEquals() {
ResourceIndexedSearchParamBaseQuantity val1 = new ResourceIndexedSearchParamQuantityNormalized()
BaseResourceIndexedSearchParamQuantity val1 = new ResourceIndexedSearchParamQuantityNormalized()
.setValue(Double.parseDouble("123"));
val1.setPartitionSettings(new PartitionSettings());
val1.calculateHashes();
ResourceIndexedSearchParamBaseQuantity val2 = new ResourceIndexedSearchParamQuantityNormalized()
BaseResourceIndexedSearchParamQuantity val2 = new ResourceIndexedSearchParamQuantityNormalized()
.setValue(Double.parseDouble("123"));
val2.setPartitionSettings(new PartitionSettings());
val2.calculateHashes();

View File

@ -22,7 +22,7 @@ package ca.uhn.fhir.jpa.subscription.channel.models;
import ca.uhn.fhir.jpa.subscription.model.ChannelRetryConfiguration;
public class BaseChannelParameters {
public abstract class BaseChannelParameters {
private final String myChannelName;

View File

@ -1,8 +1,6 @@
package ca.uhn.fhir.jpa.dao;
import ca.uhn.fhir.jpa.dao.predicate.SearchFilterParser;
import ca.uhn.fhir.util.TestUtil;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
@ -12,7 +10,7 @@ public class SearchFilterSyntaxTest {
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(SearchFilterSyntaxTest.class);
private void testParse(String theExpression) throws SearchFilterParser.FilterSyntaxException {
SearchFilterParser.Filter filter = SearchFilterParser.parse(theExpression);
SearchFilterParser.BaseFilter filter = SearchFilterParser.parse(theExpression);
ourLog.info("Source: {}", theExpression);
ourLog.info("Parsed: {}", filter.toString());
assertNotNull(filter, "Parsing failed - returned null");

View File

@ -35,7 +35,7 @@ public class TerminologyHSearchIndexingProviderTest {
@Mock private SystemRequestDetails myRequestDetails;
@InjectMocks
private BaseJpaSystemProvider<?, ?> testedProvider = new BaseJpaSystemProvider<>();
private BaseJpaSystemProvider<?, ?> testedProvider = new BaseJpaSystemProvider<>() {};
@BeforeEach
void setUp() {

View File

@ -20,23 +20,22 @@ package ca.uhn.fhir.rest.api.server;
* #L%
*/
import ca.uhn.fhir.parser.IParser;
import java.io.IOException;
import java.io.Writer;
import ca.uhn.fhir.model.api.TagList;
import ca.uhn.fhir.parser.IParser;
/**
* @author Peter Van Houte
*
* @param <T>
* A functional class that parses an outcome
*/
public abstract class ParseAction<T> {
public abstract class BaseParseAction<T> {
protected T theOutcome;
protected ParseAction(T outcome) {
protected BaseParseAction(T outcome) {
this.theOutcome = outcome;
}

View File

@ -42,7 +42,7 @@ public interface IRestfulResponse {
* This is only used for DSTU1 getTags operations, so it can be removed at some point when we
* drop DSTU1
*/
Object returnResponse(ParseAction<?> outcome, int operationStatus, boolean allowPrefer, MethodOutcome response, String resourceName) throws IOException;
Object returnResponse(BaseParseAction<?> outcome, int operationStatus, boolean allowPrefer, MethodOutcome response, String resourceName) throws IOException;
Writer getResponseWriter(int theStatusCode, String theStatusMessage, String theContentType, String theCharset, boolean theRespondGzip) throws IOException;

View File

@ -20,23 +20,29 @@ package ca.uhn.fhir.rest.server;
* #L%
*/
import java.io.IOException;
import java.util.*;
import org.hl7.fhir.instance.model.api.*;
import ca.uhn.fhir.rest.api.SummaryEnum;
import ca.uhn.fhir.rest.api.server.IRestfulResponse;
import ca.uhn.fhir.rest.api.server.RequestDetails;
import org.hl7.fhir.instance.model.api.IBaseResource;
import org.hl7.fhir.instance.model.api.IIdType;
import org.hl7.fhir.instance.model.api.IPrimitiveType;
public abstract class RestfulResponse<T extends RequestDetails> implements IRestfulResponse {
import java.io.IOException;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
public abstract class BaseRestfulResponse<T extends RequestDetails> implements IRestfulResponse {
private IIdType myOperationResourceId;
private IPrimitiveType<Date> myOperationResourceLastUpdated;
private final Map<String, List<String>> myHeaders = new HashMap<>();
private T theRequestDetails;
public RestfulResponse(T requestDetails) {
public BaseRestfulResponse(T requestDetails) {
this.theRequestDetails = requestDetails;
}

View File

@ -41,9 +41,9 @@ import ca.uhn.fhir.rest.api.MethodOutcome;
import ca.uhn.fhir.rest.api.PreferReturnEnum;
import ca.uhn.fhir.rest.api.RequestTypeEnum;
import ca.uhn.fhir.rest.api.RestOperationTypeEnum;
import ca.uhn.fhir.rest.api.server.BaseParseAction;
import ca.uhn.fhir.rest.api.server.IFhirVersionServer;
import ca.uhn.fhir.rest.api.server.IRestfulServer;
import ca.uhn.fhir.rest.api.server.ParseAction;
import ca.uhn.fhir.rest.api.server.RequestDetails;
import ca.uhn.fhir.rest.server.RestfulServerUtils.ResponseEncoding;
import ca.uhn.fhir.rest.server.exceptions.AuthenticationException;
@ -1813,7 +1813,7 @@ public class RestfulServer extends HttpServlet implements IRestfulServer<Servlet
}
}
public Object returnResponse(ServletRequestDetails theRequest, ParseAction<?> outcome, int operationStatus, boolean allowPrefer, MethodOutcome response, String resourceName) throws IOException {
public Object returnResponse(ServletRequestDetails theRequest, BaseParseAction<?> outcome, int operationStatus, boolean allowPrefer, MethodOutcome response, String resourceName) throws IOException {
HttpServletResponse servletResponse = theRequest.getServletResponse();
servletResponse.setStatus(operationStatus);
servletResponse.setCharacterEncoding(Constants.CHARSET_NAME_UTF8);

View File

@ -32,7 +32,7 @@ import javax.annotation.Nonnull;
import java.util.Collections;
import java.util.List;
public class BaseResponseTerminologyInterceptor {
public abstract class BaseResponseTerminologyInterceptor {
protected final IValidationSupport myValidationSupport;
protected final FhirContext myContext;

View File

@ -22,8 +22,8 @@ package ca.uhn.fhir.rest.server.servlet;
import ca.uhn.fhir.rest.api.Constants;
import ca.uhn.fhir.rest.api.MethodOutcome;
import ca.uhn.fhir.rest.api.server.ParseAction;
import ca.uhn.fhir.rest.server.RestfulResponse;
import ca.uhn.fhir.rest.api.server.BaseParseAction;
import ca.uhn.fhir.rest.server.BaseRestfulResponse;
import org.apache.commons.lang3.StringUtils;
import org.hl7.fhir.instance.model.api.IBaseBinary;
@ -38,7 +38,7 @@ import java.util.List;
import java.util.Map.Entry;
import java.util.zip.GZIPOutputStream;
public class ServletRestfulResponse extends RestfulResponse<ServletRequestDetails> {
public class ServletRestfulResponse extends BaseRestfulResponse<ServletRequestDetails> {
/**
* Constructor
@ -110,7 +110,7 @@ public class ServletRestfulResponse extends RestfulResponse<ServletRequestDetail
}
@Override
public Object returnResponse(ParseAction<?> outcome, int operationStatus, boolean allowPrefer, MethodOutcome response, String resourceName) throws IOException {
public Object returnResponse(BaseParseAction<?> outcome, int operationStatus, boolean allowPrefer, MethodOutcome response, String resourceName) throws IOException {
addHeaders();
return getRequestDetails().getServer().returnResponse(getRequestDetails(), outcome, operationStatus, allowPrefer, response, resourceName);
}

View File

@ -21,14 +21,13 @@ package ca.uhn.fhir.rest.server.util;
*/
import ca.uhn.fhir.rest.api.server.RequestDetails;
import ca.uhn.fhir.rest.server.IRestfulServerDefaults;
import ca.uhn.fhir.rest.server.RestfulServer;
import ca.uhn.fhir.rest.server.RestfulServerConfiguration;
import org.apache.commons.lang3.Validate;
import javax.annotation.Nullable;
public class BaseServerCapabilityStatementProvider {
public abstract class BaseServerCapabilityStatementProvider {
private RestfulServerConfiguration myConfiguration;

View File

@ -11,14 +11,14 @@ import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.withSettings;
/**
* Unit tests of {@link RestfulResponse}.
* Unit tests of {@link BaseRestfulResponse}.
*/
public class RestfulResponseTest {
@Test
public void addMultipleHeaderValues() {
@SuppressWarnings("unchecked")
final RestfulResponse<?> restfulResponse =
mock(RestfulResponse.class, withSettings()
final BaseRestfulResponse<?> restfulResponse =
mock(BaseRestfulResponse.class, withSettings()
.useConstructor((RequestDetails) null).defaultAnswer(CALLS_REAL_METHODS));
restfulResponse.addHeader("Authorization", "Basic");

View File

@ -42,7 +42,7 @@ public class ArbitrarySqlTask extends BaseTask {
private static final Logger ourLog = LoggerFactory.getLogger(ArbitrarySqlTask.class);
private final String myDescription;
private final String myTableName;
private List<Task> myTask = new ArrayList<>();
private List<BaseTask> myTask = new ArrayList<>();
private int myBatchSize = 1000;
private String myExecuteOnlyIfTableExists;
private List<TableAndColumn> myConditionalOnExistenceOf = new ArrayList<>();
@ -82,7 +82,7 @@ public class ArbitrarySqlTask extends BaseTask {
}
}
for (Task next : myTask) {
for (BaseTask next : myTask) {
next.execute();
}
@ -104,7 +104,7 @@ public class ArbitrarySqlTask extends BaseTask {
}
@Override
protected void generateEquals(EqualsBuilder theBuilder, BaseTask theOtherObject) {
protected void generateEquals(EqualsBuilder theBuilder, ca.uhn.fhir.jpa.migrate.taskdef.BaseTask theOtherObject) {
ArbitrarySqlTask otherObject = (ArbitrarySqlTask) theOtherObject;
theBuilder.append(myTableName, otherObject.myTableName);
}
@ -136,11 +136,11 @@ public class ArbitrarySqlTask extends BaseTask {
}
}
private abstract class Task {
private abstract class BaseTask {
public abstract void execute();
}
private class QueryTask extends Task {
private class QueryTask extends BaseTask {
private final String mySql;
private final Consumer<Map<String, Object>> myConsumer;

View File

@ -1,6 +1,5 @@
package ca.uhn.fhir.jpa.migrate.taskdef;
import ca.uhn.fhir.interceptor.model.RequestPartitionId;
import ca.uhn.fhir.jpa.migrate.tasks.api.BaseMigrationTasks;
import ca.uhn.fhir.util.VersionEnum;
import org.junit.jupiter.params.ParameterizedTest;

View File

@ -389,8 +389,8 @@ public abstract class BaseTransactionProcessor {
for (int i = 0; i < requestEntriesSize; i++) {
nextResponseEntry = responseMap.get(i);
if (nextResponseEntry instanceof BaseServerResponseExceptionHolder) {
BaseServerResponseExceptionHolder caughtEx = (BaseServerResponseExceptionHolder) nextResponseEntry;
if (nextResponseEntry instanceof ServerResponseExceptionHolder) {
ServerResponseExceptionHolder caughtEx = (ServerResponseExceptionHolder) nextResponseEntry;
if (caughtEx.getException() != null) {
IBase nextEntry = myVersionAdapter.addEntry(response);
populateEntryWithOperationOutcome(caughtEx.getException(), nextEntry);
@ -1867,14 +1867,14 @@ public abstract class BaseTransactionProcessor {
}
private void populateResponseMapWithLastSeenException() {
BaseServerResponseExceptionHolder caughtEx = new BaseServerResponseExceptionHolder();
ServerResponseExceptionHolder caughtEx = new ServerResponseExceptionHolder();
caughtEx.setException(myLastSeenException);
myResponseMap.put(myResponseOrder, caughtEx);
}
}
private static class BaseServerResponseExceptionHolder {
private static class ServerResponseExceptionHolder {
private BaseServerResponseException myException;
public BaseServerResponseException getException() {

View File

@ -1,7 +1,7 @@
package ca.uhn.fhir.jpa.provider;
import ca.uhn.fhir.i18n.Msg;
import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.i18n.Msg;
import ca.uhn.fhir.jpa.api.config.DaoConfig;
import ca.uhn.fhir.jpa.api.model.ExpungeOptions;
import ca.uhn.fhir.jpa.api.model.ExpungeOutcome;
@ -42,7 +42,7 @@ import java.util.TreeSet;
* #L%
*/
public class BaseJpaProvider {
public abstract class BaseJpaProvider {
public static final String REMOTE_ADDR = "req.remoteAddr";
public static final String REMOTE_UA = "req.userAgent";
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(BaseJpaProvider.class);

View File

@ -32,7 +32,7 @@ import org.hl7.fhir.instance.model.api.IBaseParameters;
import org.hl7.fhir.instance.model.api.IPrimitiveType;
import org.springframework.beans.factory.annotation.Required;
public class BaseStorageSystemProvider<T, MT> extends BaseJpaProvider {
public abstract class BaseStorageSystemProvider<T, MT> extends BaseJpaProvider {
protected IFhirSystemDao<T, MT> myDao;
@Operation(name = ProviderConstants.OPERATION_EXPUNGE, idempotent = false, returnParameters = {

View File

@ -1,8 +1,8 @@
package ca.uhn.fhir.parser;
import ca.uhn.fhir.i18n.Msg;
import ca.uhn.fhir.parser.json.JsonLikeValue.ScalarType;
import ca.uhn.fhir.parser.json.JsonLikeValue.ValueType;
import ca.uhn.fhir.parser.json.BaseJsonLikeValue.ScalarType;
import ca.uhn.fhir.parser.json.BaseJsonLikeValue.ValueType;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;

View File

@ -1,7 +1,7 @@
package ca.uhn.fhir.parser;
import ca.uhn.fhir.i18n.Msg;
import ca.uhn.fhir.parser.json.JsonLikeValue.ValueType;
import ca.uhn.fhir.parser.json.BaseJsonLikeValue.ValueType;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;

View File

@ -6,8 +6,8 @@ import ca.uhn.fhir.narrative.DefaultThymeleafNarrativeGenerator;
import ca.uhn.fhir.parser.IParserErrorHandler.IParseLocation;
import ca.uhn.fhir.parser.PatientWithExtendedContactDstu3.CustomContactComponent;
import ca.uhn.fhir.parser.XmlParserDstu3Test.TestPatientFor327;
import ca.uhn.fhir.parser.json.JsonLikeValue.ScalarType;
import ca.uhn.fhir.parser.json.JsonLikeValue.ValueType;
import ca.uhn.fhir.parser.json.BaseJsonLikeValue.ScalarType;
import ca.uhn.fhir.parser.json.BaseJsonLikeValue.ValueType;
import ca.uhn.fhir.util.TestUtil;
import ca.uhn.fhir.validation.FhirValidator;
import ca.uhn.fhir.validation.ValidationResult;

View File

@ -2,8 +2,8 @@ package ca.uhn.fhir.parser.jsonlike;
import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.parser.IJsonLikeParser;
import ca.uhn.fhir.parser.json.BaseJsonLikeWriter;
import ca.uhn.fhir.parser.json.JsonLikeStructure;
import ca.uhn.fhir.parser.json.JsonLikeWriter;
import ca.uhn.fhir.parser.json.jackson.JacksonStructure;
import ca.uhn.fhir.util.TestUtil;
import org.apache.commons.io.IOUtils;
@ -95,7 +95,7 @@ public class JsonLikeParserDstu3Test {
public static class JsonLikeMapWriter extends JsonLikeWriter {
public static class JsonLikeMapWriter extends BaseJsonLikeWriter {
private Map<String,Object> target;
@ -147,7 +147,7 @@ public class JsonLikeParserDstu3Test {
}
@Override
public JsonLikeWriter init() throws IOException {
public BaseJsonLikeWriter init() throws IOException {
if (target != null) {
target.clear();
}
@ -157,7 +157,7 @@ public class JsonLikeParserDstu3Test {
}
@Override
public JsonLikeWriter flush() throws IOException {
public BaseJsonLikeWriter flush() throws IOException {
if (currentBlock.getType() != BlockType.NONE) {
throw new IOException("JsonLikeStreamWriter.flush() called but JSON document is not finished");
}
@ -170,7 +170,7 @@ public class JsonLikeParserDstu3Test {
}
@Override
public JsonLikeWriter beginObject() throws IOException {
public BaseJsonLikeWriter beginObject() throws IOException {
if (currentBlock.getType() == BlockType.OBJECT) {
throw new IOException("Unnamed JSON elements can only be created in JSON arrays");
}
@ -194,7 +194,7 @@ public class JsonLikeParserDstu3Test {
}
@Override
public JsonLikeWriter beginObject(String name) throws IOException {
public BaseJsonLikeWriter beginObject(String name) throws IOException {
if (currentBlock.getType() == BlockType.ARRAY) {
throw new IOException("Named JSON elements can only be created in JSON objects");
}
@ -208,7 +208,7 @@ public class JsonLikeParserDstu3Test {
}
@Override
public JsonLikeWriter beginArray(String name) throws IOException {
public BaseJsonLikeWriter beginArray(String name) throws IOException {
if (currentBlock.getType() == BlockType.ARRAY) {
throw new IOException("Named JSON elements can only be created in JSON objects");
}
@ -220,7 +220,7 @@ public class JsonLikeParserDstu3Test {
}
@Override
public JsonLikeWriter write(String value) throws IOException {
public BaseJsonLikeWriter write(String value) throws IOException {
if (currentBlock.getType() == BlockType.OBJECT) {
throw new IOException("Unnamed JSON elements can only be created in JSON arrays");
}
@ -229,7 +229,7 @@ public class JsonLikeParserDstu3Test {
}
@Override
public JsonLikeWriter write(BigInteger value) throws IOException {
public BaseJsonLikeWriter write(BigInteger value) throws IOException {
if (currentBlock.getType() == BlockType.OBJECT) {
throw new IOException("Unnamed JSON elements can only be created in JSON arrays");
}
@ -238,7 +238,7 @@ public class JsonLikeParserDstu3Test {
}
@Override
public JsonLikeWriter write(BigDecimal value) throws IOException {
public BaseJsonLikeWriter write(BigDecimal value) throws IOException {
if (currentBlock.getType() == BlockType.OBJECT) {
throw new IOException("Unnamed JSON elements can only be created in JSON arrays");
}
@ -247,7 +247,7 @@ public class JsonLikeParserDstu3Test {
}
@Override
public JsonLikeWriter write(long value) throws IOException {
public BaseJsonLikeWriter write(long value) throws IOException {
if (currentBlock.getType() == BlockType.OBJECT) {
throw new IOException("Unnamed JSON elements can only be created in JSON arrays");
}
@ -256,7 +256,7 @@ public class JsonLikeParserDstu3Test {
}
@Override
public JsonLikeWriter write(double value) throws IOException {
public BaseJsonLikeWriter write(double value) throws IOException {
if (currentBlock.getType() == BlockType.OBJECT) {
throw new IOException("Unnamed JSON elements can only be created in JSON arrays");
}
@ -265,7 +265,7 @@ public class JsonLikeParserDstu3Test {
}
@Override
public JsonLikeWriter write(Boolean value) throws IOException {
public BaseJsonLikeWriter write(Boolean value) throws IOException {
if (currentBlock.getType() == BlockType.OBJECT) {
throw new IOException("Unnamed JSON elements can only be created in JSON arrays");
}
@ -274,7 +274,7 @@ public class JsonLikeParserDstu3Test {
}
@Override
public JsonLikeWriter write(boolean value) throws IOException {
public BaseJsonLikeWriter write(boolean value) throws IOException {
if (currentBlock.getType() == BlockType.OBJECT) {
throw new IOException("Unnamed JSON elements can only be created in JSON arrays");
}
@ -283,7 +283,7 @@ public class JsonLikeParserDstu3Test {
}
@Override
public JsonLikeWriter writeNull() throws IOException {
public BaseJsonLikeWriter writeNull() throws IOException {
if (currentBlock.getType() == BlockType.OBJECT) {
throw new IOException("Unnamed JSON elements can only be created in JSON arrays");
}
@ -292,7 +292,7 @@ public class JsonLikeParserDstu3Test {
}
@Override
public JsonLikeWriter write(String name, String value) throws IOException {
public BaseJsonLikeWriter write(String name, String value) throws IOException {
if (currentBlock.getType() == BlockType.ARRAY) {
throw new IOException("Named JSON elements can only be created in JSON objects");
}
@ -301,7 +301,7 @@ public class JsonLikeParserDstu3Test {
}
@Override
public JsonLikeWriter write(String name, BigInteger value) throws IOException {
public BaseJsonLikeWriter write(String name, BigInteger value) throws IOException {
if (currentBlock.getType() == BlockType.ARRAY) {
throw new IOException("Named JSON elements can only be created in JSON objects");
}
@ -309,7 +309,7 @@ public class JsonLikeParserDstu3Test {
return this;
}
@Override
public JsonLikeWriter write(String name, BigDecimal value) throws IOException {
public BaseJsonLikeWriter write(String name, BigDecimal value) throws IOException {
if (currentBlock.getType() == BlockType.ARRAY) {
throw new IOException("Named JSON elements can only be created in JSON objects");
}
@ -318,7 +318,7 @@ public class JsonLikeParserDstu3Test {
}
@Override
public JsonLikeWriter write(String name, long value) throws IOException {
public BaseJsonLikeWriter write(String name, long value) throws IOException {
if (currentBlock.getType() == BlockType.ARRAY) {
throw new IOException("Named JSON elements can only be created in JSON objects");
}
@ -327,7 +327,7 @@ public class JsonLikeParserDstu3Test {
}
@Override
public JsonLikeWriter write(String name, double value) throws IOException {
public BaseJsonLikeWriter write(String name, double value) throws IOException {
if (currentBlock.getType() == BlockType.ARRAY) {
throw new IOException("Named JSON elements can only be created in JSON objects");
}
@ -336,7 +336,7 @@ public class JsonLikeParserDstu3Test {
}
@Override
public JsonLikeWriter write(String name, Boolean value) throws IOException {
public BaseJsonLikeWriter write(String name, Boolean value) throws IOException {
if (currentBlock.getType() == BlockType.ARRAY) {
throw new IOException("Named JSON elements can only be created in JSON objects");
}
@ -345,7 +345,7 @@ public class JsonLikeParserDstu3Test {
}
@Override
public JsonLikeWriter write(String name, boolean value) throws IOException {
public BaseJsonLikeWriter write(String name, boolean value) throws IOException {
if (currentBlock.getType() == BlockType.ARRAY) {
throw new IOException("Named JSON elements can only be created in JSON objects");
}
@ -354,7 +354,7 @@ public class JsonLikeParserDstu3Test {
}
@Override
public JsonLikeWriter endObject() throws IOException {
public BaseJsonLikeWriter endObject() throws IOException {
if (currentBlock.getType() == BlockType.NONE) {
ourLog.error("JsonLikeStreamWriter.endObject(); called with no active JSON document");
} else {
@ -367,7 +367,7 @@ public class JsonLikeParserDstu3Test {
}
@Override
public JsonLikeWriter endArray() throws IOException {
public BaseJsonLikeWriter endArray() throws IOException {
if (currentBlock.getType() == BlockType.NONE) {
ourLog.error("JsonLikeStreamWriter.endArray(); called with no active JSON document");
} else {
@ -380,7 +380,7 @@ public class JsonLikeParserDstu3Test {
}
@Override
public JsonLikeWriter endBlock() {
public BaseJsonLikeWriter endBlock() {
if (currentBlock.getType() == BlockType.NONE) {
ourLog.error("JsonLikeStreamWriter.endBlock(); called with no active JSON document");
} else {

View File

@ -3,11 +3,11 @@ package ca.uhn.fhir.parser.jsonlike;
import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.parser.DataFormatException;
import ca.uhn.fhir.parser.IJsonLikeParser;
import ca.uhn.fhir.parser.json.JsonLikeArray;
import ca.uhn.fhir.parser.json.JsonLikeObject;
import ca.uhn.fhir.parser.json.BaseJsonLikeArray;
import ca.uhn.fhir.parser.json.BaseJsonLikeObject;
import ca.uhn.fhir.parser.json.BaseJsonLikeValue;
import ca.uhn.fhir.parser.json.BaseJsonLikeWriter;
import ca.uhn.fhir.parser.json.JsonLikeStructure;
import ca.uhn.fhir.parser.json.JsonLikeValue;
import ca.uhn.fhir.parser.json.JsonLikeWriter;
import ca.uhn.fhir.parser.json.jackson.JacksonStructure;
import ca.uhn.fhir.parser.view.ExtPatient;
import ca.uhn.fhir.util.TestUtil;
@ -159,7 +159,7 @@ public class JsonLikeParserTest {
public static class JsonLikeMapWriter extends JsonLikeWriter {
public static class JsonLikeMapWriter extends BaseJsonLikeWriter {
private Map<String,Object> target;
@ -211,7 +211,7 @@ public class JsonLikeParserTest {
}
@Override
public JsonLikeWriter init() {
public BaseJsonLikeWriter init() {
if (target != null) {
target.clear();
}
@ -221,7 +221,7 @@ public class JsonLikeParserTest {
}
@Override
public JsonLikeWriter flush() throws IOException {
public BaseJsonLikeWriter flush() throws IOException {
if (currentBlock.getType() != BlockType.NONE) {
throw new IOException("JsonLikeStreamWriter.flush() called but JSON document is not finished");
}
@ -234,7 +234,7 @@ public class JsonLikeParserTest {
}
@Override
public JsonLikeWriter beginObject() throws IOException {
public BaseJsonLikeWriter beginObject() throws IOException {
if (currentBlock.getType() == BlockType.OBJECT) {
throw new IOException("Unnamed JSON elements can only be created in JSON arrays");
}
@ -258,7 +258,7 @@ public class JsonLikeParserTest {
}
@Override
public JsonLikeWriter beginObject(String name) throws IOException {
public BaseJsonLikeWriter beginObject(String name) throws IOException {
if (currentBlock.getType() == BlockType.ARRAY) {
throw new IOException("Named JSON elements can only be created in JSON objects");
}
@ -272,7 +272,7 @@ public class JsonLikeParserTest {
}
@Override
public JsonLikeWriter beginArray(String name) throws IOException {
public BaseJsonLikeWriter beginArray(String name) throws IOException {
if (currentBlock.getType() == BlockType.ARRAY) {
throw new IOException("Named JSON elements can only be created in JSON objects");
}
@ -284,7 +284,7 @@ public class JsonLikeParserTest {
}
@Override
public JsonLikeWriter write(String value) throws IOException {
public BaseJsonLikeWriter write(String value) throws IOException {
if (currentBlock.getType() == BlockType.OBJECT) {
throw new IOException("Unnamed JSON elements can only be created in JSON arrays");
}
@ -293,7 +293,7 @@ public class JsonLikeParserTest {
}
@Override
public JsonLikeWriter write(BigInteger value) throws IOException {
public BaseJsonLikeWriter write(BigInteger value) throws IOException {
if (currentBlock.getType() == BlockType.OBJECT) {
throw new IOException("Unnamed JSON elements can only be created in JSON arrays");
}
@ -302,7 +302,7 @@ public class JsonLikeParserTest {
}
@Override
public JsonLikeWriter write(BigDecimal value) throws IOException {
public BaseJsonLikeWriter write(BigDecimal value) throws IOException {
if (currentBlock.getType() == BlockType.OBJECT) {
throw new IOException("Unnamed JSON elements can only be created in JSON arrays");
}
@ -311,7 +311,7 @@ public class JsonLikeParserTest {
}
@Override
public JsonLikeWriter write(long value) throws IOException {
public BaseJsonLikeWriter write(long value) throws IOException {
if (currentBlock.getType() == BlockType.OBJECT) {
throw new IOException("Unnamed JSON elements can only be created in JSON arrays");
}
@ -320,7 +320,7 @@ public class JsonLikeParserTest {
}
@Override
public JsonLikeWriter write(double value) throws IOException {
public BaseJsonLikeWriter write(double value) throws IOException {
if (currentBlock.getType() == BlockType.OBJECT) {
throw new IOException("Unnamed JSON elements can only be created in JSON arrays");
}
@ -329,7 +329,7 @@ public class JsonLikeParserTest {
}
@Override
public JsonLikeWriter write(Boolean value) throws IOException {
public BaseJsonLikeWriter write(Boolean value) throws IOException {
if (currentBlock.getType() == BlockType.OBJECT) {
throw new IOException("Unnamed JSON elements can only be created in JSON arrays");
}
@ -338,7 +338,7 @@ public class JsonLikeParserTest {
}
@Override
public JsonLikeWriter write(boolean value) throws IOException {
public BaseJsonLikeWriter write(boolean value) throws IOException {
if (currentBlock.getType() == BlockType.OBJECT) {
throw new IOException("Unnamed JSON elements can only be created in JSON arrays");
}
@ -347,7 +347,7 @@ public class JsonLikeParserTest {
}
@Override
public JsonLikeWriter writeNull() throws IOException {
public BaseJsonLikeWriter writeNull() throws IOException {
if (currentBlock.getType() == BlockType.OBJECT) {
throw new IOException("Unnamed JSON elements can only be created in JSON arrays");
}
@ -356,7 +356,7 @@ public class JsonLikeParserTest {
}
@Override
public JsonLikeWriter write(String name, String value) throws IOException {
public BaseJsonLikeWriter write(String name, String value) throws IOException {
if (currentBlock.getType() == BlockType.ARRAY) {
throw new IOException("Named JSON elements can only be created in JSON objects");
}
@ -365,7 +365,7 @@ public class JsonLikeParserTest {
}
@Override
public JsonLikeWriter write(String name, BigInteger value) throws IOException {
public BaseJsonLikeWriter write(String name, BigInteger value) throws IOException {
if (currentBlock.getType() == BlockType.ARRAY) {
throw new IOException("Named JSON elements can only be created in JSON objects");
}
@ -373,7 +373,7 @@ public class JsonLikeParserTest {
return this;
}
@Override
public JsonLikeWriter write(String name, BigDecimal value) throws IOException {
public BaseJsonLikeWriter write(String name, BigDecimal value) throws IOException {
if (currentBlock.getType() == BlockType.ARRAY) {
throw new IOException("Named JSON elements can only be created in JSON objects");
}
@ -382,7 +382,7 @@ public class JsonLikeParserTest {
}
@Override
public JsonLikeWriter write(String name, long value) throws IOException {
public BaseJsonLikeWriter write(String name, long value) throws IOException {
if (currentBlock.getType() == BlockType.ARRAY) {
throw new IOException("Named JSON elements can only be created in JSON objects");
}
@ -391,7 +391,7 @@ public class JsonLikeParserTest {
}
@Override
public JsonLikeWriter write(String name, double value) throws IOException {
public BaseJsonLikeWriter write(String name, double value) throws IOException {
if (currentBlock.getType() == BlockType.ARRAY) {
throw new IOException("Named JSON elements can only be created in JSON objects");
}
@ -400,7 +400,7 @@ public class JsonLikeParserTest {
}
@Override
public JsonLikeWriter write(String name, Boolean value) throws IOException {
public BaseJsonLikeWriter write(String name, Boolean value) throws IOException {
if (currentBlock.getType() == BlockType.ARRAY) {
throw new IOException("Named JSON elements can only be created in JSON objects");
}
@ -409,7 +409,7 @@ public class JsonLikeParserTest {
}
@Override
public JsonLikeWriter write(String name, boolean value) throws IOException {
public BaseJsonLikeWriter write(String name, boolean value) throws IOException {
if (currentBlock.getType() == BlockType.ARRAY) {
throw new IOException("Named JSON elements can only be created in JSON objects");
}
@ -418,7 +418,7 @@ public class JsonLikeParserTest {
}
@Override
public JsonLikeWriter endObject() throws IOException {
public BaseJsonLikeWriter endObject() throws IOException {
if (currentBlock.getType() == BlockType.NONE) {
ourLog.error("JsonLikeStreamWriter.endObject(); called with no active JSON document");
} else {
@ -431,7 +431,7 @@ public class JsonLikeParserTest {
}
@Override
public JsonLikeWriter endArray() {
public BaseJsonLikeWriter endArray() {
if (currentBlock.getType() == BlockType.NONE) {
ourLog.error("JsonLikeStreamWriter.endArray(); called with no active JSON document");
} else {
@ -444,7 +444,7 @@ public class JsonLikeParserTest {
}
@Override
public JsonLikeWriter endBlock() {
public BaseJsonLikeWriter endBlock() {
if (currentBlock.getType() == BlockType.NONE) {
ourLog.error("JsonLikeStreamWriter.endBlock(); called with no active JSON document");
} else {
@ -471,7 +471,7 @@ public class JsonLikeParserTest {
public static class JsonLikeMapStructure implements JsonLikeStructure {
private Map<String,Object> nativeObject;
private JsonLikeObject jsonLikeObject = null;
private BaseJsonLikeObject jsonLikeObject = null;
private JsonLikeMapWriter jsonLikeWriter = null;
public JsonLikeMapStructure() {
@ -493,12 +493,12 @@ public class JsonLikeParserTest {
}
@Override
public JsonLikeWriter getJsonLikeWriter (Writer ignored) {
public BaseJsonLikeWriter getJsonLikeWriter (Writer ignored) {
return getJsonLikeWriter();
}
@Override
public JsonLikeWriter getJsonLikeWriter () {
public BaseJsonLikeWriter getJsonLikeWriter () {
if (null == jsonLikeWriter) {
jsonLikeWriter = new JsonLikeMapWriter();
}
@ -516,16 +516,16 @@ public class JsonLikeParserTest {
}
@Override
public JsonLikeObject getRootObject() {
public BaseJsonLikeObject getRootObject() {
if (null == jsonLikeObject) {
jsonLikeObject = new JsonMapObject(nativeObject);
}
return jsonLikeObject;
}
private class JsonMapObject extends JsonLikeObject {
private class JsonMapObject extends BaseJsonLikeObject {
private Map<String,Object> nativeObject;
private Map<String,JsonLikeValue> jsonLikeMap = new LinkedHashMap<>();
private Map<String, BaseJsonLikeValue> jsonLikeMap = new LinkedHashMap<>();
public JsonMapObject (Map<String,Object> json) {
this.nativeObject = json;
@ -542,8 +542,8 @@ public class JsonLikeParserTest {
}
@Override
public JsonLikeValue get(String key) {
JsonLikeValue result = null;
public BaseJsonLikeValue get(String key) {
BaseJsonLikeValue result = null;
if (jsonLikeMap.containsKey(key)) {
result = jsonLikeMap.get(key);
} else {
@ -557,9 +557,9 @@ public class JsonLikeParserTest {
}
}
private class JsonMapArray extends JsonLikeArray {
private class JsonMapArray extends BaseJsonLikeArray {
private List<Object> nativeArray;
private Map<Integer,JsonLikeValue> jsonLikeMap = new LinkedHashMap<>();
private Map<Integer, BaseJsonLikeValue> jsonLikeMap = new LinkedHashMap<>();
public JsonMapArray (List<Object> json) {
this.nativeArray = json;
@ -576,9 +576,9 @@ public class JsonLikeParserTest {
}
@Override
public JsonLikeValue get(int index) {
public BaseJsonLikeValue get(int index) {
Integer key = index;
JsonLikeValue result = null;
BaseJsonLikeValue result = null;
if (jsonLikeMap.containsKey(key)) {
result = jsonLikeMap.get(key);
} else {
@ -592,10 +592,10 @@ public class JsonLikeParserTest {
}
}
private class JsonMapValue extends JsonLikeValue {
private class JsonMapValue extends BaseJsonLikeValue {
private Object nativeValue;
private JsonLikeObject jsonLikeObject = null;
private JsonLikeArray jsonLikeArray = null;
private BaseJsonLikeObject jsonLikeObject = null;
private BaseJsonLikeArray jsonLikeArray = null;
public JsonMapValue (Object json) {
this.nativeValue = json;
@ -636,7 +636,7 @@ public class JsonLikeParserTest {
@SuppressWarnings("unchecked")
@Override
public JsonLikeArray getAsArray() {
public BaseJsonLikeArray getAsArray() {
if (nativeValue != null && isArray()) {
if (null == jsonLikeArray) {
jsonLikeArray = new JsonMapArray((List<Object>)nativeValue);
@ -647,7 +647,7 @@ public class JsonLikeParserTest {
@SuppressWarnings("unchecked")
@Override
public JsonLikeObject getAsObject() {
public BaseJsonLikeObject getAsObject() {
if (nativeValue != null && isObject()) {
if (null == jsonLikeObject) {
jsonLikeObject = new JsonMapObject((Map<String,Object>)nativeValue);

View File

@ -34,7 +34,7 @@ import org.junit.jupiter.params.provider.Arguments;
import java.util.stream.Stream;
public class BaseFhirVersionParameterizedTest {
public abstract class BaseFhirVersionParameterizedTest {
@RegisterExtension
public final RestServerR4Helper myRestServerR4Helper = new RestServerR4Helper(true);

View File

@ -28,7 +28,7 @@ import org.hl7.fhir.instance.model.api.IBaseResource;
import java.io.IOException;
public class BaseTest {
public abstract class BaseTest {
static {
ToStringBuilder.setDefaultStyle(ToStringStyle.SHORT_PREFIX_STYLE);

View File

@ -19,7 +19,7 @@ import java.util.List;
*
* @since 5.0.0
*/
public class BaseValidationSupportWrapper extends BaseValidationSupport {
public abstract class BaseValidationSupportWrapper extends BaseValidationSupport {
private final IValidationSupport myWrap;
/**

View File

@ -7,11 +7,17 @@
<property name="charset" value="UTF-8"/>
<property name="cacheFile" value="target/cache_non_main_files"/>
<module name="SuppressionFilter">
<property name="file" value="src/checkstyle/checkstyle_suppressions.xml" />
</module>
<module name="TreeWalker">
<module name="RegexpSinglelineJava">
<property name="format" value="System\.out\.println"/>
<property name="ignoreComments" value="true"/>
</module>
<module name="AbstractClassName">
<property name="format" value="^(Base|Abstract).+$"/>
</module>
</module>
<!--

View File

@ -0,0 +1,19 @@
<?xml version="1.0"?>
<!DOCTYPE suppressions PUBLIC
"-//Puppy Crawl//DTD Suppressions 1.1//EN"
"http://www.puppycrawl.com/dtds/suppressions_1_1.dtd">
<suppressions>
<!-- Name suppressions -->
<suppress files="Base64BinaryDt\.java" checks="AbstractClassName"/>
<!-- TODO KHS cdr instantiates these. Remove them once cdr has been fixed. -->
<suppress files="BaseMigrationTasks\.java" checks="AbstractClassName"/>
<suppress files="BaseLoincTop2000LabResultsHandler\.java" checks="AbstractClassName"/>
<!-- Missing "Base" prefix suppressions -->
<suppress files="ResourceMetadataKeyEnum\.java" checks="AbstractClassName"/>
<suppress files="RequestDetails\.java" checks="AbstractClassName"/>
<suppress files="RestfulClientFactory\.java" checks="AbstractClassName"/>
<suppress files="MatchUrlService\.java" checks="AbstractClassName"/>
</suppressions>