001/* 002 * Mode.java May 2007 003 * 004 * Copyright (C) 2007, Niall Gallagher <niallg@users.sf.net> 005 * 006 * Licensed under the Apache License, Version 2.0 (the "License"); 007 * you may not use this file except in compliance with the License. 008 * You may obtain a copy of the License at 009 * 010 * http://www.apache.org/licenses/LICENSE-2.0 011 * 012 * Unless required by applicable law or agreed to in writing, software 013 * distributed under the License is distributed on an "AS IS" BASIS, 014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 015 * implied. See the License for the specific language governing 016 * permissions and limitations under the License. 017 */ 018 019package org.simpleframework.xml.stream; 020 021/** 022 * The <code>Mode</code> enumeration is used to specify the output 023 * mode for XML text. This is used by the <code>OutputNode</code> 024 * to describe if element text will be escaped or wrapped in a 025 * CDATA block. The mode is a three state object, the third of the 026 * states indicates whether an explicit state has been set or not. 027 * If a specific state has not been set then the node will inherit 028 * its output mode from the last parent to have it set. 029 * 030 * @author Niall Gallagher 031 * 032 * @see org.simpleframework.xml.stream.OutputNode 033 */ 034public enum Mode { 035 036 /** 037 * Indicates that data written will be within a CDATA block. 038 */ 039 DATA, 040 041 /** 042 * Indicates that data written will be escaped if required. 043 */ 044 ESCAPE, 045 046 /** 047 * Indicates that the mode will be inherited from its parent. 048 */ 049 INHERIT; 050}