Skip to content

Commit 8b6f1f0

Browse files
hansonrhansonr
authored andcommitted
additional JAXB work
- ObjectFactory - package-info - class discovery/resolution Note that JavaScript cannot get a file list from a package, so one or the other, context set up unmarshal method must specify a Class or Class[], not just a path.
1 parent fe8c7c3 commit 8b6f1f0

28 files changed

+1672
-447
lines changed
-7 Bytes
Binary file not shown.
709 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20181101233424
1+
20181103123755
-7 Bytes
Binary file not shown.
709 Bytes
Binary file not shown.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
20181101233424
1+
20181103123755

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

Lines changed: 125 additions & 59 deletions
Large diffs are not rendered by default.
-7 Bytes
Binary file not shown.

sources/net.sf.j2s.java.core/src/javajs/util/OC.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,12 @@ public String closeChannel() {
351351
Object data = (sb == null ? toByteArray() : sb.toString());
352352
if (_function == null) {
353353
Object info = /** @j2sNative { isBinary : (this.sb == null) } || */ null;
354-
J2S.doAjax(fileName, null, data, info);
354+
String mimetype = null;
355+
if (bytes != null && Rdr.isZipB(bytes)) {
356+
mimetype= "application/zip";
357+
}
358+
359+
J2S.doAjax(fileName, mimetype, data, info);
355360
} else {
356361
J2S.applyFunc(_function, data);
357362
}

sources/net.sf.j2s.java.core/src/javax/xml/bind/ContextFinder.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -326,16 +326,16 @@ static JAXBContext find(String factoryId,
326326
Class[] contextPathClasses = ModuleUtil.getClassesFromContextPath(contextPath, classLoader);
327327

328328
//first try with classloader#getResource
329-
String factoryClassName = jaxbProperties(contextPath, classLoader, factoryId);
330-
if (factoryClassName == null && contextPathClasses != null) {
331-
//try with class#getResource
332-
factoryClassName = jaxbProperties(contextPathClasses, factoryId);
333-
}
334-
335-
if (factoryClassName != null) {
336-
return newInstance(contextPath, contextPathClasses, factoryClassName, classLoader, properties);
337-
}
338-
329+
String factoryClassName = null;//jaxbProperties(contextPath, classLoader, factoryId);
330+
// if (factoryClassName == null && contextPathClasses != null) {
331+
// //try with class#getResource
332+
// factoryClassName = jaxbProperties(contextPathClasses, factoryId);
333+
// }
334+
//
335+
// if (factoryClassName != null) {
336+
// return newInstance(contextPath, contextPathClasses, factoryClassName, classLoader, properties);
337+
// }
338+
//
339339

340340
String factoryName = classNameFromSystemProperties();
341341
if (factoryName != null) return newInstance(contextPath, contextPathClasses, factoryName, classLoader, properties);

0 commit comments

Comments
 (0)