public interface IParser
| Modifier and Type | Interface and Description |
|---|---|
static class |
IParser.OutputStyle |
| Modifier and Type | Method and Description |
|---|---|
void |
compose(OutputStream stream,
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)
|
void |
compose(OutputStream stream,
Type type,
String rootName)
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.
|
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 rootName)
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 rootName)
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:
|
ParserType |
getType()
check what kind of parser this is
|
boolean |
isAllowUnknownContent() |
Resource |
parse(byte[] bytes)
parse content that is known to be a resource
|
Resource |
parse(InputStream input)
parse content that is known to be a resource
|
Resource |
parse(String input)
parse content that is known to be a resource
|
Type |
parseAnyType(InputStream input,
String knownType) |
Type |
parseType(byte[] bytes,
String knownType)
This is used to parse a type - a fragment of a resource.
|
Type |
parseType(InputStream input,
String knownType)
This is used to parse a type - a fragment of a resource.
|
Type |
parseType(String input,
String knownType)
This is used to parse a type - a fragment of a resource.
|
IParser |
setAllowUnknownContent(boolean value) |
IParser |
setHandleComments(boolean value) |
IParser |
setOutputStyle(IParser.OutputStyle value) |
IParser |
setSuppressXhtml(String message)
This method is used by the publication tooling to stop the xhrtml narrative being generated.
|
ParserType getType()
boolean getHandleComments()
IParser setHandleComments(boolean value)
boolean isAllowUnknownContent()
allowUnknownContent - Whether to throw an exception if unknown content is found (or just skip it) when parsingIParser setAllowUnknownContent(boolean value)
IParser.OutputStyle getOutputStyle()
IParser setOutputStyle(IParser.OutputStyle value)
IParser setSuppressXhtml(String message)
Resource parse(InputStream input) throws IOException, org.hl7.fhir.exceptions.FHIRFormatError
org.xmlpull.v1.XmlPullParserExceptionorg.hl7.fhir.exceptions.FHIRFormatErrorIOExceptionResource parse(String input) throws UnsupportedEncodingException, org.hl7.fhir.exceptions.FHIRFormatError, IOException
UnsupportedEncodingExceptionIOExceptionorg.hl7.fhir.exceptions.FHIRFormatErrorResource parse(byte[] bytes) throws org.hl7.fhir.exceptions.FHIRFormatError, IOException
IOExceptionorg.hl7.fhir.exceptions.FHIRFormatErrorType parseType(InputStream input, String knownType) throws IOException, org.hl7.fhir.exceptions.FHIRFormatError
input - knownType. - if this is blank, the parser may try to infer the type (xml only)org.xmlpull.v1.XmlPullParserExceptionorg.hl7.fhir.exceptions.FHIRFormatErrorIOExceptionType parseAnyType(InputStream input, String knownType) throws IOException, org.hl7.fhir.exceptions.FHIRFormatError
IOExceptionorg.hl7.fhir.exceptions.FHIRFormatErrorType parseType(String input, String knownType) throws UnsupportedEncodingException, org.hl7.fhir.exceptions.FHIRFormatError, IOException
input - knownType. - if this is blank, the parser may try to infer the type (xml only)UnsupportedEncodingExceptionIOExceptionorg.hl7.fhir.exceptions.FHIRFormatErrorType parseType(byte[] bytes, String knownType) throws org.hl7.fhir.exceptions.FHIRFormatError, IOException
input - knownType. - if this is blank, the parser may try to infer the type (xml only)IOExceptionorg.hl7.fhir.exceptions.FHIRFormatErrorvoid compose(OutputStream stream, Resource resource) throws IOException
IOExceptionString composeString(Resource resource) throws IOException
IOExceptionbyte[] composeBytes(Resource resource) throws IOException
IOExceptionvoid compose(OutputStream stream, Type type, String rootName) throws IOException
org.xmlpull.v1.XmlPullParserExceptionorg.hl7.fhir.exceptions.FHIRFormatErrorIOExceptionString composeString(Type type, String rootName) throws IOException
IOExceptionbyte[] composeBytes(Type type, String rootName) throws IOException
IOExceptionCopyright © 2014–2021 Health Level 7. All rights reserved.