[x3d-public] Compiling X3DJSONLD's JavaSerializer.js and X3dToJava.xslt created files. addValue/removeValue on MetadataSet

John Carlson yottzumm at gmail.com
Fri Jan 15 21:55:35 PST 2021


I attempted to compile all my Java generated code to byte code, and I 
got the following errors:


coderextreme at CarlsonComputer:~/X3DJSONLD/src/main/java/net/coderextreme/data 
(coderextreme indicates my generated code)

$ javac -J-Xss1g -cp /home/coderextreme/pythonSAI/X3DJSAIL.4.0.full.jar 
*java
BoxManAnimationPanel.java:168: error: void cannot be dereferenced
           .addComments(new CommentsBlock("# sacrum (12) # l_thigh (28) 
# l_calf (24) # l_hindfoot (8) # l_middistal (8) # r_thigh (28) # r_calf 
(24) # r_hindfoot (8) # r_middistal (8) # l5 (20) # skull (8) # 
l_upperarm (8) # l_forearm (8) # l_hand (8) # r_upperarm (8) # r_forearm 
(8) # r_hand (8)"))
           ^
BoxMan.java:170: error: void cannot be dereferenced
           .addComments(new CommentsBlock("# sacrum (12) # l_thigh (28) 
# l_calf (24) # l_hindfoot (8) # l_middistal (8) # r_thigh (28) # r_calf 
(24) # r_hindfoot (8) # r_middistal (8) # l5 (20) # skull (8) # 
l_upperarm (8) # l_forearm (8) # l_hand (8) # r_upperarm (8) # r_forearm 
(8) # r_hand (8)"))
           ^
HAnimModelFootLeft.java:341: error: void cannot be dereferenced
           .addJoints(new HAnimJoint().setUSE("hanim_humanoid_root"))
           ^
3 errors


Source code is available at https://github.com/coderextreme/X3DJSONLD 
(master branch).


While I have not investigated closely, I suspect there are some methods 
that are returning void. Of note, these are all HAnim files, and are 
more recent files to my collection.


In particular, in X3DJSAIL are the following two methods:

HAnimHumanoid.java:    public void 
addSkeleton(org.web3d.x3d.sai.Core.X3DNode[] newValue)
HAnimHumanoid.java:    public void 
setSkeleton(org.web3d.x3d.sai.Core.X3DNode newValue)

Don's code uses addSkeleton (probably another method) and mine uses 
setSkeleton.  Indeed, here it is:

HAnimHumanoid.java:    public HAnimHumanoid 
addSkeleton(org.web3d.x3d.sai.Core.X3DNode newValue)

On these three X3D files, Don's java code is some what better, but does 
not really indicate where to proceed:

coderextreme at CarlsonComputer:~/X3DJSONLD/src/main/java/net/x3djsonld/data

$ javac -J-Xss1g -cp /home/coderextreme/pythonSAI/X3DJSAIL.4.0.full.jar 
~/Downloads/BoxManAnimationPanel.java BoxMan.java HAnimModelFootLeft.java
/home/coderextreme/Downloads/BoxManAnimationPanel.java:211: error: code 
too large
     public final void initialize()
                       ^
1 error


One may wish to compile the rest of Don's generated code in the 
"net/x3djsonld/data/*java" folder above to see what else might have 
problems. I got over 100 errors, possibly indicating needed upgrades to 
X3dToJava.xslt.  I am reluctant to report these errors (Some are the 
LOA*.java files, originally translated from VRML wrl files, which I 
believe came from the HAnim standard.  You can see the original VRML 
files in my X3DJSONLD/src/main/data/LOA*wrl) because the X3D files need 
or don't pass validation (the HAnim part of the schematron), and I don't 
have a good command-line validator which fits my workflow--I do, but 
it's for JSON. I think Don offered an ant solution at one point. I will 
need to look into that again.

I have made modifications to JavaSerializer.js to change setSkeleton to 
addSkeleton, but I have not checked in changes yet!

With that change, I get the following:


coderextreme at CarlsonComputer:~/X3DJSONLD/src/main/java/net/coderextreme/data

$ javac -J-Xss1g -cp /home/coderextreme/pythonSAI/X3DJSAIL.4.0.full.jar 
*java
BoxManAnimationPanel.java:205: error: void cannot be dereferenced
           .addViewpoints(new 
HAnimSite().setName("BoxMan_view").setDEF("boxman_BoxMan_view")
           ^
1 error

I changed setSkin to addSkin, similar to Don:

coderextreme at CarlsonComputer:~/X3DJSONLD/src/main/java/net/coderextreme/data$ 
!919
javac -J-Xss1g -cp /home/coderextreme/pythonSAI/X3DJSAIL.4.0.full.jar *java
HAnimSpecificationLOA3Motion.java:45: error: code too large
     public X3D initialize() {
                ^
HelloWorldProgramOutput.java:126: error: void cannot be dereferenced
                 .addValue(new 
MetadataString().setName("extraChildTest").setValue(new 
org.web3d.x3d.jsail.fields.MFString(new MFString9().getArray()))))
                 ^
2 errors

I'm going to check out the other HAnim code for now. I need to replace 
setValue with addValue, but I think I'll sleep on it a while to come to 
a good solution.


So many nodes (in 3.3) have addChildren/removeChildren fields. Does 
MetadataSet need addValue/removeValue fields?


Thanks,


John





More information about the x3d-public mailing list