public abstract class ParserBase extends FormatUtilities implements IParser
IParser.OutputStyle| Modifier and Type | Field and Description |
|---|---|
protected boolean |
allowComments
whether to allow comments in the json (special case for IG publisher source)
|
protected boolean |
allowUnknownContent
Whether to throw an exception if unknown content is found (or just skip it)
|
protected boolean |
handleComments |
protected Map<String,Object> |
idMap |
protected IParser.OutputStyle |
style |
protected String |
xhtmlMessage |
FHIR_NS, ID_REGEX, NS_XSI, XHTML_NS| Constructor and Description |
|---|
ParserBase() |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
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.
|
String |
composeString(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)
|
String |
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.
|
boolean |
getHandleComments()
Whether to parse or ignore comments - either reading or writing
|
IParser.OutputStyle |
getOutputStyle()
Writing:
|
boolean |
isAllowComments() |
boolean |
isAllowUnknownContent() |
Resource |
parse(byte[] bytes)
parse content that is known to be a resource
|
Resource |
parse(String input)
parse content that is known to be a resource
|
Type |
parseAnyType(byte[] bytes,
String typeName) |
Type |
parseAnyType(String input,
String typeName) |
protected byte[] |
parseBase64BinaryPrimitive(String value) |
protected Boolean |
parseBooleanPrimitive(Boolean value) |
protected Boolean |
parseBooleanPrimitive(String value) |
protected String |
parseCodePrimitive(String value) |
protected BigDecimal |
parseDecimalPrimitive(BigDecimal value) |
protected BigDecimal |
parseDecimalPrimitive(String value) |
protected String |
parseIdPrimitive(String value) |
protected int |
parseIntegerPrimitive(Long value) |
protected int |
parseIntegerPrimitive(String value) |
protected String |
parseOidPrimitive(String value) |
protected String |
parseStringPrimitive(String value) |
protected String |
parseTimePrimitive(String value) |
Type |
parseType(byte[] bytes,
String typeName)
This is used to parse a type - a fragment of a resource.
|
Type |
parseType(String input,
String typeName)
This is used to parse a type - a fragment of a resource.
|
protected String |
parseUriPrimitive(String value) |
protected String |
parseUuidPrimitive(String value) |
void |
setAllowComments(boolean allowComments) |
IParser |
setAllowUnknownContent(boolean allowUnknownContent) |
IParser |
setHandleComments(boolean value) |
IParser |
setOutputStyle(IParser.OutputStyle style) |
IParser |
setSuppressXhtml(String message)
This method is used by the publication tooling to stop the xhrtml narrative being generated.
|
determineFormat, determineFormat, isValidId, loadFile, loadFile, makeId, makeParser, makeParser, toString, toString, toString, toString, toString, toStringprotected String xhtmlMessage
protected boolean handleComments
protected boolean allowUnknownContent
protected boolean allowComments
protected IParser.OutputStyle style
public ParserBase()
public Resource parse(String input) throws org.hl7.fhir.exceptions.FHIRFormatError, IOException
IParserparse in interface IParserorg.hl7.fhir.exceptions.FHIRFormatErrorUnsupportedEncodingExceptionIOExceptionpublic Resource parse(byte[] bytes) throws org.hl7.fhir.exceptions.FHIRFormatError, IOException
IParserparse in interface IParserorg.hl7.fhir.exceptions.FHIRFormatErrorIOExceptionpublic Type parseType(String input, String typeName) throws org.hl7.fhir.exceptions.FHIRFormatError, IOException
IParserparseType in interface IParserorg.hl7.fhir.exceptions.FHIRFormatErrorUnsupportedEncodingExceptionIOExceptionpublic Type parseAnyType(String input, String typeName) throws org.hl7.fhir.exceptions.FHIRFormatError, IOException
org.hl7.fhir.exceptions.FHIRFormatErrorIOExceptionpublic Type parseType(byte[] bytes, String typeName) throws org.hl7.fhir.exceptions.FHIRFormatError, IOException
IParserparseType in interface IParserorg.hl7.fhir.exceptions.FHIRFormatErrorIOExceptionpublic Type parseAnyType(byte[] bytes, String typeName) throws org.hl7.fhir.exceptions.FHIRFormatError, IOException
org.hl7.fhir.exceptions.FHIRFormatErrorIOExceptionpublic String composeString(Resource resource) throws IOException
IParsercomposeString in interface IParserIOExceptionpublic byte[] composeBytes(Resource resource) throws IOException
IParsercomposeBytes in interface IParserIOExceptionpublic String composeString(Type type, String typeName) throws IOException
IParsercomposeString in interface IParserIOExceptionpublic byte[] composeBytes(Type type, String typeName) throws IOException
IParsercomposeBytes in interface IParserIOExceptionpublic IParser setSuppressXhtml(String message)
IParsersetSuppressXhtml in interface IParserpublic boolean getHandleComments()
IParsergetHandleComments in interface IParserpublic IParser setHandleComments(boolean value)
setHandleComments in interface IParserpublic boolean isAllowUnknownContent()
isAllowUnknownContent in interface IParserpublic IParser setAllowUnknownContent(boolean allowUnknownContent)
setAllowUnknownContent in interface IParserallowUnknownContent - Whether to throw an exception if unknown content is found (or just skip it)public boolean isAllowComments()
public void setAllowComments(boolean allowComments)
public IParser.OutputStyle getOutputStyle()
IParsergetOutputStyle in interface IParserpublic IParser setOutputStyle(IParser.OutputStyle style)
setOutputStyle in interface IParserprotected int parseIntegerPrimitive(String value)
protected int parseIntegerPrimitive(Long value)
protected String parseCodePrimitive(String value)
protected String parseTimePrimitive(String value) throws ParseException
ParseExceptionprotected BigDecimal parseDecimalPrimitive(BigDecimal value)
protected BigDecimal parseDecimalPrimitive(String value)
protected String parseUriPrimitive(String value)
protected byte[] parseBase64BinaryPrimitive(String value)
protected String parseOidPrimitive(String value)
protected Boolean parseBooleanPrimitive(String value)
protected Boolean parseBooleanPrimitive(Boolean value)
protected String parseIdPrimitive(String value)
protected String parseStringPrimitive(String value)
protected String parseUuidPrimitive(String value)
Copyright © 2014–2021 Health Level 7. All rights reserved.