Package ca.uhn.fhir.model.api

Examples of ca.uhn.fhir.model.api.IElement


        theEventWriter.writeEnd();
      }
    }

    private void writeUndeclaredExt(RuntimeResourceDefinition theResDef, IResource theResource, JsonGenerator theEventWriter, ExtensionDt ext) throws IOException {
      IElement value = ext.getValue();

      theEventWriter.writeStartObject();
      theEventWriter.write("url", ext.getUrl().getValue());

      boolean noValue = value == null || value.isEmpty();
      if (noValue && ext.getAllUndeclaredExtensions().isEmpty()) {
        ourLog.debug("Extension with URL[{}] has no value", ext.getUrl().getValue());
      } else if (noValue) {
        theEventWriter.writeStartArray("extension");
        for (ExtensionDt next : ext.getUndeclaredExtensions()) {
          writeUndeclaredExt(theResDef, theResource, theEventWriter, next);
        }
        theEventWriter.writeEnd();
      } else {
        RuntimeChildUndeclaredExtensionDefinition extDef = myContext.getRuntimeChildUndeclaredExtensionDefinition();
        String childName = extDef.getChildNameByDatatype(value.getClass());
        if (childName == null) {
          throw new ConfigurationException("Unable to encode extension, unregognized child element type: " + value.getClass().getCanonicalName());
        }
        BaseRuntimeElementDefinition<?> childDef = extDef.getChildElementDefinitionByDatatype(value.getClass());
        encodeChildElementToStreamWriter(theResDef, theResource, theEventWriter, value, childDef, childName);
      }

      // theEventWriter.name(myUndeclaredExtension.get);
View Full Code Here

TOP

Related Classes of ca.uhn.fhir.model.api.IElement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.