Home » xmlbeans-2.5.0-src » org.apache » xmlbeans » [javadoc | source]

    1   /*   Copyright 2004 The Apache Software Foundation
    2    *
    3    *   Licensed under the Apache License, Version 2.0 (the "License");
    4    *   you may not use this file except in compliance with the License.
    5    *   You may obtain a copy of the License at
    6    *
    7    *       http://www.apache.org/licenses/LICENSE-2.0
    8    *
    9    *   Unless required by applicable law or agreed to in writing, software
   10    *   distributed under the License is distributed on an "AS IS" BASIS,
   11    *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   12    *   See the License for the specific language governing permissions and
   13    *  limitations under the License.
   14    */
   15   package org.apache.xmlbeans;
   16   
   17   /**
   18    * Represents a CDATA bookmark.
   19    *
   20    * <p>When XmlOption UseCDataBookmarks is setted on parse methods,
   21    * the loader will set these CDataBookmarks in the store on the respective
   22    * TEXT fields that were represented as CDATA.</p>
   23    *
   24    * <p>Users can modify the 'look' of TEXT fields, by annotating them with
   25    * this bookmark, or remove the bookmark.</p>
   26    *
   27    * <p>Additionaly if setted on save methods, the output will look for these
   28    * bookmarks and will output the text as CDATA.
   29    * Note: The SaveCDataEntityCountThreshold and SaveCDataLengthThreshold
   30    * options and their default values still apply.</p>
   31    *
   32    * <p>Note: Due to the store representation, a CDATA will not be recognized
   33    * if it is imediately after non CDATA text and all text following it will
   34    * be considered CDATA.<br/>
   35    * Example:<br>
   36    * <pre>
   37    * &lt;a>&lt;![CDATA[cdata text]]>&lt;/a>               - is considered as: &lt;a>&lt;![CDATA[cdata text]]>&lt;/a>
   38    * &lt;b>&lt;![CDATA[cdata text]]> regular text&lt;/b>  - is considered as: &lt;b>&lt;![CDATA[cdata text regular text]]>&lt;/b>
   39    * &lt;c>text &lt;![CDATA[cdata text]]>&lt;/c>          - is considered as: &lt;c>text cdata text&lt;/c>
   40    * </pre>
   41    * </p>
   42    * @see XmlOptions#setUseCDataBookmarks()
   43    * @see org.apache.xmlbeans.XmlObject.Factory#parse(String, XmlOptions)
   44    * @see org.apache.xmlbeans.XmlObject#save(java.io.OutputStream, XmlOptions)
   45    * @see XmlOptions#setSaveCDataEntityCountThreshold(int) 
   46    * @see XmlOptions#setSaveCDataLengthThreshold(int)
   47    * @author Cezar Andrei  (cezar dot andrei at gmail dot com)
   48    */
   49   public class CDataBookmark
   50      extends XmlCursor.XmlBookmark
   51   {
   52       /**
   53        * The actual bookmark object representing CData.<br>
   54        * Users must use this bookmark in addition to UseCDataBookmarks
   55        * option to make use of CDATA representation in XML text.
   56        */
   57       public static CDataBookmark CDATA_BOOKMARK = new CDataBookmark();
   58   }

Home » xmlbeans-2.5.0-src » org.apache » xmlbeans » [javadoc | source]