Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 383424 | Differences between
and this patch

Collapse All | Expand All

(-)a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/oxm/XMLCompositeCollectionMappingNodeValue.java (+3 lines)
Lines 307-312 public class XMLCompositeCollectionMappingNodeValue extends XMLRelationshipMappi Link Here
307
            objectBuilder.removeExtraNamespacesFromNamespaceResolver(marshalRecord, extraNamespaces, session);    
307
            objectBuilder.removeExtraNamespacesFromNamespaceResolver(marshalRecord, extraNamespaces, session);    
308
           
308
           
309
        } else {
309
        } else {
310
            if (xmlCompositeCollectionMapping.getReferenceClassName() != null && xmlCompositeCollectionMapping.getReferenceClassName().equals(XMLConstants.UNKNOWN_OR_TRANSIENT_CLASS)){
311
                throw XMLMarshalException.descriptorNotFoundInProject(value.getClass().getName());                            
312
            }
310
            xPathNode.startElement(marshalRecord, xPathFragment, object, session, namespaceResolver, null, value);
313
            xPathNode.startElement(marshalRecord, xPathFragment, object, session, namespaceResolver, null, value);
311
            
314
            
312
            QName schemaType = ((XMLField) xmlCompositeCollectionMapping.getField()).getSchemaTypeForValue(value, session);
315
            QName schemaType = ((XMLField) xmlCompositeCollectionMapping.getField()).getSchemaTypeForValue(value, session);
(-)a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/internal/oxm/XMLCompositeObjectMappingNodeValue.java (-6 / +16 lines)
Lines 49-54 import org.w3c.dom.Element; Link Here
49
import org.w3c.dom.NamedNodeMap;
49
import org.w3c.dom.NamedNodeMap;
50
import org.w3c.dom.Node;
50
import org.w3c.dom.Node;
51
import org.w3c.dom.NodeList;
51
import org.w3c.dom.NodeList;
52
import org.w3c.dom.Text;
52
import org.xml.sax.Attributes;
53
import org.xml.sax.Attributes;
53
import org.xml.sax.SAXException;
54
import org.xml.sax.SAXException;
54
55
Lines 181-193 public class XMLCompositeObjectMappingNodeValue extends XMLRelationshipMappingNo Link Here
181
        if (((keepAsElementPolicy == UnmarshalKeepAsElementPolicy.KEEP_UNKNOWN_AS_ELEMENT) || (keepAsElementPolicy == UnmarshalKeepAsElementPolicy.KEEP_ALL_AS_ELEMENT)) && objectValue instanceof Node) {
182
        if (((keepAsElementPolicy == UnmarshalKeepAsElementPolicy.KEEP_UNKNOWN_AS_ELEMENT) || (keepAsElementPolicy == UnmarshalKeepAsElementPolicy.KEEP_ALL_AS_ELEMENT)) && objectValue instanceof Node) {
182
            if(isSelfFragment){
183
            if(isSelfFragment){
183
                NodeList children = ((org.w3c.dom.Element) objectValue).getChildNodes();
184
                NodeList children = ((org.w3c.dom.Element) objectValue).getChildNodes();
184
                for(int i =0, size=children.getLength(); i<size ; i++) {
185
                int childrenLength  = children.getLength();
185
                    Node next = children.item(i);
186
                    for(int i =0; i<childrenLength ; i++) {
186
                    if(next.getNodeType() == Node.ELEMENT_NODE){
187
                        Node next = children.item(i);
187
                        marshalRecord.node(next, marshalRecord.getNamespaceResolver());
188
                        if(next.getNodeType() == Node.ELEMENT_NODE){
188
                        return true;
189
                            marshalRecord.node(next, marshalRecord.getNamespaceResolver());
190
                            return true;
191
                        }else if(next.getNodeType() == Node.TEXT_NODE){
192
                            marshalRecord.characters(((Text)next).getNodeValue());
193
                            return true;
194
                        }
189
                    }
195
                    }
190
                }
196
                return false;
191
            }else{
197
            }else{
192
                marshalRecord.node((Node) objectValue, marshalRecord.getNamespaceResolver());
198
                marshalRecord.node((Node) objectValue, marshalRecord.getNamespaceResolver());
193
                return true;
199
                return true;
Lines 228-233 public class XMLCompositeObjectMappingNodeValue extends XMLRelationshipMappingNo Link Here
228
            }
234
            }
229
            objectBuilder.removeExtraNamespacesFromNamespaceResolver(marshalRecord, extraNamespaces, session);
235
            objectBuilder.removeExtraNamespacesFromNamespaceResolver(marshalRecord, extraNamespaces, session);
230
        } else {
236
        } else {
237
            if (xmlCompositeObjectMapping.getReferenceClassName() !=null && xmlCompositeObjectMapping.getReferenceClassName().equals(XMLConstants.UNKNOWN_OR_TRANSIENT_CLASS)){
238
                throw XMLMarshalException.descriptorNotFoundInProject(objectValue.getClass().getName());
239
            }
240
            
231
            if (!(isSelfFragment || xPathFragment.nameIsText())) {
241
            if (!(isSelfFragment || xPathFragment.nameIsText())) {
232
                xPathNode.startElement(marshalRecord, xPathFragment, object, session, namespaceResolver, null, objectValue);
242
                xPathNode.startElement(marshalRecord, xPathFragment, object, session, namespaceResolver, null, objectValue);
233
            }
243
            }
(-)a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/oxm/XMLConstants.java (+1 lines)
Lines 106-111 public class XMLConstants { Link Here
106
    public static final String ANY_TYPE = "anyType";
106
    public static final String ANY_TYPE = "anyType";
107
    public static final String ANY_URI = "anyURI";
107
    public static final String ANY_URI = "anyURI";
108
    public static final String SWA_REF = "swaRef";
108
    public static final String SWA_REF = "swaRef";
109
    public static final String UNKNOWN_OR_TRANSIENT_CLASS = "UNKNOWN_OR_TRANSIENT_CLASS";
109
110
110
    // Schema Type QNames
111
    // Schema Type QNames
111
    public static final QName ANY_QNAME = new QName(SCHEMA_URL, ANY);
112
    public static final QName ANY_QNAME = new QName(SCHEMA_URL, ANY);
(-)a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/oxm/mappings/XMLCompositeCollectionMapping.java (-1 / +10 lines)
Lines 289-294 public class XMLCompositeCollectionMapping extends AbstractCompositeCollectionMa Link Here
289
        return true;
289
        return true;
290
    }
290
    }
291
291
292
    
293
    public void convertClassNamesToClasses(ClassLoader classLoader){
294
        if(referenceClassName != null && referenceClassName.equals(XMLConstants.UNKNOWN_OR_TRANSIENT_CLASS)){
295
            return;
296
        }
297
        super.convertClassNamesToClasses(classLoader);
298
    }
292
    /**
299
    /**
293
     * INTERNAL:
300
     * INTERNAL:
294
     * The mapping is initialized with the given session. This mapping is fully initialized
301
     * The mapping is initialized with the given session. This mapping is fully initialized
Lines 297-303 public class XMLCompositeCollectionMapping extends AbstractCompositeCollectionMa Link Here
297
    public void initialize(AbstractSession session) throws DescriptorException {
304
    public void initialize(AbstractSession session) throws DescriptorException {
298
        //modified so that reference class on composite mappings is no longer mandatory
305
        //modified so that reference class on composite mappings is no longer mandatory
299
        if ((getReferenceClass() == null) && (getReferenceClassName() != null)) {
306
        if ((getReferenceClass() == null) && (getReferenceClassName() != null)) {
300
            setReferenceClass(session.getDatasourcePlatform().getConversionManager().convertClassNameToClass(getReferenceClassName()));
307
            if(!getReferenceClassName().equals(XMLConstants.UNKNOWN_OR_TRANSIENT_CLASS)){
308
                setReferenceClass(session.getDatasourcePlatform().getConversionManager().convertClassNameToClass(getReferenceClassName()));
309
            }
301
        }
310
        }
302
        if (getReferenceClass() != null) {
311
        if (getReferenceClass() != null) {
303
            super.initialize(session);
312
            super.initialize(session);
(-)a/foundation/org.eclipse.persistence.core/src/org/eclipse/persistence/oxm/mappings/XMLCompositeObjectMapping.java (-1 / +12 lines)
Lines 324-329 public class XMLCompositeObjectMapping extends AbstractCompositeObjectMapping im Link Here
324
        return this.inverseReferenceMapping.getSetMethodName();
324
        return this.inverseReferenceMapping.getSetMethodName();
325
    }
325
    }
326
326
327
    
328
    public void convertClassNamesToClasses(ClassLoader classLoader){
329
        if(referenceClassName != null && referenceClassName.equals(XMLConstants.UNKNOWN_OR_TRANSIENT_CLASS)){
330
            return;
331
        }
332
        super.convertClassNamesToClasses(classLoader);
333
    }
334
    
335
    
327
    /**
336
    /**
328
     * INTERNAL:
337
     * INTERNAL:
329
     * The mapping is initialized with the given session. This mapping is fully initialized
338
     * The mapping is initialized with the given session. This mapping is fully initialized
Lines 332-338 public class XMLCompositeObjectMapping extends AbstractCompositeObjectMapping im Link Here
332
    public void initialize(AbstractSession session) throws DescriptorException {
341
    public void initialize(AbstractSession session) throws DescriptorException {
333
        //modified so that reference class on composite mappings is no longer mandatory
342
        //modified so that reference class on composite mappings is no longer mandatory
334
        if ((getReferenceClass() == null) && (getReferenceClassName() != null)) {
343
        if ((getReferenceClass() == null) && (getReferenceClassName() != null)) {
335
            setReferenceClass(session.getDatasourcePlatform().getConversionManager().convertClassNameToClass(getReferenceClassName()));
344
            if(!getReferenceClassName().equals(XMLConstants.UNKNOWN_OR_TRANSIENT_CLASS)){
345
                setReferenceClass(session.getDatasourcePlatform().getConversionManager().convertClassNameToClass(getReferenceClassName()));
346
            }
336
        }
347
        }
337
        if (getReferenceClass() != null) {
348
        if (getReferenceClass() != null) {
338
            super.initialize(session);
349
            super.initialize(session);
(-)a/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/jaxbelement/dom/element.json (+1 lines)
Added Link Here
1
{"root":{}}
(-)a/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/jaxbelement/dom/element.xml (+1 lines)
Added Link Here
1
<ns0:root xmlns:ns0="AGroupDef/annotation"/>
(-)a/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/jaxbelement/dom/text.json (+1 lines)
Added Link Here
1
{"doc":"thetext"}
(-)a/moxy/eclipselink.moxy.test/resource/org/eclipse/persistence/testing/jaxb/jaxbelement/dom/text.xml (+1 lines)
Added Link Here
1
<doc>thetext</doc>
(-)a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/JAXBTestSuite2.java (+4 lines)
Lines 26-31 import org.eclipse.persistence.testing.jaxb.inheritance.ns.JAXBInheritanceSubTyp Link Here
26
import org.eclipse.persistence.testing.jaxb.inheritance.ns.JAXBInheritanceSubTypeTestCases;
26
import org.eclipse.persistence.testing.jaxb.inheritance.ns.JAXBInheritanceSubTypeTestCases;
27
import org.eclipse.persistence.testing.jaxb.inheritance.simple.XmlValueInheritanceTestCases;
27
import org.eclipse.persistence.testing.jaxb.inheritance.simple.XmlValueInheritanceTestCases;
28
import org.eclipse.persistence.testing.jaxb.jaxbelement.complex.JAXBElementComplexTestCases;
28
import org.eclipse.persistence.testing.jaxb.jaxbelement.complex.JAXBElementComplexTestCases;
29
import org.eclipse.persistence.testing.jaxb.jaxbelement.dom.ElementTestCases;
30
import org.eclipse.persistence.testing.jaxb.jaxbelement.dom.TextNodeTestCases;
29
import org.eclipse.persistence.testing.jaxb.jaxbelement.nested.JAXBElementNestedTestCases;
31
import org.eclipse.persistence.testing.jaxb.jaxbelement.nested.JAXBElementNestedTestCases;
30
import org.eclipse.persistence.testing.jaxb.jaxbelement.nil.JAXBElementNilTestCases;
32
import org.eclipse.persistence.testing.jaxb.jaxbelement.nil.JAXBElementNilTestCases;
31
import org.eclipse.persistence.testing.jaxb.jaxbelement.simple.JAXBElementBase64TestCases;
33
import org.eclipse.persistence.testing.jaxb.jaxbelement.simple.JAXBElementBase64TestCases;
Lines 80-85 public class JAXBTestSuite2 extends TestCase { Link Here
80
        suite.addTestSuite(org.eclipse.persistence.testing.jaxb.xmlenum.XmlValueAnnotationWithEnumTestCases.class);
82
        suite.addTestSuite(org.eclipse.persistence.testing.jaxb.xmlenum.XmlValueAnnotationWithEnumTestCases.class);
81
        suite.addTestSuite(org.eclipse.persistence.testing.jaxb.xmlenum.XmlEnumChoiceObjectTestCases.class);
83
        suite.addTestSuite(org.eclipse.persistence.testing.jaxb.xmlenum.XmlEnumChoiceObjectTestCases.class);
82
        suite.addTestSuite(org.eclipse.persistence.testing.jaxb.xmlenum.XmlEnumChoiceCollectionTestCases.class);
84
        suite.addTestSuite(org.eclipse.persistence.testing.jaxb.xmlenum.XmlEnumChoiceCollectionTestCases.class);
85
        suite.addTestSuite(TextNodeTestCases.class);
86
        suite.addTestSuite(ElementTestCases.class);
83
        suite.addTestSuite(JAXBElementSimpleTestCases.class);
87
        suite.addTestSuite(JAXBElementSimpleTestCases.class);
84
        suite.addTestSuite(JAXBElementNestedTestCases.class);
88
        suite.addTestSuite(JAXBElementNestedTestCases.class);
85
        suite.addTestSuite(JAXBElementComplexTestCases.class);
89
        suite.addTestSuite(JAXBElementComplexTestCases.class);
(-)a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmltransient/ObjectWithTransient.java (+21 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2011, 2012 Oracle and/or its affiliates. All rights reserved.
3
 * This program and the accompanying materials are made available under the
4
 * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
5
 * which accompanies this distribution.
6
 * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
7
 * and the Eclipse Distribution License is available at
8
 * http://www.eclipse.org/org/documents/edl-v10.php.
9
 *
10
 * Contributors:
11
 *     Denise Smith - October 18, 2012
12
 ******************************************************************************/
13
package org.eclipse.persistence.testing.jaxb.annotations.xmltransient;
14
15
import java.util.List;
16
17
public class ObjectWithTransient {
18
    public String testString;
19
    public TransientClass transientThing;
20
    public List<TransientClass> transientThings;
21
}
(-)a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmltransient/ObjectWithTransientListTestCases.java (+195 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2011, 2012 Oracle and/or its affiliates. All rights reserved.
3
 * This program and the accompanying materials are made available under the
4
 * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
5
 * which accompanies this distribution.
6
 * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
7
 * and the Eclipse Distribution License is available at
8
 * http://www.eclipse.org/org/documents/edl-v10.php.
9
 *
10
 * Contributors:
11
 *     Denise Smith - October 18, 2012
12
 ******************************************************************************/
13
package org.eclipse.persistence.testing.jaxb.annotations.xmltransient;
14
15
import java.util.ArrayList;
16
17
import javax.xml.bind.MarshalException;
18
19
import org.eclipse.persistence.exceptions.XMLMarshalException;
20
import org.eclipse.persistence.testing.jaxb.JAXBWithJSONTestCases;
21
22
public class ObjectWithTransientListTestCases extends JAXBWithJSONTestCases{
23
 
24
    public ObjectWithTransientListTestCases(String name) throws Exception {
25
        super(name);
26
        setClasses(new Class[] { ObjectWithTransient.class });
27
    }
28
29
    @Override
30
    protected Object getControlObject() {
31
        ObjectWithTransient obj = new ObjectWithTransient();
32
        obj.testString = "theTest";
33
        TransientClass transientThing = new TransientClass();
34
        obj.transientThings = new ArrayList<TransientClass>();
35
        obj.transientThings.add(transientThing);
36
        
37
        return obj;
38
    }
39
    
40
    public boolean isUnmarshalTest(){
41
        return false;
42
    }
43
    
44
    
45
    public void testJSONMarshalToOutputStream() throws Exception{
46
        try{
47
            super.testJSONMarshalToOutputStream();
48
        }catch(MarshalException e){
49
            Throwable linkedException = e.getLinkedException();
50
            assertTrue(linkedException instanceof XMLMarshalException);
51
            Throwable actualException = ((XMLMarshalException)linkedException).getCause();
52
            assertTrue(actualException instanceof XMLMarshalException);
53
            assertEquals("Wrong XMLMarshalExcpetion was thrown",XMLMarshalException.DESCRIPTOR_NOT_FOUND_IN_PROJECT ,((XMLMarshalException)actualException).getErrorCode());
54
            return;
55
        }catch (Exception e) {
56
e.printStackTrace();
57
        }
58
        fail("An exception should have been thrown");
59
    }
60
    
61
    public void testJSONMarshalToOutputStream_FORMATTED() throws Exception{
62
        try{
63
            super.testJSONMarshalToOutputStream_FORMATTED();
64
        }catch(MarshalException e){
65
            Throwable linkedException = e.getLinkedException();
66
            assertTrue(linkedException instanceof XMLMarshalException);
67
            Throwable actualException = ((XMLMarshalException)linkedException).getCause();
68
            assertTrue(actualException instanceof XMLMarshalException);
69
            assertEquals("Wrong XMLMarshalExcpetion was thrown",XMLMarshalException.DESCRIPTOR_NOT_FOUND_IN_PROJECT ,((XMLMarshalException)actualException).getErrorCode());
70
            return;
71
        }
72
        fail("An exception should have been thrown");
73
    }
74
    
75
    public void testJSONMarshalToStringWriter() throws Exception{
76
        try{
77
            super.testJSONMarshalToStringWriter();
78
        }catch(MarshalException e){
79
            Throwable linkedException = e.getLinkedException();
80
            assertTrue(linkedException instanceof XMLMarshalException);
81
            assertEquals("Wrong XMLMarshalExcpetion was thrown",XMLMarshalException.DESCRIPTOR_NOT_FOUND_IN_PROJECT ,((XMLMarshalException)linkedException).getErrorCode());
82
            return;
83
        }
84
        fail("An exception should have been thrown");
85
    } 
86
    
87
    public void testJSONMarshalToStringWriter_FORMATTED() throws Exception{
88
        try{
89
            super.testJSONMarshalToStringWriter_FORMATTED();
90
        }catch(MarshalException e){
91
            Throwable linkedException = e.getLinkedException();
92
            assertTrue(linkedException instanceof XMLMarshalException);
93
            assertEquals("Wrong XMLMarshalExcpetion was thrown",XMLMarshalException.DESCRIPTOR_NOT_FOUND_IN_PROJECT ,((XMLMarshalException)linkedException).getErrorCode());
94
            return;
95
        }
96
        fail("An exception should have been thrown");
97
    }
98
    
99
    public void testObjectToContentHandler() throws Exception{
100
        try{
101
            super.testObjectToContentHandler();
102
        }catch(MarshalException e){
103
            Throwable linkedException = e.getLinkedException();
104
            assertTrue(linkedException instanceof XMLMarshalException);            
105
            assertEquals("Wrong XMLMarshalExcpetion was thrown",XMLMarshalException.DESCRIPTOR_NOT_FOUND_IN_PROJECT ,((XMLMarshalException)linkedException).getErrorCode());
106
            return;
107
        }
108
        fail("An exception should have been thrown");
109
    }
110
    
111
    public void testObjectToOutputStream() throws Exception{
112
        try{
113
            super.testObjectToOutputStream();
114
        }catch(MarshalException e){
115
            Throwable linkedException = e.getLinkedException();
116
            assertTrue(linkedException instanceof XMLMarshalException);
117
            Throwable actualException = ((XMLMarshalException)linkedException).getCause();
118
            assertTrue(actualException instanceof XMLMarshalException);
119
            assertEquals("Wrong XMLMarshalExcpetion was thrown",XMLMarshalException.DESCRIPTOR_NOT_FOUND_IN_PROJECT ,((XMLMarshalException)actualException).getErrorCode());
120
            return;
121
        }
122
        fail("An exception should have been thrown");
123
    }
124
    
125
    public void testObjectToOutputStreamASCIIEncoding() throws Exception{
126
        try{
127
            super.testObjectToOutputStreamASCIIEncoding();
128
        }catch(MarshalException e){
129
            Throwable linkedException = e.getLinkedException();
130
            assertTrue(linkedException instanceof XMLMarshalException);
131
            Throwable actualException = ((XMLMarshalException)linkedException).getCause();
132
            assertTrue(actualException instanceof XMLMarshalException);
133
            assertEquals("Wrong XMLMarshalExcpetion was thrown",XMLMarshalException.DESCRIPTOR_NOT_FOUND_IN_PROJECT ,((XMLMarshalException)actualException).getErrorCode());
134
            return;
135
        }
136
        fail("An exception should have been thrown");
137
    }
138
    
139
    public void testObjectToXMLDocument() throws Exception{
140
        try{
141
            super.testObjectToXMLDocument();
142
        }catch(MarshalException e){
143
            Throwable linkedException = e.getLinkedException();
144
            assertTrue(linkedException instanceof XMLMarshalException);            
145
            assertEquals("Wrong XMLMarshalExcpetion was thrown",XMLMarshalException.DESCRIPTOR_NOT_FOUND_IN_PROJECT ,((XMLMarshalException)linkedException).getErrorCode());      return;
146
        }
147
        fail("An exception should have been thrown");
148
    }
149
    
150
    public void testObjectToXMLEventWriter() throws Exception{
151
        try{
152
            super.testObjectToXMLEventWriter();
153
        }catch(MarshalException e){
154
            Throwable linkedException = e.getLinkedException();
155
            assertTrue(linkedException instanceof XMLMarshalException);            
156
            assertEquals("Wrong XMLMarshalExcpetion was thrown",XMLMarshalException.DESCRIPTOR_NOT_FOUND_IN_PROJECT ,((XMLMarshalException)linkedException).getErrorCode());     
157
            return;
158
        }
159
        fail("An exception should have been thrown");
160
    }
161
    public void testObjectToXMLStreamWriter() throws Exception{
162
        try{
163
            super.testObjectToXMLStreamWriter();
164
        }catch(MarshalException e){
165
            Throwable linkedException = e.getLinkedException();
166
            assertTrue(linkedException instanceof XMLMarshalException);            
167
            assertEquals("Wrong XMLMarshalExcpetion was thrown",XMLMarshalException.DESCRIPTOR_NOT_FOUND_IN_PROJECT ,((XMLMarshalException)linkedException).getErrorCode());
168
            return;
169
        }
170
        fail("An exception should have been thrown");
171
    }
172
    public void testObjectToXMLStreamWriterRecord() throws Exception{
173
        try{
174
            super.testObjectToXMLStreamWriterRecord();
175
        }catch(MarshalException e){
176
            Throwable linkedException = e.getLinkedException();
177
            assertTrue(linkedException instanceof XMLMarshalException);            
178
            assertEquals("Wrong XMLMarshalExcpetion was thrown",XMLMarshalException.DESCRIPTOR_NOT_FOUND_IN_PROJECT ,((XMLMarshalException)linkedException).getErrorCode());
179
            return;
180
        }
181
        fail("An exception should have been thrown");
182
    }
183
    
184
    public void testObjectToXMLStringWriter() throws Exception{
185
        try{
186
            super.testObjectToXMLStringWriter();
187
        }catch(MarshalException e){
188
            Throwable linkedException = e.getLinkedException();
189
            assertTrue(linkedException instanceof XMLMarshalException);            
190
            assertEquals("Wrong XMLMarshalExcpetion was thrown",XMLMarshalException.DESCRIPTOR_NOT_FOUND_IN_PROJECT ,((XMLMarshalException)linkedException).getErrorCode());
191
            return;
192
        }
193
        fail("An exception should have been thrown");
194
    }
195
}
(-)a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmltransient/ObjectWithTransientTestCases.java (+189 lines)
Added Link Here
1
/*******************************************************************************
2
 * Copyright (c) 2011, 2012 Oracle and/or its affiliates. All rights reserved.
3
 * This program and the accompanying materials are made available under the
4
 * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
5
 * which accompanies this distribution.
6
 * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
7
 * and the Eclipse Distribution License is available at
8
 * http://www.eclipse.org/org/documents/edl-v10.php.
9
 *
10
 * Contributors:
11
 *     Denise Smith - October 18, 2012
12
 ******************************************************************************/
13
package org.eclipse.persistence.testing.jaxb.annotations.xmltransient;
14
15
import java.util.ArrayList;
16
17
import javax.xml.bind.MarshalException;
18
19
import org.eclipse.persistence.exceptions.XMLMarshalException;
20
import org.eclipse.persistence.testing.jaxb.JAXBWithJSONTestCases;
21
22
public class ObjectWithTransientTestCases extends JAXBWithJSONTestCases{
23
24
    public ObjectWithTransientTestCases(String name) throws Exception {
25
        super(name);
26
        setClasses(new Class[] { ObjectWithTransient.class });
27
    }
28
29
    @Override
30
    protected Object getControlObject() {
31
        ObjectWithTransient obj = new ObjectWithTransient();
32
        obj.testString = "theTest";
33
        obj.transientThing = new TransientClass();
34
        return obj;
35
    }
36
    
37
    public boolean isUnmarshalTest(){
38
        return false;
39
    }
40
    
41
    public void testJSONMarshalToOutputStream() throws Exception{
42
        try{
43
            super.testJSONMarshalToOutputStream();
44
        }catch(MarshalException e){
45
            Throwable linkedException = e.getLinkedException();
46
            assertTrue(linkedException instanceof XMLMarshalException);
47
            Throwable actualException = ((XMLMarshalException)linkedException).getCause();
48
            assertTrue(actualException instanceof XMLMarshalException);
49
            assertEquals("Wrong XMLMarshalExcpetion was thrown",XMLMarshalException.DESCRIPTOR_NOT_FOUND_IN_PROJECT ,((XMLMarshalException)actualException).getErrorCode());
50
            return;
51
        }
52
        fail("An exception should have been thrown");
53
    }
54
    
55
    public void testJSONMarshalToOutputStream_FORMATTED() throws Exception{
56
        try{
57
            super.testJSONMarshalToOutputStream_FORMATTED();
58
        }catch(MarshalException e){
59
            Throwable linkedException = e.getLinkedException();
60
            assertTrue(linkedException instanceof XMLMarshalException);
61
            Throwable actualException = ((XMLMarshalException)linkedException).getCause();
62
            assertTrue(actualException instanceof XMLMarshalException);
63
            assertEquals("Wrong XMLMarshalExcpetion was thrown",XMLMarshalException.DESCRIPTOR_NOT_FOUND_IN_PROJECT ,((XMLMarshalException)actualException).getErrorCode());
64
            return;
65
        }
66
        fail("An exception should have been thrown");
67
    }
68
    
69
    public void testJSONMarshalToStringWriter() throws Exception{
70
        try{
71
            super.testJSONMarshalToStringWriter();
72
        }catch(MarshalException e){
73
            Throwable linkedException = e.getLinkedException();
74
            assertTrue(linkedException instanceof XMLMarshalException);
75
            assertEquals("Wrong XMLMarshalExcpetion was thrown",XMLMarshalException.DESCRIPTOR_NOT_FOUND_IN_PROJECT ,((XMLMarshalException)linkedException).getErrorCode());
76
            return;
77
        }
78
        fail("An exception should have been thrown");
79
    } 
80
    
81
    public void testJSONMarshalToStringWriter_FORMATTED() throws Exception{
82
        try{
83
            super.testJSONMarshalToStringWriter_FORMATTED();
84
        }catch(MarshalException e){
85
            Throwable linkedException = e.getLinkedException();
86
            assertTrue(linkedException instanceof XMLMarshalException);
87
            assertEquals("Wrong XMLMarshalExcpetion was thrown",XMLMarshalException.DESCRIPTOR_NOT_FOUND_IN_PROJECT ,((XMLMarshalException)linkedException).getErrorCode());
88
            return;
89
        }
90
        fail("An exception should have been thrown");
91
    }
92
    
93
    public void testObjectToContentHandler() throws Exception{
94
        try{
95
            super.testObjectToContentHandler();
96
        }catch(MarshalException e){
97
            Throwable linkedException = e.getLinkedException();
98
            assertTrue(linkedException instanceof XMLMarshalException);            
99
            assertEquals("Wrong XMLMarshalExcpetion was thrown",XMLMarshalException.DESCRIPTOR_NOT_FOUND_IN_PROJECT ,((XMLMarshalException)linkedException).getErrorCode());
100
            return;
101
        }
102
        fail("An exception should have been thrown");
103
    }
104
    
105
    public void testObjectToOutputStream() throws Exception{
106
        try{
107
            super.testObjectToOutputStream();
108
        }catch(MarshalException e){
109
            Throwable linkedException = e.getLinkedException();
110
            assertTrue(linkedException instanceof XMLMarshalException);
111
            Throwable actualException = ((XMLMarshalException)linkedException).getCause();
112
            assertTrue(actualException instanceof XMLMarshalException);
113
            assertEquals("Wrong XMLMarshalExcpetion was thrown",XMLMarshalException.DESCRIPTOR_NOT_FOUND_IN_PROJECT ,((XMLMarshalException)actualException).getErrorCode());
114
            return;
115
        }
116
        fail("An exception should have been thrown");
117
    }
118
    
119
    public void testObjectToOutputStreamASCIIEncoding() throws Exception{
120
        try{
121
            super.testObjectToOutputStreamASCIIEncoding();
122
        }catch(MarshalException e){
123
            Throwable linkedException = e.getLinkedException();
124
            assertTrue(linkedException instanceof XMLMarshalException);
125
            Throwable actualException = ((XMLMarshalException)linkedException).getCause();
126
            assertTrue(actualException instanceof XMLMarshalException);
127
            assertEquals("Wrong XMLMarshalExcpetion was thrown",XMLMarshalException.DESCRIPTOR_NOT_FOUND_IN_PROJECT ,((XMLMarshalException)actualException).getErrorCode());
128
            return;
129
        }
130
        fail("An exception should have been thrown");
131
    }
132
    
133
    public void testObjectToXMLDocument() throws Exception{
134
        try{
135
            super.testObjectToXMLDocument();
136
        }catch(MarshalException e){
137
            Throwable linkedException = e.getLinkedException();
138
            assertTrue(linkedException instanceof XMLMarshalException);            
139
            assertEquals("Wrong XMLMarshalExcpetion was thrown",XMLMarshalException.DESCRIPTOR_NOT_FOUND_IN_PROJECT ,((XMLMarshalException)linkedException).getErrorCode());      return;
140
        }
141
        fail("An exception should have been thrown");
142
    }
143
    
144
    public void testObjectToXMLEventWriter() throws Exception{
145
        try{
146
            super.testObjectToXMLEventWriter();
147
        }catch(MarshalException e){
148
            Throwable linkedException = e.getLinkedException();
149
            assertTrue(linkedException instanceof XMLMarshalException);            
150
            assertEquals("Wrong XMLMarshalExcpetion was thrown",XMLMarshalException.DESCRIPTOR_NOT_FOUND_IN_PROJECT ,((XMLMarshalException)linkedException).getErrorCode());     
151
            return;
152
        }
153
        fail("An exception should have been thrown");
154
    }
155
    public void testObjectToXMLStreamWriter() throws Exception{
156
        try{
157
            super.testObjectToXMLStreamWriter();
158
        }catch(MarshalException e){
159
            Throwable linkedException = e.getLinkedException();
160
            assertTrue(linkedException instanceof XMLMarshalException);            
161
            assertEquals("Wrong XMLMarshalExcpetion was thrown",XMLMarshalException.DESCRIPTOR_NOT_FOUND_IN_PROJECT ,((XMLMarshalException)linkedException).getErrorCode());
162
            return;
163
        }
164
        fail("An exception should have been thrown");
165
    }
166
    public void testObjectToXMLStreamWriterRecord() throws Exception{
167
        try{
168
            super.testObjectToXMLStreamWriterRecord();
169
        }catch(MarshalException e){
170
            Throwable linkedException = e.getLinkedException();
171
            assertTrue(linkedException instanceof XMLMarshalException);            
172
            assertEquals("Wrong XMLMarshalExcpetion was thrown",XMLMarshalException.DESCRIPTOR_NOT_FOUND_IN_PROJECT ,((XMLMarshalException)linkedException).getErrorCode());
173
            return;
174
        }
175
        fail("An exception should have been thrown");
176
    }
177
    
178
    public void testObjectToXMLStringWriter() throws Exception{
179
        try{
180
            super.testObjectToXMLStringWriter();
181
        }catch(MarshalException e){
182
            Throwable linkedException = e.getLinkedException();
183
            assertTrue(linkedException instanceof XMLMarshalException);            
184
            assertEquals("Wrong XMLMarshalExcpetion was thrown",XMLMarshalException.DESCRIPTOR_NOT_FOUND_IN_PROJECT ,((XMLMarshalException)linkedException).getErrorCode());
185
            return;
186
        }
187
        fail("An exception should have been thrown");
188
    }
189
}
(-)a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/annotations/xmltransient/XmlTransientTestSuite.java (+2 lines)
Lines 26-31 public class XmlTransientTestSuite extends TestCase { Link Here
26
        suite.addTestSuite(PropOrderTestCases.class);
26
        suite.addTestSuite(PropOrderTestCases.class);
27
        suite.addTestSuite(TransientClassTestCases.class);
27
        suite.addTestSuite(TransientClassTestCases.class);
28
        suite.addTestSuite(PropertyOverrideTestCases.class);
28
        suite.addTestSuite(PropertyOverrideTestCases.class);
29
        suite.addTestSuite(ObjectWithTransientTestCases.class);
30
        suite.addTestSuite(ObjectWithTransientListTestCases.class);
29
        return suite;
31
        return suite;
30
    }
32
    }
31
33
(-)a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/jaxbelement/dom/ElementTestCases.java (+41 lines)
Added Link Here
1
package org.eclipse.persistence.testing.jaxb.jaxbelement.dom;
2
3
import javax.xml.bind.JAXBElement;
4
import javax.xml.parsers.DocumentBuilderFactory;
5
6
import org.eclipse.persistence.testing.jaxb.JAXBWithJSONTestCases;
7
import org.w3c.dom.Document;
8
import org.w3c.dom.Element;
9
10
public class ElementTestCases extends JAXBWithJSONTestCases{
11
12
    private final static String XML_RESOURCE = "org/eclipse/persistence/testing/jaxb/jaxbelement/dom/element.xml";
13
    private final static String JSON_RESOURCE = "org/eclipse/persistence/testing/jaxb/jaxbelement/dom/element.json";
14
15
    
16
    public ElementTestCases(String name) throws Exception {
17
        super(name);
18
        setContextPath("org.eclipse.persistence.testing.jaxb.jaxbelement.dom");
19
        setControlDocument(XML_RESOURCE);
20
        setControlJSON(JSON_RESOURCE);
21
    }
22
23
    @Override
24
    protected Object getControlObject() {
25
        ObjectFactory factory = new ObjectFactory();
26
        Document doc;
27
        try {
28
            doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();                 
29
            Element elm = doc.createElementNS("AGroupDef/annotation", "rootchild");
30
            elm.setTextContent("");
31
            JAXBElement  obj = factory.createRoot(elm);
32
            return obj;
33
        } catch (Exception e) {
34
            e.printStackTrace();
35
            fail("An exception was thrown.");            
36
            return null;
37
        }
38
    }
39
    
40
41
}
(-)a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/jaxbelement/dom/ObjectFactory.java (+62 lines)
Added Link Here
1
//
2
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, vhudson-jaxb-ri-2.2-147 
3
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
4
// Any modifications to this file will be lost upon recompilation of the source schema. 
5
// Generated on: 2012.10.18 at 09:37:32 AM EDT 
6
//
7
8
9
package org.eclipse.persistence.testing.jaxb.jaxbelement.dom;
10
11
import javax.xml.bind.JAXBElement;
12
import javax.xml.bind.annotation.XmlElementDecl;
13
import javax.xml.bind.annotation.XmlRegistry;
14
import javax.xml.namespace.QName;
15
16
17
/**
18
 * This object contains factory methods for each 
19
 * Java content interface and Java element interface 
20
 * generated in the generated package. 
21
 * <p>An ObjectFactory allows you to programatically 
22
 * construct new instances of the Java representation 
23
 * for XML content. The Java representation of XML 
24
 * content can consist of schema derived interfaces 
25
 * and classes representing the binding of schema 
26
 * type definitions, element declarations and model 
27
 * groups.  Factory methods for each of these are 
28
 * provided in this class.
29
 * 
30
 */
31
@XmlRegistry
32
public class ObjectFactory {
33
34
    private final static QName _Doc_QNAME = new QName("", "doc");
35
    private final static QName _Root_QNAME = new QName("AGroupDef/annotation", "root");
36
37
    /**
38
     * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: generated
39
     * 
40
     */
41
    public ObjectFactory() {
42
    }
43
44
    /**
45
     * Create an instance of {@link JAXBElement }{@code <}{@link Object }{@code >}}
46
     * 
47
     */
48
    @XmlElementDecl(namespace = "", name = "doc")
49
    public JAXBElement<Object> createDoc(Object value) {
50
        return new JAXBElement<Object>(_Doc_QNAME, Object.class, null, value);
51
    }
52
    
53
    /**
54
     * Create an instance of {@link JAXBElement }{@code <}{@link Object }{@code >}}
55
     * 
56
     */
57
    @XmlElementDecl(namespace = "AGroupDef/annotation", name = "root")
58
    public JAXBElement<Object> createRoot(Object value) {
59
        return new JAXBElement<Object>(_Root_QNAME, Object.class, null, value);
60
    }
61
62
}
(-)a/moxy/eclipselink.moxy.test/src/org/eclipse/persistence/testing/jaxb/jaxbelement/dom/TextNodeTestCases.java (+43 lines)
Added Link Here
1
package org.eclipse.persistence.testing.jaxb.jaxbelement.dom;
2
3
import javax.xml.bind.JAXBElement;
4
import javax.xml.parsers.DocumentBuilderFactory;
5
import javax.xml.parsers.ParserConfigurationException;
6
7
import org.eclipse.persistence.testing.jaxb.JAXBWithJSONTestCases;
8
import org.w3c.dom.Document;
9
import org.w3c.dom.Element;
10
11
public class TextNodeTestCases extends JAXBWithJSONTestCases{
12
13
    private final static String XML_RESOURCE = "org/eclipse/persistence/testing/jaxb/jaxbelement/dom/text.xml";
14
    private final static String JSON_RESOURCE = "org/eclipse/persistence/testing/jaxb/jaxbelement/dom/text.json";
15
16
    
17
    public TextNodeTestCases(String name) throws Exception {
18
        super(name);
19
        setContextPath("org.eclipse.persistence.testing.jaxb.jaxbelement.dom");
20
        setControlDocument(XML_RESOURCE);
21
        setControlJSON(JSON_RESOURCE);
22
    }
23
24
    @Override
25
    protected Object getControlObject() {
26
        ObjectFactory factory = new ObjectFactory();
27
        Document doc;
28
        try {
29
            doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();       
30
            Element elm = doc.createElementNS(null, "abcdef");
31
            elm.setTextContent("thetext");
32
            Object value = elm;
33
            JAXBElement  obj = factory.createDoc(value);
34
            return obj;
35
        } catch (Exception e) {
36
            e.printStackTrace();
37
            fail("An exception was thrown.");            
38
            return null;
39
        }
40
    }
41
    
42
43
}
(-)a/moxy/org.eclipse.persistence.moxy/src/org/eclipse/persistence/jaxb/compiler/AnnotationsProcessor.java (-20 / +38 lines)
Lines 834-840 public class AnnotationsProcessor { Link Here
834
                JavaClass typeClass = property.getActualType();
834
                JavaClass typeClass = property.getActualType();
835
                TypeInfo targetInfo = typeInfo.get(typeClass.getQualifiedName());
835
                TypeInfo targetInfo = typeInfo.get(typeClass.getQualifiedName());
836
                if (targetInfo != null && targetInfo.isTransient() && property.getXmlElements() == null) {
836
                if (targetInfo != null && targetInfo.isTransient() && property.getXmlElements() == null) {
837
                    throw JAXBException.invalidReferenceToTransientClass(jClass.getQualifiedName(), property.getPropertyName(), typeClass.getQualifiedName());
837
                    property.setTransientType(true);
838
                }
838
                }
839
                // only one XmlValue is allowed per class, and if there is one
839
                // only one XmlValue is allowed per class, and if there is one
840
                // only XmlAttributes are allowed
840
                // only XmlAttributes are allowed
Lines 1825-1850 public class AnnotationsProcessor { Link Here
1825
        property.setElement(javaHasAnnotations);
1825
        property.setElement(javaHasAnnotations);
1826
1826
1827
        // if there is a TypeInfo for ptype check it for transient, otherwise
1827
        // if there is a TypeInfo for ptype check it for transient, otherwise
1828
        // check the class
1828
        // check the class        
1829
        TypeInfo pTypeInfo = typeInfo.get(ptype.getQualifiedName());
1829
        if (isCollectionType(ptype)) {
1830
        if ((pTypeInfo != null && !pTypeInfo.isTransient()) || !helper.isAnnotationPresent(ptype, XmlTransient.class)) {
1830
            JavaClass componentType = helper.getJavaClass(Object.class);;
1831
            property.setType(ptype);
1831
            if(ptype.hasActualTypeArguments()){
1832
        } else {
1832
                ArrayList typeArgs =  (ArrayList) ptype.getActualTypeArguments();
1833
            JavaClass parent = ptype.getSuperclass();
1833
                if(typeArgs.size() > 0) {
1834
            while (parent != null) {
1834
                    componentType = (JavaClass) typeArgs.get(0);                    
1835
                if (parent.getName().equals(JAVA_LANG_OBJECT)) {
1835
                } 
1836
                    property.setType(parent);
1837
                    break;
1838
                }
1839
                // if there is a TypeInfo for parent check it for transient,
1840
                // otherwise check the class
1841
                TypeInfo parentTypeInfo = typeInfo.get(parent.getQualifiedName());
1842
                if ((parentTypeInfo != null && !parentTypeInfo.isTransient()) || !helper.isAnnotationPresent(parent, XmlTransient.class)) {
1843
                    property.setType(parent);
1844
                    break;
1845
                }
1846
                parent = parent.getSuperclass();
1847
            }
1836
            }
1837
            
1838
            updatePropertyType(property, ptype, componentType);
1839
        }else{
1840
            updatePropertyType(property, ptype, ptype);
1848
        }
1841
        }
1849
        if((ptype.isArray()  && !areEquals(ptype, byte[].class))  || (property.isCollectionType(ptype) && !helper.isAnnotationPresent(javaHasAnnotations, XmlList.class)) ){
1842
        if((ptype.isArray()  && !areEquals(ptype, byte[].class))  || (property.isCollectionType(ptype) && !helper.isAnnotationPresent(javaHasAnnotations, XmlList.class)) ){
1850
        	property.setNillable(true);
1843
        	property.setNillable(true);
Lines 1958-1963 public class AnnotationsProcessor { Link Here
1958
        return property;
1951
        return property;
1959
    }
1952
    }
1960
1953
1954
    
1955
    private void updatePropertyType(Property property, JavaClass ptype, JavaClass componentType){
1956
        TypeInfo componentTypeInfo = typeInfo.get(componentType);
1957
        if((componentTypeInfo != null && !componentTypeInfo.isTransient()) || !helper.isAnnotationPresent(componentType, XmlTransient.class)){
1958
            property.setType(ptype);
1959
        }else{
1960
            JavaClass parent = componentType.getSuperclass();
1961
            while (parent != null) {
1962
                if (parent.getName().equals(JAVA_LANG_OBJECT)) {
1963
                    property.setTransientType(true);
1964
                    property.setType(ptype);
1965
                    break;
1966
                }
1967
                // if there is a TypeInfo for parent check it for transient,
1968
                // otherwise check the class
1969
                TypeInfo parentTypeInfo = typeInfo.get(parent.getQualifiedName());
1970
                if ((parentTypeInfo != null && !parentTypeInfo.isTransient()) || !helper.isAnnotationPresent(parent, XmlTransient.class)) {
1971
                    property.setType(parent);
1972
                    break;
1973
                }
1974
                parent = parent.getSuperclass();
1975
            }
1976
        }
1977
    }
1978
    
1961
    /**
1979
    /**
1962
     * Build a new 'choice' property. Here, we flag a new property as a 'choice'
1980
     * Build a new 'choice' property. Here, we flag a new property as a 'choice'
1963
     * and create/set an XmlModel XmlElements object based on the @XmlElements
1981
     * and create/set an XmlModel XmlElements object based on the @XmlElements
(-)a/moxy/org.eclipse.persistence.moxy/src/org/eclipse/persistence/jaxb/compiler/MappingsGenerator.java (-1 / +7 lines)
Lines 1282-1287 public class MappingsGenerator { Link Here
1282
        } else {
1282
        } else {
1283
        	mapping.setReferenceClassName(referenceClassName);
1283
        	mapping.setReferenceClassName(referenceClassName);
1284
        }
1284
        }
1285
            if(property.isTransientType()){
1286
                mapping.setReferenceClassName(XMLConstants.UNKNOWN_OR_TRANSIENT_CLASS);
1287
            }
1285
1288
1286
        if (property.getInverseReferencePropertyName() != null) {
1289
        if (property.getInverseReferencePropertyName() != null) {
1287
            mapping.setContainerAttributeName(property.getInverseReferencePropertyName());
1290
            mapping.setContainerAttributeName(property.getInverseReferencePropertyName());
Lines 1988-1999 public class MappingsGenerator { Link Here
1988
        XMLField xmlField = getXPathForField(property, namespaceInfo, false);
1991
        XMLField xmlField = getXPathForField(property, namespaceInfo, false);
1989
        mapping.setXPath(xmlField.getXPath());
1992
        mapping.setXPath(xmlField.getXPath());
1990
1993
1991
        if (referenceClassName == null){
1994
        if (referenceClassName == null){                   
1992
        	((XMLField)mapping.getField()).setIsTypedTextField(true);
1995
        	((XMLField)mapping.getField()).setIsTypedTextField(true);
1993
        	((XMLField)mapping.getField()).setSchemaType(XMLConstants.ANY_TYPE_QNAME);
1996
        	((XMLField)mapping.getField()).setSchemaType(XMLConstants.ANY_TYPE_QNAME);
1994
        } else {
1997
        } else {
1995
        	mapping.setReferenceClassName(referenceClassName);
1998
        	mapping.setReferenceClassName(referenceClassName);
1996
        }
1999
        }
2000
        if(property.isTransientType()){
2001
            mapping.setReferenceClassName(XMLConstants.UNKNOWN_OR_TRANSIENT_CLASS);   
2002
        }    
1997
2003
1998
        if (property.isRequired()) {
2004
        if (property.isRequired()) {
1999
            ((XMLField) mapping.getField()).setRequired(true);
2005
            ((XMLField) mapping.getField()).setRequired(true);
(-)a/moxy/org.eclipse.persistence.moxy/src/org/eclipse/persistence/jaxb/compiler/Property.java (+12 lines)
Lines 139-146 public class Property implements Cloneable { Link Here
139
    private List<XmlJoinNodes> xmlJoinNodesList;
139
    private List<XmlJoinNodes> xmlJoinNodesList;
140
    private boolean isSuperClassProperty;
140
    private boolean isSuperClassProperty;
141
141
142
    private boolean isTransientType;
142
    private static final String MARSHAL_METHOD_NAME = "marshal";
143
    private static final String MARSHAL_METHOD_NAME = "marshal";
143
    
144
    
145
    
144
    public Property() {}
146
    public Property() {}
145
147
146
    public Property(Helper helper) {
148
    public Property(Helper helper) {
Lines 407-412 public class Property implements Cloneable { Link Here
407
        return isRequired;
409
        return isRequired;
408
    }
410
    }
409
    
411
    
412
413
414
    public boolean isTransientType() {
415
        return isTransientType;
416
    }
417
418
    public void setTransientType(boolean isTransientType) {
419
        this.isTransientType = isTransientType;
420
    }
421
410
    public void setIsRequired(boolean b) {
422
    public void setIsRequired(boolean b) {
411
        isRequired = b;
423
        isRequired = b;
412
    }
424
    }

Return to bug 383424