/** * Method that should be used to add dynamic support for * {@link XMLStreamWriter2}. Method will check whether the * stream reader passed happens to be a {@link XMLStreamWriter2}; * and if it is, return it properly cast. If not, it will create * necessary wrapper to support features needed by StaxMate, * using vanilla Stax 1.0 interface. */ public static XMLStreamWriter2 wrapIfNecessary(XMLStreamWriter sw) { if (sw instanceof XMLStreamWriter2) { return (XMLStreamWriter2) sw; } return new Stax2WriterAdapter(sw); }
/** * Method that should be used to add dynamic support for * {@link XMLStreamWriter2}. Method will check whether the * stream reader passed happens to be a {@link XMLStreamWriter2}; * and if it is, return it properly cast. If not, it will create * necessary wrapper to support features needed by StaxMate, * using vanilla Stax 1.0 interface. */ public static XMLStreamWriter2 wrapIfNecessary(XMLStreamWriter sw) { if (sw instanceof XMLStreamWriter2) { return (XMLStreamWriter2) sw; } return new Stax2WriterAdapter(sw); }
/** * Method that should be used to add dynamic support for * {@link XMLStreamWriter2}. Method will check whether the * stream reader passed happens to be a {@link XMLStreamWriter2}; * and if it is, return it properly cast. If not, it will create * necessary wrapper to support features needed by StaxMate, * using vanilla Stax 1.0 interface. */ public static XMLStreamWriter2 wrapIfNecessary(XMLStreamWriter sw) { if (sw instanceof XMLStreamWriter2) { return (XMLStreamWriter2) sw; } return new Stax2WriterAdapter(sw); }
/** * Method that should be used to add dynamic support for * {@link XMLStreamWriter2}. Method will check whether the * stream reader passed happens to be a {@link XMLStreamWriter2}; * and if it is, return it properly cast. If not, it will create * necessary wrapper to support features needed by StaxMate, * using vanilla Stax 1.0 interface. */ public static XMLStreamWriter2 wrapIfNecessary(XMLStreamWriter sw) { if (sw instanceof XMLStreamWriter2) { return (XMLStreamWriter2) sw; } return new Stax2WriterAdapter(sw); }