DummyEvent.java revision 286
286N/A * Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. 286N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 286N/A * This code is free software; you can redistribute it and/or modify it 286N/A * under the terms of the GNU General Public License version 2 only, as 286N/A * published by the Free Software Foundation. Oracle designates this 286N/A * particular file as subject to the "Classpath" exception as provided 286N/A * by Oracle in the LICENSE file that accompanied this code. 286N/A * This code is distributed in the hope that it will be useful, but WITHOUT 286N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 286N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 286N/A * version 2 for more details (a copy is included in the LICENSE file that 286N/A * accompanied this code). 286N/A * You should have received a copy of the GNU General Public License version 286N/A * 2 along with this work; if not, write to the Free Software Foundation, 286N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 286N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 286N/A * or visit www.oracle.com if you need additional information or have any 286N/A/** DummyEvent is an abstract class. It provides functionality for most of the 286N/A * function of XMLEvent. 286N/A * @author Neeraj Bajaj Sun Microsystems,Inc. 286N/A * @author K.Venugopal Sun Microsystems,Inc. 286N/A // Make sure that getLocation() never returns null. Instead, return this dummy location 286N/A // that indicates "nowhere" as effectively as possible. 286N/A /* Event type this event corresponds to */ 286N/A /** Returns this event as Characters, may result in 286N/A * a class cast exception if this event is not Characters. 286N/A /** Returns this event as an end element event, may result in 286N/A * a class cast exception if this event is not a end element. 286N/A /** Returns this event as a start element event, may result in 286N/A * a class cast exception if this event is not a start element. 286N/A /** This method is provided for implementations to provide 286N/A * optional type information about the associated event. 286N/A * It is optional and will return null if no information 286N/A //Base class will take care of providing extra information about this event. 286N/A /** A utility function to check if this event is an Attribute. 286N/A /** A utility function to check if this event is Characters. 286N/A /** A utility function to check if this event is a Namespace. 286N/A /** This method will write the XMLEvent as per the XML 1.0 specification as Unicode characters. 286N/A * No indentation or whitespace should be outputted. 286N/A * Any user defined event type SHALL have this method 286N/A * called when being written to on an output stream. 286N/A * Built in Event types MUST implement this method, 286N/A * but implementations MAY choose not call these methods 286N/A * for optimizations reasons when writing out built in 286N/A * Events to an output stream. 286N/A * The output generated MUST be equivalent in terms of the 286N/A * @param writer The writer that will output the data 286N/A * @throws XMLStreamException if there is a fatal error writing the event 286N/A /** Helper method in order to expose IOException. 286N/A * @param writer The writer that will output the data 286N/A * @throws XMLStreamException if there is a fatal error writing the event 286N/A * @throws IOException if there is an IO error 286N/A /** Helper method to escape < > & for characters event and 286N/A * quotes, lt and amps for Entity 286N/A // Write any pending data