/*******************************************************************************
 * Copyright (c) 2010 Oracle. All rights reserved.
 * This program and the accompanying materials are made available under the 
 * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0 
 * which accompanies this distribution. 
 * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
 * and the Eclipse Distribution License is available at 
 * http://www.eclipse.org/org/documents/edl-v10.php.
 *
 * Contributors:
 *     Oracle = 2.2 - Initial contribution
 ******************************************************************************/
package org.eclipse.persistence.oxm.annotations;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * 
 *<p><b>Purpose</b>: This annotation indicates that the value held by this property should 
 * be wrapped in a CDATA section during marshal. This only applies to simple values.
 * 
 * <p><b>Example:</b><br>
 * <code>
 * &nbsp;@XmlRootElement(name="customer")<br>
 * &nbsp;public class Customer {<br>
 * &nbsp;&nbsp;&nbsp;&nbsp;...<br>
 * &nbsp;&nbsp;&nbsp;&nbsp;@XmlElement<br>
 * &nbsp;&nbsp;&nbsp;&nbsp;@XmlCDATA<br>
 * &nbsp;&nbsp;&nbsp;&nbsp;public String data<br>
 * &nbsp;&nbsp;&nbsp;&nbsp;...<br>
 * &nbsp;}<br><br> *
 *
 */
@Target({ElementType.FIELD, ElementType.METHOD})
@Retention(RetentionPolicy.RUNTIME)
public @interface XmlCDATA {}
@@ -913,200 +913,524 @@
 %0A * 
-%0D%0A *%3Cp%3E%3Cb%3EPurpose%3C/b%3E: This annotation indicates that the value held by this property should
+%3Cp%3EWrap the value inside a CDATA section.  Normally JAXB will escape certain %0D%0A * characters in a string during a marshal operation:%0D%0A * %3Cul%3E%0D%0A * %3Cli%3E%7B@code & (as &amp;)%7D%3C/li%3E%0D%0A * %3Cli%3E%7B@code %3C (as &lt;)%7D%3C/li%3E%0D%0A * %3Cli%3E%7B@code %22 (as &quot;)%7D%3C/li%3E%0D%0A * %3C/ul%3E%0D%0A * This means a property foo with string value %7B@code %221 %3C 2%22%7D without
  %0D%0A * 
-be wrapped in a CDATA section during marshal. This only applies to simple values.%0D%0A * 
+%7B@code @XmlCDATA%7D will be marshalled as %7B@code %3Cfoo%3E1 &lt; 2%3C/foo%3E%7D. When %0D%0A * %7B@code @XmlCDATA%7D is used the content is marshalled as %0D%0A * %7B@code %3Cfoo%3E%3C!%5BCDATA%5B1 %3C 2%5D%5D%3E%3C/foo%3E%7D.%3C/p%3E
 %0D%0A * 
-%3Cp%3E
 %3Cb%3EE
@@ -1439,231 +1439,246 @@
 mple
-:
 %3C/b%3E
-%3Cbr%3E
 %0D%0A * %3C
-cod
+pr
 e%3E%0D%0A * 
-&nbsp;@XmlRootElement(name=%22customer%22)%3Cbr%3E%0D%0A * &nbsp;public class Customer %7B%3Cbr%3E%0D%0A * &nbsp;&nbsp;&nbsp;&nbsp;...%3Cbr%3E%0D%0A * &nbsp;&nbsp;&nbsp;&nbsp;@Xml
+import javax.xml.bind.annotation.XmlRootElement; %0D%0A * import org.eclipse.persistence.oxm.annotations.XmlCDATA;%0D%0A * %0D%0A * &#64;XmlRoot
 Element
-%3Cbr%3E
+()
 %0D%0A * 
-&nbsp;&nbsp;&nbsp;&nbsp;@
+public class Root %7B%0D%0A *     private String foo;%0D%0A *%0D%0A *     &#64;
 XmlCDATA
 %3Cbr%3E
@@ -1677,125 +1677,175 @@
 DATA
-%3Cbr%3E
 %0D%0A * 
-&nbsp;&nbsp;&nbsp;&nbsp;public String data%3Cbr%3E%0D%0A * &nbsp;&nbsp;&nbsp;&nbsp;...%3Cbr%3E%0D%0A * &nbsp;%7D%3Cbr%3E%3Cbr%3E *%0D%0A *
+    public String getFoo() %7B%0D%0A *         return foo;%0D%0A *     %7D%0D%0A *%0D%0A *     public void setFoo(String foo) %7B%0D%0A *         this.foo = foo;%0D%0A *     %7D%0D%0A * %7D%0D%0A * %3C/pre%3E
 %0D%0A *

Fix for Bug 324205 - Enhance @XmlCDATA Javadoc