Package org.openstreetmap.josm.io
Class InvalidXmlCharacterFilter
java.lang.Object
java.io.Reader
org.openstreetmap.josm.io.InvalidXmlCharacterFilter
- All Implemented Interfaces:
Closeable,AutoCloseable,Readable
FilterInputStream that gets rid of characters that are invalid in an XML 1.0
document.
Although these characters are forbidden, in the real wold they still appear
in XML files. Java's SAX parser throws an exception, so we have to filter
at a lower level.
Only handles control characters (<0x20). Invalid characters are replaced
by space (0x20).
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static booleanprivate static final boolean[]private final Reader -
Constructor Summary
ConstructorsConstructorDescriptionInvalidXmlCharacterFilter(Reader reader) Constructs a newInvalidXmlCharacterFilterfor the given Reader. -
Method Summary
Methods inherited from class java.io.Reader
mark, markSupported, nullReader, read, read, read, ready, reset, skip, transferTo
-
Field Details
-
reader
-
firstWarning
-
INVALID_CHARS
-
-
Constructor Details
-
InvalidXmlCharacterFilter
Constructs a newInvalidXmlCharacterFilterfor the given Reader.- Parameters:
reader- The reader to filter
-
-
Method Details
-
read
- Specified by:
readin classReader- Throws:
IOException
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein classReader- Throws:
IOException
-
filter
-