Path: blob/master/src/java.xml/share/classes/javax/xml/stream/events/Characters.java
40955 views
/*1* Copyright (c) 2009, 2020, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425package javax.xml.stream.events;2627/**28* This describes the interface to Characters events.29* All text events get reported as Characters events.30* Content, CData and whitespace are all reported as31* Characters events. IgnorableWhitespace, in most cases,32* will be set to false unless an element declaration of element33* content is present for the current element.34*35* @version 1.036* @author Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.37* @since 1.638*/39public interface Characters extends XMLEvent {40/**41* Get the character data of this event42* @return the character data43*/44public String getData();4546/**47* Returns true if this set of Characters48* is all whitespace. Whitespace inside a document49* is reported as CHARACTERS. This method allows50* checking of CHARACTERS events to see if they51* are composed of only whitespace characters52* @return true if the {@code Characters} are all whitespace, false otherwise53*/54public boolean isWhiteSpace();5556/**57* Returns true if this is a CData section. If this58* event is CData its event type will be CDATA59*60* If javax.xml.stream.isCoalescing is set to true CDATA Sections61* that are surrounded by non CDATA characters will be reported62* as a single Characters event. This method will return false63* in this case.64* @return true if it is {@code CDATA}, false otherwise65*/66public boolean isCData();6768/**69* Return true if this is ignorableWhiteSpace. If70* this event is ignorableWhiteSpace its event type will71* be SPACE.72* @return true if it is ignorable whitespace, false otherwise73*/74public boolean isIgnorableWhiteSpace();7576}777879