ca.uhn.fhir.model.primitive.XhtmlDt类的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(5.9k)|赞(0)|评价(0)|浏览(136)

本文整理了Java中ca.uhn.fhir.model.primitive.XhtmlDt类的一些代码示例,展示了XhtmlDt类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XhtmlDt类的具体详情如下:
包路径:ca.uhn.fhir.model.primitive.XhtmlDt
类名称:XhtmlDt

XhtmlDt介绍

[英]Note that as of HAPI FHIR 3.1.0, this method no longer uses the StAX XMLEvent type as the XML representation, and uses a String instead. If you need to work with XML as StAX events, you can use the XmlUtil#parse(String) and XmlUtil#encode(List)methods to do so.
[中]请注意,从HAPI FHIR 3.1.0开始,此方法不再使用StAX XMLEvent类型作为XML表示,而是使用字符串。如果需要将XML用作StAX事件,可以使用XmlUtil#parse(String)和XmlUtil#encode(List)方法。

代码示例

代码示例来源:origin: jamesagnew/hapi-fhir

/**
 * 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);
}

代码示例来源:origin: jamesagnew/hapi-fhir

@Override
public String getDivAsString() {
  return getDiv().getValueAsString();
}

代码示例来源:origin: jamesagnew/hapi-fhir

public boolean hasContent() {
  return isNotBlank(getValue());
}

代码示例来源:origin: jamesagnew/hapi-fhir

if (dt.hasContent()) {
  encodeXhtml(dt, theEventWriter);
if (!dt.isEmpty()) {
  XhtmlDt hdt = new XhtmlDt();
  hdt.setValueAsString(dt.getValueAsString());
  encodeXhtml(hdt, theEventWriter);

代码示例来源:origin: jamesagnew/hapi-fhir

/**
 * Accepts a textual DIV and parses it into XHTML events which are stored internally.
 * <p>
 * <b>Formatting note:</b> The text will be trimmed {@link String#trim()}. If the text does not start with an HTML tag (generally this would be a div tag), a div tag will be automatically placed
 * surrounding the text.
 * </p>
 * <p>
 * Also note that if the parsed text contains any entities (&amp;foo;) which are not a part of the entities defined in core XML (e.g. &amp;sect; which is valid in XHTML 1.0 but not in XML 1.0) they
 * will be parsed and converted to their equivalent unicode character.
 * </p>
 */
@Override
public void setValueAsString(String theValue) throws DataFormatException {
  if (theValue == null || theValue.isEmpty()) {
    super.setValueAsString(null);
  } else {
    String value = theValue.trim();
    value = preprocessXhtmlNamespaceDeclaration(value);
    super.setValueAsString(value);
  }
}

代码示例来源:origin: jamesagnew/hapi-fhir

@Override
public void setDivAsString(String theString)  {
  getDiv().setValueAsString(theString);
}

代码示例来源:origin: ca.uhn.hapi.fhir/hapi-fhir-base

if (dt.hasContent()) {
  encodeXhtml(dt, theEventWriter);
if (!dt.isEmpty()) {
  XhtmlDt hdt = new XhtmlDt();
  hdt.setValueAsString(dt.getValueAsString());
  encodeXhtml(hdt, theEventWriter);

代码示例来源:origin: jamesagnew/hapi-fhir

val = XhtmlDt.preprocessXhtmlNamespaceDeclaration(val);

代码示例来源:origin: jamesagnew/hapi-fhir

/**
 * Constructor which accepts a string code
 *
 * @see #setValueAsString(String) for a description of how this value is applied
 */
@SimpleSetter()
public XhtmlDt(@SimpleSetter.Parameter(name = "theTextDiv") String theTextDiv) {
  setValueAsString(theTextDiv);
}

代码示例来源:origin: jamesagnew/hapi-fhir

/**
 * Gets the value(s) for <b>div</b> (Limited xhtml content).
 * creating it if it does
 * not exist. Will not return <code>null</code>.
 *
 * <p>
 * <b>Definition:</b>
 * The actual narrative content, a stripped down version of XHTML
 * </p> 
 */
public XhtmlDt getDiv() {  
  if (myDiv == null) {
    myDiv = new XhtmlDt();
  }
  return myDiv;
}

代码示例来源:origin: ca.uhn.hapi.fhir/hapi-fhir-base

@Override
public String getDivAsString() {
  return getDiv().getValueAsString();
}

代码示例来源:origin: jamesagnew/hapi-fhir

@Override
public boolean isEmpty() {
  return super.isBaseEmpty() && (getValue() == null || getValue().isEmpty());
}

代码示例来源:origin: jamesagnew/hapi-fhir

@Override
public String getValueAsString() {
 if (isEmpty()) {
  return null;
 }
 try {
  String retVal = new XhtmlComposer(XhtmlComposer.HTML).compose(this);
  retVal = XhtmlDt.preprocessXhtmlNamespaceDeclaration(retVal);
  return retVal;
 } catch (Exception e) {
  // TODO: composer shouldn't throw exception like this
  throw new RuntimeException(e);
 }
}

代码示例来源:origin: jamesagnew/hapi-fhir

((IResource) input).getText().getDiv().setValueAsString((String) null);
((IResource) input).getText().getStatus().setValueAsString((String) null);
if (input instanceof Bundle) {
  for (Entry nextEntry : ((Bundle) input).getEntry()) {
    if (nextEntry.getResource() != null) {
      nextEntry.getResource().getText().getDiv().setValueAsString((String) null);
      nextEntry.getResource().getText().getStatus().setValueAsString((String) null);

代码示例来源:origin: ca.uhn.hapi.fhir/hapi-fhir-structures-dstu2

/**
 * 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);
}

代码示例来源:origin: jamesagnew/hapi-fhir

writer.append(((IResource) theResource).getText().getDiv().getValueAsString());
} else if (encodingDomainResourceAsText && theResource instanceof IDomainResource) {

代码示例来源:origin: jamesagnew/hapi-fhir

private void encodeXhtml(XhtmlDt theDt, XMLStreamWriter theEventWriter) throws XMLStreamException {
  if (theDt == null || theDt.getValue() == null) {
    return;
  List<XMLEvent> events = XmlUtil.parse(theDt.getValue());
  boolean firstElement = true;

代码示例来源:origin: ca.uhn.hapi.fhir/hapi-fhir-base

/**
 * Accepts a textual DIV and parses it into XHTML events which are stored internally.
 * <p>
 * <b>Formatting note:</b> The text will be trimmed {@link String#trim()}. If the text does not start with an HTML tag (generally this would be a div tag), a div tag will be automatically placed
 * surrounding the text.
 * </p>
 * <p>
 * Also note that if the parsed text contains any entities (&amp;foo;) which are not a part of the entities defined in core XML (e.g. &amp;sect; which is valid in XHTML 1.0 but not in XML 1.0) they
 * will be parsed and converted to their equivalent unicode character.
 * </p>
 */
@Override
public void setValueAsString(String theValue) throws DataFormatException {
  if (theValue == null || theValue.isEmpty()) {
    super.setValueAsString(null);
  } else {
    String value = theValue.trim();
    value = preprocessXhtmlNamespaceDeclaration(value);
    super.setValueAsString(value);
  }
}

代码示例来源:origin: ca.uhn.hapi.fhir/hapi-fhir-base

@Override
public void setDivAsString(String theString)  {
  getDiv().setValueAsString(theString);
}

代码示例来源:origin: ca.uhn.hapi.fhir/hapi-fhir-structures-dstu

/**
 * 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);
}

相关文章