Examples of XhtmlDt


Examples of ca.uhn.fhir.model.primitive.XhtmlDt

     * The actual narrative content, a stripped down version of XHTML
     * </p>
   */
  public XhtmlDt getDiv() { 
    if (myDiv == null) {
      myDiv = new XhtmlDt();
    }
    return myDiv;
  }
View Full Code Here

Examples of ca.uhn.fhir.model.primitive.XhtmlDt

  /**
   * Sets the value using a textual DIV (or simple text block which will be
   * converted to XHTML)
   */
  public void setDiv(String theTextDiv) {
    myDiv = new XhtmlDt(theTextDiv);
  }
View Full Code Here

Examples of ca.uhn.fhir.model.primitive.XhtmlDt

      theWriter.writeEnd();
      break;
    }
    case PRIMITIVE_XHTML: {
      if (!getSuppressNarratives()) {
        XhtmlDt dt = (XhtmlDt) theValue;
        if (theChildName != null) {
          theWriter.write(theChildName, dt.getValueAsString());
        } else {
          theWriter.write(dt.getValueAsString());
        }
      } else {
        if (theChildName != null) {
          // do nothing
        } else {
View Full Code Here

Examples of ca.uhn.fhir.model.primitive.XhtmlDt

    }
    case RESOURCE: {
      throw new IllegalStateException(); // should not happen
    }
    case PRIMITIVE_XHTML: {
      XhtmlDt dt = (XhtmlDt) nextValue;
      if (dt.hasContent()) {
        encodeXhtml(dt, theEventWriter);
      }
      break;
    }
    case EXTENSION_DECLARED:
View Full Code Here

Examples of ca.uhn.fhir.model.primitive.XhtmlDt

        push(newState);
        return;
      }
      case PRIMITIVE_XHTML: {
        RuntimePrimitiveDatatypeNarrativeDefinition xhtmlTarget = (RuntimePrimitiveDatatypeNarrativeDefinition) target;
        XhtmlDt newDt = xhtmlTarget.newInstance();
        child.getMutator().addValue(myInstance, newDt);
        XhtmlState state = new XhtmlState(getPreResourceState(), newDt, true);
        push(state);
        return;
      }
View Full Code Here

Examples of ca.uhn.fhir.model.primitive.XhtmlDt

    return myResource;
  }

  public XhtmlDt getSummary() {
    if (mySummary == null) {
      mySummary = new XhtmlDt();
    }
    return mySummary;
  }
View Full Code Here

Examples of ca.uhn.fhir.model.primitive.XhtmlDt

     * The actual narrative content, a stripped down version of XHTML
     * </p>
   */
  public XhtmlDt getDiv() { 
    if (myDiv == null) {
      myDiv = new XhtmlDt();
    }
    return myDiv;
  }
View Full Code Here

Examples of ca.uhn.fhir.model.primitive.XhtmlDt

  /**
   * Sets the value using a textual DIV (or simple text block which will be
   * converted to XHTML)
   */
  public void setDiv(String theTextDiv) {
    myDiv = new XhtmlDt(theTextDiv);
  }
View Full Code Here

Examples of ca.uhn.fhir.model.primitive.XhtmlDt

    }

    if (name == null) {
      if (myIgnoreMissingTemplates) {
        ourLog.debug("No narrative template available for profile: {}", theProfile);
        return new NarrativeDt(new XhtmlDt("<div>No narrative template available for resource profile: " + theProfile + "</div>"), NarrativeStatusEnum.EMPTY);
      } else {
        throw new DataFormatException("No narrative template for class " + theResource.getClass().getCanonicalName());
      }
    }

    try {
      Context context = new Context();
      context.setVariable("resource", theResource);

      String result = myProfileTemplateEngine.process(name, context);

      if (myCleanWhitespace) {
        ourLog.trace("Pre-whitespace cleaning: ", result);
        result = cleanWhitespace(result);
        ourLog.trace("Post-whitespace cleaning: ", result);
      }

      XhtmlDt div = new XhtmlDt(result);
      return new NarrativeDt(div, NarrativeStatusEnum.GENERATED);
    } catch (Exception e) {
      if (myIgnoreFailures) {
        ourLog.error("Failed to generate narrative", e);
        return new NarrativeDt(new XhtmlDt("<div>No narrative available - Error: " + e.getMessage() + "</div>"), NarrativeStatusEnum.EMPTY);
      } else {
        throw new DataFormatException(e);
      }
    }
  }
View Full Code Here

Examples of ca.uhn.fhir.model.primitive.XhtmlDt

        push(newState);
        return;
      }
      case PRIMITIVE_XHTML: {
        RuntimePrimitiveDatatypeNarrativeDefinition xhtmlTarget = (RuntimePrimitiveDatatypeNarrativeDefinition) target;
        XhtmlDt newDt = xhtmlTarget.newInstance();
        child.getMutator().addValue(myInstance, newDt);
        XhtmlState state = new XhtmlState(getPreResourceState(), newDt, true);
        push(state);
        return;
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.