Skip to content

Commit fa83f71

Browse files
hansonrhansonr
authored andcommitted
JAXB annotation marshaller first-pass complete
- full namespace support - uses BigInteger for xs:integer - correctly assigns Java primitive types in List and Map - implements all xmlSchemas for dates - implements @XmlAccessorType NONE fully and @XmlAccessorType FIELD with propOrder. - untested for implicit method access.
1 parent 6033b9c commit fa83f71

32 files changed

+7370
-5921
lines changed
27.3 KB
Binary file not shown.
79 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20181007153006
1+
20181014234526
27.3 KB
Binary file not shown.
79 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20181007153006
1+
20181014234526

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

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5353,9 +5353,8 @@ private Object checkAnnotations(BodyDeclaration node, String tagName) {
53535353
) {
53545354
if (class_annotations == null)
53555355
class_annotations = new ArrayList<ClassAnnotation>();
5356-
ClassAnnotation ann = ClassAnnotation.newAnnotation(qName, annotation, node);
5357-
if (ann != null)
5358-
class_annotations.add(ann);
5356+
ClassAnnotation ann = new ClassAnnotation(qName, annotation, node);
5357+
class_annotations.add(ann);
53595358
}
53605359
}
53615360
}
@@ -6128,12 +6127,6 @@ static class ClassAnnotation {
61286127
protected Annotation annotation;
61296128
private String qName;
61306129

6131-
public static ClassAnnotation newAnnotation(String qName, Annotation annotation, BodyDeclaration node) {
6132-
6133-
// TODO Auto-generated method stub
6134-
return null;
6135-
}
6136-
61376130
protected ClassAnnotation(String qName, Annotation annotation, BodyDeclaration node) {
61386131
System.out.println(">>>>" + qName + " " + annotation.getClass().getName() + " " + annotation);
61396132
this.qName = qName;
@@ -6150,6 +6143,20 @@ public static void addClassAnnotations(List<ClassAnnotation> class_annotations,
61506143
String str = a.annotation.toString();
61516144
if (str.startsWith("@SuppressWarnings"))
61526145
continue;
6146+
// if (str.indexOf(".class") >= 0) {
6147+
// System.out.println(str + " >>" + a.annotation.getClass().getName());
6148+
// if (a.annotation instanceof SingleMemberAnnotation) {
6149+
// SingleMemberAnnotation ann = (SingleMemberAnnotation) a.annotation;
6150+
// Expression e = ann.getValue();
6151+
// System.out.println(e + " >>" + e.getClass().getName());
6152+
// str += e.getClass().getName();
6153+
// if (e instanceof TypeLiteral)
6154+
// str += "==" + ((TypeLiteral) e).getType().resolveBinding().getClass().getName();
6155+
// } else if (a.annotation instanceof NormalAnnotation) {
6156+
// NormalAnnotation an = (NormalAnnotation) a.annotation;
6157+
// str += "====" + an.resolveAnnotationBinding().getAllMemberValuePairs()[0].getValue();
6158+
// }
6159+
// }
61536160
String nodeType = a.qName;
61546161
String varName = null;
61556162
if (a.node instanceof FieldDeclaration) {
10.2 KB
Binary file not shown.

sources/net.sf.j2s.java.core/src/javax/xml/datatype/DatatypeFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ protected DatatypeFactory() {
3131
}
3232

3333
public static DatatypeFactory newInstance() throws DatatypeConfigurationException {
34-
return (DatatypeFactory) Interface.getInstance("org.apache.xerces.jaxp.datatype.DatatypeFactoryImpl", false);
34+
return (DatatypeFactory) Interface.getInstance("swingjs.JSJAXBDatatypeFactory", false);
3535
}
3636

3737
public abstract Duration newDuration(String s);

sources/net.sf.j2s.java.core/src/org/apache/xerces/jaxp/datatype/XMLGregorianCalendarImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ protected XMLGregorianCalendarImpl(
601601
* @param millisecond of <code>XMLGregorianCalendar</code> to be created.
602602
* @param timezone of <code>XMLGregorianCalendar</code> to be created.
603603
*/
604-
private XMLGregorianCalendarImpl(
604+
protected XMLGregorianCalendarImpl(
605605
int year,
606606
int month,
607607
int day,

0 commit comments

Comments
 (0)