11adf3a94fce500e0bda933e4b495a004d5789bd7Andrey Somov/**
211a89b445f3bde56bf07e6a0d04f0b0256dcb215Andrey Somov * Copyright (c) 2008, http://www.snakeyaml.org
31adf3a94fce500e0bda933e4b495a004d5789bd7Andrey Somov *
41adf3a94fce500e0bda933e4b495a004d5789bd7Andrey Somov * Licensed under the Apache License, Version 2.0 (the "License");
51adf3a94fce500e0bda933e4b495a004d5789bd7Andrey Somov * you may not use this file except in compliance with the License.
61adf3a94fce500e0bda933e4b495a004d5789bd7Andrey Somov * You may obtain a copy of the License at
71adf3a94fce500e0bda933e4b495a004d5789bd7Andrey Somov *
81adf3a94fce500e0bda933e4b495a004d5789bd7Andrey Somov *     http://www.apache.org/licenses/LICENSE-2.0
91adf3a94fce500e0bda933e4b495a004d5789bd7Andrey Somov *
101adf3a94fce500e0bda933e4b495a004d5789bd7Andrey Somov * Unless required by applicable law or agreed to in writing, software
111adf3a94fce500e0bda933e4b495a004d5789bd7Andrey Somov * distributed under the License is distributed on an "AS IS" BASIS,
121adf3a94fce500e0bda933e4b495a004d5789bd7Andrey Somov * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
131adf3a94fce500e0bda933e4b495a004d5789bd7Andrey Somov * See the License for the specific language governing permissions and
141adf3a94fce500e0bda933e4b495a004d5789bd7Andrey Somov * limitations under the License.
159629be70863521bead138c295351f3dec926ab1Andrey Somov */
169629be70863521bead138c295351f3dec926ab1Andrey Somovpackage org.yaml.snakeyaml.events;
179629be70863521bead138c295351f3dec926ab1Andrey Somov
189629be70863521bead138c295351f3dec926ab1Andrey Somovimport org.yaml.snakeyaml.error.Mark;
199629be70863521bead138c295351f3dec926ab1Andrey Somov
209629be70863521bead138c295351f3dec926ab1Andrey Somov/**
215276a6f69a288c609ad58a2d17423a862d44c9a5scm * Marks the start of a stream that might contain multiple documents.
225276a6f69a288c609ad58a2d17423a862d44c9a5scm * <p>
2337f2f1c81f4a5be14db404db4e73f3dca6aa82f2Andrey Somov * This event is the first event that a parser emits. Together with
2437f2f1c81f4a5be14db404db4e73f3dca6aa82f2Andrey Somov * {@link StreamEndEvent} (which is the last event a parser emits) they mark the
2537f2f1c81f4a5be14db404db4e73f3dca6aa82f2Andrey Somov * beginning and the end of a stream of documents.
265276a6f69a288c609ad58a2d17423a862d44c9a5scm * </p>
275276a6f69a288c609ad58a2d17423a862d44c9a5scm * <p>
285276a6f69a288c609ad58a2d17423a862d44c9a5scm * See {@link Event} for an exemplary output.
295276a6f69a288c609ad58a2d17423a862d44c9a5scm * </p>
309629be70863521bead138c295351f3dec926ab1Andrey Somov */
319629be70863521bead138c295351f3dec926ab1Andrey Somovpublic final class StreamStartEvent extends Event {
329629be70863521bead138c295351f3dec926ab1Andrey Somov
339629be70863521bead138c295351f3dec926ab1Andrey Somov    public StreamStartEvent(Mark startMark, Mark endMark) {
349629be70863521bead138c295351f3dec926ab1Andrey Somov        super(startMark, endMark);
359629be70863521bead138c295351f3dec926ab1Andrey Somov    }
36f6bb127d64bed60d162bd1a8d9a4f97db4de6a45Andrey Somov
37f6bb127d64bed60d162bd1a8d9a4f97db4de6a45Andrey Somov    @Override
38039bc29d64938dbd1613471dfdbdc5717cf2f103Andrey Somov    public boolean is(Event.ID id) {
39f6bb127d64bed60d162bd1a8d9a4f97db4de6a45Andrey Somov        return ID.StreamStart == id;
40f6bb127d64bed60d162bd1a8d9a4f97db4de6a45Andrey Somov    }
419629be70863521bead138c295351f3dec926ab1Andrey Somov}
42