Package org.hl7.fhir.utilities.xml
Class XMLWriter
java.lang.Object
java.io.Writer
java.io.OutputStreamWriter
org.hl7.fhir.utilities.xml.XMLWriter
- All Implemented Interfaces:
Closeable,Flushable,Appendable,AutoCloseable,IXMLWriter
XML Writer class.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionXMLWriter(OutputStream stream, String charset) XMLWriter(OutputStream stream, String charset, boolean xml1_1) -
Method Summary
Modifier and TypeMethodDescriptionbooleanabbreviationDefined(String abbreviation) voidvoidvoidvoidvoidvoidvoidattributeNoLines(String name, String value) booleancanElide()voidvoidclose()voidprotected voidprotected booleanvoiddecorate(ElementDecoration element) voidvoidvoidvoidvoidvoidvoidelide()voidend()voidvoidvoidvoidvoidescapedText(String content) voidexit()voidvoidvoidexitToLevel(int count) voidexternalLink(String ref) findByAbbreviation(String abbreviation) findByNamespace(String namespace) protected XMLNamespaceprotected StringgetAttribute(String name) intintString[]static StringgetXMLCharsetName(String charset) Returns the encoding.booleanbooleanbooleanisPretty()booleanbooleanvoidvoidvoidbooleannamespaceDefined(String namespace) voidprocessingInstruction(String value) protected voidsetAttribute(String name, String value) voidsetAttributeLineWrap(int attributeLineWrap) voidsetCanonical(boolean canonical) voidsetDefaultNamespace(String namespace) voidsetIgnoreComments(boolean ignoreComments) voidsetLineType(int lineType) voidsetPretty(boolean pretty) voidsetPrettyHeader(boolean pretty) voidsetSchemaLocation(String ns, String loc) voidsetSpecialAttributeNames(String[] specialAttributeNames) voidsetXmlHeader(boolean xmlHeader) voidstart()voidStart comment inserts a so the comment doesn't close prematurely.voidvoidvoidwriteBytes(byte[] bytes) intintwritePretty(boolean eoln) protected StringMethods inherited from class java.io.OutputStreamWriter
append, append, flush, getEncoding, write, write, writeMethods inherited from class java.io.Writer
append, nullWriter, write, write
-
Field Details
-
LINE_UNIX
- See Also:
-
LINE_WINDOWS
- See Also:
-
-
Constructor Details
-
XMLWriter
public XMLWriter(OutputStream stream, String charset, boolean xml1_1) throws UnsupportedEncodingException - Throws:
UnsupportedEncodingException
-
XMLWriter
- Throws:
UnsupportedEncodingException
-
-
Method Details
-
condition
- Throws:
IOException
-
getXMLCharsetName
Returns the encoding.- Parameters:
charset-- Returns:
- encoding
- Throws:
IOException
-
start
- Specified by:
startin interfaceIXMLWriter- Throws:
IOException
-
getAttribute
-
setAttribute
- Throws:
IOException
-
commitAttributes
- Throws:
IOException
-
xmlEscape
-
attribute
public void attribute(String namespace, String name, String value, boolean onlyIfNotEmpty) throws IOException - Specified by:
attributein interfaceIXMLWriter- Throws:
IOException
-
attribute
- Specified by:
attributein interfaceIXMLWriter- Throws:
IOException
-
attribute
- Specified by:
attributein interfaceIXMLWriter- Throws:
IOException
-
attribute
- Specified by:
attributein interfaceIXMLWriter- Throws:
IOException
-
attributeNoLines
- Specified by:
attributeNoLinesin interfaceIXMLWriter- Throws:
IOException
-
findByNamespace
-
namespaceDefined
- Specified by:
namespaceDefinedin interfaceIXMLWriter
-
findByAbbreviation
-
abbreviationDefined
- Specified by:
abbreviationDefinedin interfaceIXMLWriter
-
findDefaultNamespace
-
getDefaultNamespace
- Specified by:
getDefaultNamespacein interfaceIXMLWriter
-
namespace
- Specified by:
namespacein interfaceIXMLWriter- Throws:
IOException
-
setDefaultNamespace
- Specified by:
setDefaultNamespacein interfaceIXMLWriter- Throws:
IOException
-
namespace
- Specified by:
namespacein interfaceIXMLWriter- Throws:
IOException
-
comment
- Specified by:
commentin interfaceIXMLWriter- Throws:
IOException
-
enter
- Specified by:
enterin interfaceIXMLWriter- Throws:
IOException
-
enter
- Specified by:
enterin interfaceIXMLWriter- Throws:
IOException
-
exit
- Specified by:
exitin interfaceIXMLWriter- Throws:
IOException
-
exit
- Specified by:
exitin interfaceIXMLWriter- Throws:
IOException
-
exitToLevel
- Specified by:
exitToLevelin interfaceIXMLWriter- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classOutputStreamWriter- Throws:
IOException
-
end
- Specified by:
endin interfaceIXMLWriter- Throws:
IOException
-
exit
- Specified by:
exitin interfaceIXMLWriter- Throws:
IOException
-
enter
- Specified by:
enterin interfaceIXMLWriter- Throws:
IOException
-
element
public void element(String namespace, String name, String content, boolean onlyIfNotEmpty) throws IOException - Specified by:
elementin interfaceIXMLWriter- Throws:
IOException
-
element
public void element(String namespace, String name, String content, String comment) throws IOException - Specified by:
elementin interfaceIXMLWriter- Throws:
IOException
-
element
- Specified by:
elementin interfaceIXMLWriter- Throws:
IOException
-
element
- Specified by:
elementin interfaceIXMLWriter- Throws:
IOException
-
element
- Specified by:
elementin interfaceIXMLWriter- Throws:
IOException
-
element
- Specified by:
elementin interfaceIXMLWriter- Throws:
IOException
-
text
- Specified by:
textin interfaceIXMLWriter- Throws:
IOException
-
text
- Specified by:
textin interfaceIXMLWriter- Throws:
IOException
-
cData
- Specified by:
cDatain interfaceIXMLWriter- Throws:
IOException
-
writeBytes
- Specified by:
writeBytesin interfaceIXMLWriter- Throws:
IOException
-
isPretty
- Specified by:
isPrettyin interfaceIXMLWriter- Throws:
IOException
-
setPretty
- Specified by:
setPrettyin interfaceIXMLWriter- Throws:
IOException
-
startCommentBlock
Description copied from interface:IXMLWriterStart comment inserts a so the comment doesn't close prematurely.- Specified by:
startCommentBlockin interfaceIXMLWriter- Throws:
IOException
-
endCommentBlock
- Specified by:
endCommentBlockin interfaceIXMLWriter- Throws:
IOException
-
setCanonical
-
isPrettyHeader
-
setPrettyHeader
-
writePretty
- Throws:
IOException
-
writePretty
- Throws:
IOException
-
getLineType
-
setLineType
-
isXmlHeader
-
setXmlHeader
-
getSpecialAttributeNames
-
setSpecialAttributeNames
-
getAttributeLineWrap
-
setAttributeLineWrap
-
escapedText
- Specified by:
escapedTextin interfaceIXMLWriter- Throws:
IOException
-
processingInstruction
- Throws:
IOException
-
link
- Specified by:
linkin interfaceIXMLWriter
-
anchor
- Specified by:
anchorin interfaceIXMLWriter
-
decorate
- Specified by:
decoratein interfaceIXMLWriter- Throws:
IOException
-
setSchemaLocation
- Specified by:
setSchemaLocationin interfaceIXMLWriter- Throws:
IOException
-
externalLink
- Specified by:
externalLinkin interfaceIXMLWriter
-
canElide
- Specified by:
canElidein interfaceIXMLWriter
-
attributeElide
- Specified by:
attributeElidein interfaceIXMLWriter
-
elide
- Specified by:
elidein interfaceIXMLWriter- Throws:
IOException
-
isIgnoreComments
-
setIgnoreComments
-
isCanonical
- Specified by:
isCanonicalin interfaceIXMLWriter- Throws:
IOException
-