@Test public void testExampleFromHomepage_removeInvalidCharacters() throws Exception { Reader reader = new StringReader("foo\uD8FFbar"); Modifier modifier = new InvalidXmlCharacterModifier("", InvalidXmlCharacterModifier.XML_11_VERSION); ModifyingReader modifyingReader = new ModifyingReader(reader, modifier); String actualOutput = IOUtils.toString(modifyingReader); assertEquals("foobar", actualOutput); }
@Override public String toString() { StringBuilder builder = new StringBuilder(); builder.append("InvalidXmlCharacterModifier [\nreplacement="); builder.append(replacement); builder.append(", \nmatcher="); builder.append(matcher); builder.append(", \ndollarZero="); builder.append(dollarZero); builder.append("]"); return builder.toString(); }
InvalidXmlCharacterModifier implements Modifier { @Override public String toString() { StringBuilder builder = new StringBuilder(); builder.append("InvalidXmlCharacterModifier [\nreplacement="); builder.append(replacement); builder.append(", \nmatcher="); builder.append(matcher); builder.append(", \ndollarZero="); builder.append(dollarZero); builder.append("]"); return builder.toString(); } }
InvalidXmlCharacterModifier implements Modifier { @Override public String toString() { StringBuilder builder = new StringBuilder(); builder.append("InvalidXmlCharacterModifier [\nreplacement="); builder.append(replacement); builder.append(", \nmatcher="); builder.append(matcher); builder.append(", \ndollarZero="); builder.append(dollarZero); builder.append("]"); return builder.toString(); } InvalidXmlCharacterModifier(String replacement, String xmlVersion);  InvalidXmlCharacterModifier(int newNumberOfChars, String replacement, String xmlVersion, boolean dollarZero); }
InvalidXmlCharacterModifier implements Modifier { @Override public String toString() { StringBuilder builder = new StringBuilder(); builder.append("InvalidXmlCharacterModifier [\nreplacement="); builder.append(replacement); builder.append(", \nmatcher="); builder.append(matcher); builder.append(", \ndollarZero="); builder.append(dollarZero); builder.append("]"); return builder.toString(); } InvalidXmlCharacterModifier(String replacement, String xmlVersion);  InvalidXmlCharacterModifier(int newNumberOfChars, String replacement, String xmlVersion, boolean dollarZero); @Override AfterModification modify(StringBuilder characterBuffer, int firstModifiableCharacterInBuffer,
            boolean endOfStreamHit); @Override String toString(); }
InvalidXmlCharacterModifier implements Modifier { @Override public String toString() { StringBuilder builder = new StringBuilder(); builder.append("InvalidXmlCharacterModifier [\nreplacement="); builder.append(replacement); builder.append(", \nmatcher="); builder.append(matcher); builder.append(", \ndollarZero="); builder.append(dollarZero); builder.append("]"); return builder.toString(); } InvalidXmlCharacterModifier(String replacement, String xmlVersion);  InvalidXmlCharacterModifier(int newNumberOfChars, String replacement, String xmlVersion, boolean dollarZero); @Override AfterModification modify(StringBuilder characterBuffer, int firstModifiableCharacterInBuffer,
            boolean endOfStreamHit); @Override String toString(); static final String XML_10_VERSION; static final String XML_11_VERSION; }