001/*-
002 * #%L
003 * HAPI FHIR Storage api
004 * %%
005 * Copyright (C) 2014 - 2025 Smile CDR, Inc.
006 * %%
007 * Licensed under the Apache License, Version 2.0 (the "License");
008 * you may not use this file except in compliance with the License.
009 * You may obtain a copy of the License at
010 *
011 *      http://www.apache.org/licenses/LICENSE-2.0
012 *
013 * Unless required by applicable law or agreed to in writing, software
014 * distributed under the License is distributed on an "AS IS" BASIS,
015 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
016 * See the License for the specific language governing permissions and
017 * limitations under the License.
018 * #L%
019 */
020package ca.uhn.fhir.jpa.patch;
021
022import ca.uhn.fhir.context.BaseRuntimeChildDefinition;
023import ca.uhn.fhir.context.BaseRuntimeElementDefinition;
024import org.hl7.fhir.instance.model.api.IBase;
025
026/**
027 * A helper object to hold the child definitions along a provided fhir path
028 */
029public class FhirPathChildDefinition {
030        // our parent element; if null, this is the top level element
031        private IBase myBase;
032
033        private BaseRuntimeChildDefinition myBaseRuntimeDefinition;
034
035        private BaseRuntimeElementDefinition<?> myElementDefinition;
036
037        private String myFhirPath;
038
039        private FhirPathChildDefinition myChild;
040
041        private FhirPathChildDefinition myParent;
042
043        public IBase getBase() {
044                return myBase;
045        }
046
047        public void setBase(IBase theBase) {
048                myBase = theBase;
049        }
050
051        public BaseRuntimeChildDefinition getBaseRuntimeDefinition() {
052                return myBaseRuntimeDefinition;
053        }
054
055        public void setBaseRuntimeDefinition(BaseRuntimeChildDefinition theChildDefinition) {
056                myBaseRuntimeDefinition = theChildDefinition;
057        }
058
059        public BaseRuntimeElementDefinition<?> getElementDefinition() {
060                return myElementDefinition;
061        }
062
063        public void setElementDefinition(BaseRuntimeElementDefinition<?> theElementDefinition) {
064                myElementDefinition = theElementDefinition;
065        }
066
067        public String getFhirPath() {
068                return myFhirPath;
069        }
070
071        public void setFhirPath(String theFhirPath) {
072                myFhirPath = theFhirPath;
073        }
074
075        public FhirPathChildDefinition getChild() {
076                return myChild;
077        }
078
079        public void setChild(FhirPathChildDefinition theChild) {
080                myChild = theChild;
081                if (myChild != null) {
082                        myChild.setParent(this);
083                }
084        }
085
086        public FhirPathChildDefinition getParent() {
087                return myParent;
088        }
089
090        public void setParent(FhirPathChildDefinition theParent) {
091                myParent = theParent;
092        }
093}