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 |
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 Exception
ExceptionResource parse(String input) throws Exception
ExceptionResource parse(byte[] bytes) throws Exception
ExceptionType parseType(InputStream input, String knownType) throws Exception
input - knownType. - if this is blank, the parser may try to infer the type (xml only)ExceptionType parseType(String input, String knownType) throws Exception
input - knownType. - if this is blank, the parser may try to infer the type (xml only)ExceptionType parseType(byte[] bytes, String knownType) throws Exception
input - knownType. - if this is blank, the parser may try to infer the type (xml only)Exceptionvoid compose(OutputStream stream, Resource resource) throws Exception
ExceptionString composeString(Resource resource) throws Exception
Exceptionbyte[] composeBytes(Resource resource) throws Exception
Exceptionvoid compose(OutputStream stream, Type type, String rootName) throws Exception
ExceptionString composeString(Type type, String rootName) throws Exception
Exceptionbyte[] composeBytes(Type type, String rootName) throws Exception
ExceptionCopyright © 2014–2018 University Health Network. All rights reserved.