
Package org.hl7.fhir.dstu3.formats
Class ParserBase
java.lang.Object
org.hl7.fhir.dstu3.formats.FormatUtilities
org.hl7.fhir.dstu3.formats.ParserBase
- All Implemented Interfaces:
IParser
- Direct Known Subclasses:
JsonParserBase,RdfParserBase,XmlParserBase
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.hl7.fhir.dstu3.formats.IParser
IParser.OutputStyle -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanWhether to throw an exception if unknown content is found (or just skip it)protected booleanprotected IParser.OutputStyleprotected StringFields inherited from class org.hl7.fhir.dstu3.formats.FormatUtilities
FHIR_NS, ID_REGEX, NS_XSI, XHTML_NS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]composeBytes(Resource resource) Compose a resource to a stream, possibly using pretty presentation for a human reader (used in the spec, for example, but not normally in production)byte[]composeBytes(Type type, String typeName) Compose a type to a stream, possibly using pretty presentation for a human reader (used in the spec, for example, but not normally in production) Not supported by all implementations. rootName is ignored in the JSON formatcomposeString(Resource resource) Compose a resource to a stream, possibly using pretty presentation for a human reader (used in the spec, for example, but not normally in production)composeString(Type type, String typeName) Compose a type to a stream, possibly using pretty presentation for a human reader (used in the spec, for example, but not normally in production) Not supported by all implementations. rootName is ignored in the JSON formatbooleanWhether to parse or ignore comments - either reading or writingWriting:booleanparse(byte[] bytes) parse content that is known to be a resourceparse content that is known to be a resourceprotected byte[]parseBase64BinaryPrimitive(String value) protected BooleanparseBooleanPrimitive(Boolean value) protected BooleanparseBooleanPrimitive(String value) protected StringparseCodePrimitive(String value) protected BigDecimalparseDecimalPrimitive(String value) protected BigDecimalparseDecimalPrimitive(BigDecimal value) protected StringparseIdPrimitive(String value) protected intparseIntegerPrimitive(Long value) protected intparseIntegerPrimitive(String value) protected StringparseOidPrimitive(String value) protected StringparseStringPrimitive(String value) protected StringparseTimePrimitive(String value) This is used to parse a type - a fragment of a resource.This is used to parse a type - a fragment of a resource.protected StringparseUriPrimitive(String value) protected StringparseUuidPrimitive(String value) setAllowUnknownContent(boolean allowUnknownContent) setHandleComments(boolean value) setSuppressXhtml(String message) This method is used by the publication tooling to stop the xhrtml narrative being generated.Methods inherited from class org.hl7.fhir.dstu3.formats.FormatUtilities
isValidId, makeId, makeParser, makeParser, toString, toString, toString, toString, toString, toString
-
Field Details
-
xhtmlMessage
-
handleComments
-
allowUnknownContent
Whether to throw an exception if unknown content is found (or just skip it) -
style
-
idMap
-
-
Constructor Details
-
ParserBase
public ParserBase()
-
-
Method Details
-
parse
Description copied from interface:IParserparse content that is known to be a resource- Specified by:
parsein interfaceIParser- Throws:
org.hl7.fhir.exceptions.FHIRFormatErrorIOException
-
parse
Description copied from interface:IParserparse content that is known to be a resource- Specified by:
parsein interfaceIParser- Throws:
org.hl7.fhir.exceptions.FHIRFormatErrorIOException
-
parseType
public Type parseType(String input, String typeName) throws org.hl7.fhir.exceptions.FHIRFormatError, IOException Description copied from interface:IParserThis is used to parse a type - a fragment of a resource. There's no reason to use this in production - it's used in the build tools Not supported by all implementations- Specified by:
parseTypein interfaceIParser- Parameters:
input-typeName- . if this is blank, the parser may try to infer the type (xml only)- Returns:
- Throws:
org.hl7.fhir.exceptions.FHIRFormatErrorIOException
-
parseType
public Type parseType(byte[] bytes, String typeName) throws org.hl7.fhir.exceptions.FHIRFormatError, IOException Description copied from interface:IParserThis is used to parse a type - a fragment of a resource. There's no reason to use this in production - it's used in the build tools Not supported by all implementations- Specified by:
parseTypein interfaceIParser- Parameters:
typeName- . if this is blank, the parser may try to infer the type (xml only)- Returns:
- Throws:
org.hl7.fhir.exceptions.FHIRFormatErrorIOException
-
composeString
Description copied from interface:IParserCompose a resource to a stream, possibly using pretty presentation for a human reader (used in the spec, for example, but not normally in production)- Specified by:
composeStringin interfaceIParser- Throws:
IOException
-
composeBytes
Description copied from interface:IParserCompose a resource to a stream, possibly using pretty presentation for a human reader (used in the spec, for example, but not normally in production)- Specified by:
composeBytesin interfaceIParser- Throws:
IOException
-
composeString
Description copied from interface:IParserCompose a type to a stream, possibly using pretty presentation for a human reader (used in the spec, for example, but not normally in production) Not supported by all implementations. rootName is ignored in the JSON format- Specified by:
composeStringin interfaceIParser- Throws:
IOException
-
composeBytes
Description copied from interface:IParserCompose a type to a stream, possibly using pretty presentation for a human reader (used in the spec, for example, but not normally in production) Not supported by all implementations. rootName is ignored in the JSON format- Specified by:
composeBytesin interfaceIParser- Throws:
IOException
-
setSuppressXhtml
Description copied from interface:IParserThis method is used by the publication tooling to stop the xhrtml narrative being generated. It is not valid to use in production use. The tooling uses it to generate json/xml representations in html that are not cluttered by escaped html representations of the html representation- Specified by:
setSuppressXhtmlin interfaceIParser
-
getHandleComments
Description copied from interface:IParserWhether to parse or ignore comments - either reading or writing- Specified by:
getHandleCommentsin interfaceIParser
-
setHandleComments
- Specified by:
setHandleCommentsin interfaceIParser
-
isAllowUnknownContent
- Specified by:
isAllowUnknownContentin interfaceIParser- Returns:
- Whether to throw an exception if unknown content is found (or just skip it)
-
setAllowUnknownContent
- Specified by:
setAllowUnknownContentin interfaceIParser- Parameters:
allowUnknownContent- Whether to throw an exception if unknown content is found (or just skip it)
-
getOutputStyle
Description copied from interface:IParserWriting:- Specified by:
getOutputStylein interfaceIParser
-
setOutputStyle
- Specified by:
setOutputStylein interfaceIParser
-
parseIntegerPrimitive
-
parseIntegerPrimitive
-
parseCodePrimitive
-
parseTimePrimitive
- Throws:
ParseException
-
parseDecimalPrimitive
-
parseDecimalPrimitive
-
parseUriPrimitive
-
parseBase64BinaryPrimitive
-
parseOidPrimitive
-
parseBooleanPrimitive
-
parseBooleanPrimitive
-
parseIdPrimitive
-
parseStringPrimitive
-
parseUuidPrimitive
-