
Package ca.uhn.fhir.model.primitive
Class XhtmlDt
- All Implemented Interfaces:
IDatatype,IElement,IIdentifiableElement,IPrimitiveDatatype<String>,ISupportsUndeclaredExtensions,Externalizable,Serializable,IBase,IBaseDatatype,IPrimitiveType<String>
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.- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringSubclasses must override to convert a "coerced" value into an encoded one.getValue()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.booleanbooleanisEmpty()protected StringSubclasses must override to convert an encoded representation of this datatype into a "coerced" onestatic StringNote 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.voidsetValueAsString(String theValue) Accepts a textual DIV and parses it into XHTML events which are stored internally.Methods inherited from class ca.uhn.fhir.model.api.BasePrimitive
equals, getValueAsString, hashCode, hasValue, readExternal, toString, updateStringValue, writeExternalMethods inherited from class ca.uhn.fhir.model.api.BaseIdentifiableElement
getElementSpecificId, getId, setElementSpecificId, setId, setIdMethods inherited from class ca.uhn.fhir.model.api.BaseElement
addUndeclaredExtension, addUndeclaredExtension, addUndeclaredExtension, getAllUndeclaredExtensions, getFormatCommentsPost, getFormatCommentsPre, getUndeclaredExtensions, getUndeclaredExtensionsByUrl, getUndeclaredModifierExtensions, getUserData, hasFormatComment, isBaseEmpty, setUserDataMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.hl7.fhir.instance.model.api.IBase
fhirType, getFormatCommentsPost, getFormatCommentsPre, getUserData, hasFormatComment, setUserData
-
Field Details
-
DIV_OPEN_FIRST
- See Also:
-
-
Constructor Details
-
XhtmlDt
public XhtmlDt()Constructor -
XhtmlDt
Constructor which accepts a string code- See Also:
-
-
Method Details
-
encode
Description copied from class:BasePrimitiveSubclasses must override to convert a "coerced" value into an encoded one.- Specified by:
encodein classBasePrimitive<String>- Parameters:
theValue- Will not be null- Returns:
- May return null if the value does not correspond to anything
-
hasContent
-
isEmpty
- Specified by:
isEmptyin interfaceIBase- Overrides:
isEmptyin classBasePrimitive<String>
-
parse
Description copied from class:BasePrimitiveSubclasses must override to convert an encoded representation of this datatype into a "coerced" one- Specified by:
parsein classBasePrimitive<String>- Parameters:
theValue- Will not be null- Returns:
- May return null if the value does not correspond to anything
-
getValue
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 theXmlUtil.parse(String)andXmlUtil.encode(List)methods to do so.- Specified by:
getValuein interfaceIPrimitiveDatatype<String>- Specified by:
getValuein interfaceIPrimitiveType<String>- Overrides:
getValuein classBasePrimitive<String>
-
setValue
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 theXmlUtil.parse(String)andXmlUtil.encode(List)methods to do so.- Specified by:
setValuein interfaceIPrimitiveDatatype<String>- Specified by:
setValuein interfaceIPrimitiveType<String>- Overrides:
setValuein classBasePrimitive<String>- Throws:
DataFormatException
-
setValueAsString
Accepts a textual DIV and parses it into XHTML events which are stored internally.Formatting note: The text will be trimmed
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.Also note that if the parsed text contains any entities (&foo;) which are not a part of the entities defined in core XML (e.g. § which is valid in XHTML 1.0 but not in XML 1.0) they will be parsed and converted to their equivalent unicode character.
- Specified by:
setValueAsStringin interfaceIPrimitiveDatatype<String>- Specified by:
setValueAsStringin interfaceIPrimitiveType<String>- Overrides:
setValueAsStringin classBasePrimitive<String>- Throws:
DataFormatException
-
preprocessXhtmlNamespaceDeclaration
-