@Override protected final void saveHandlerToXML(EnhancedXMLStreamWriter writer) throws XMLStreamException { onMatch.saveToXML(writer); saveFilterToXML(writer); } protected abstract void saveFilterToXML(EnhancedXMLStreamWriter writer)
@Override public void saveToXML(Writer out) throws IOException { XMLOutputFactory factory = XMLOutputFactory.newInstance(); try { XMLStreamWriter writer = factory.createXMLStreamWriter(out); writer.writeStartElement("filter"); writer.writeAttribute("class", getClass().getCanonicalName()); super.saveToXML(writer); writer.writeAttribute("caseSensitive", Boolean.toString(caseSensitive)); writer.writeCharacters(regex == null ? "" : regex); writer.writeEndElement(); writer.flush(); writer.close(); } catch (XMLStreamException e) { throw new IOException("Cannot save as XML.", e); } }
@Override public void saveToXML(Writer out) throws IOException { XMLOutputFactory factory = XMLOutputFactory.newInstance(); try { XMLStreamWriter writer = factory.createXMLStreamWriter(out); writer.writeStartElement("filter"); writer.writeAttribute("class", getClass().getCanonicalName()); super.saveToXML(writer); writer.writeAttribute("caseSensitive", Boolean.toString(caseSensitive)); writer.writeAttribute("field", field); writer.writeCharacters(regex == null ? "" : regex); writer.writeEndElement(); writer.flush(); writer.close(); } catch (XMLStreamException e) { throw new IOException("Cannot save as XML.", e); } }