Skip to content

Commit a563e73

Browse files
hansonrhansonr
authored andcommitted
adds @XmlTransient
1 parent 377f1ad commit a563e73

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

sources/net.sf.j2s.core/src/net/sf/j2s/core/Java2ScriptVisitor.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@
132132
import org.eclipse.jdt.core.dom.WhileStatement;
133133
import org.eclipse.jdt.core.dom.WildcardType;
134134

135+
// BH 10/27/2018 -- 3.2.4.01 support for JAXB FIELD+propOrder and NONE types
135136
// BH 9/28/2018 -- 3.2.4.00 adds minimal support for JAXB
136137
// BH 9/23/2018 -- 3.2.3.00 adds support for java.applet.Applet and java.awt.* controls without use of a2s.*
137138
// BH 9/16/2018 -- 3.2.2.06 removes "$" in JApplet public method alternative name

sources/net.sf.j2s.java.core/src/swingjs/xml/JSJAXBField.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ void setNode(DOMNode node) {
8787
String methodNameGet;
8888
String javaClassName;
8989

90+
boolean isTransient;
9091
boolean isAttribute;
9192
boolean isXmlID;
9293
boolean isXmlIDREF;
@@ -341,6 +342,9 @@ else if (data.indexOf("PROPERTY") >= 0)
341342
*/
342343
private void processFieldAnnotation(JSJAXBClass jaxbClass, String tag, String data) {
343344
switch (tag) {
345+
case "@XmlTransient":
346+
isTransient = true;
347+
return;
344348
case "@XmlAttribute":
345349
isAttribute = true;
346350
qualifiedName = getName(tag);

sources/net.sf.j2s.java.core/src/swingjs/xml/JSJAXBMarshaller.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ private void addFields(JSJAXBClass jaxbClass, boolean isAttribute) throws JAXBEx
237237
}
238238

239239
private void addField(JSJAXBField field) throws JAXBException {
240-
if (field != null)
240+
if (field != null && !field.isTransient)
241241
addFieldListable(field, field.getValue(), field.holdsObjects != JSJAXBField.NO_OBJECT);
242242
}
243243

0 commit comments

Comments
 (0)