Package org.openstreetmap.josm.io
Class XmlWriter
java.lang.Object
org.openstreetmap.josm.io.XmlWriter
- All Implemented Interfaces:
Closeable,AutoCloseable
- Direct Known Subclasses:
GpxWriter,NoteWriter,OsmWriter,PreferencesWriter,ValidatorErrorWriter
Helper class to use for xml outputting classes.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
out
-
ENCODING
The output writer to save the values to.
-
-
Constructor Details
-
XmlWriter
Constructs a newXmlWriter.- Parameters:
out- print writer
-
-
Method Details
-
flush
Flushes the stream. -
encode
Encode the given string in XML1.0 format. Optimized to fast pass strings that don't need encoding (normal case).- Parameters:
unencoded- the unencoded input string- Returns:
- XML1.0 string
-
encode
Encode the given string in XML1.0 format. Optimized to fast pass strings that don't need encoding (normal case).- Parameters:
unencoded- the unencoded input stringkeepApos- true if apostrophe sign should stay as it is (in order to work around a Java bug that renders new JLabel("<html>'</html>") literally as 6 character string, see #7558)- Returns:
- XML1.0 string
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Throws:
IOException
-