[x3d-public] MFString as field value of value of MetadataString

John Carlson yottzumm at gmail.com
Sun Mar 14 01:47:09 PST 2021


I have the following Java code:

grep humanoidVersion net/*/data/Kor*Mot*java|grep set
net/coderextreme/data/KoreanCharacterMotionAnnexC01Jin.java: 
.setValue(new MetadataString().setName("humanoidVersion").setValue(new 
org.web3d.x3d.jsail.fields.MFString(new MFString0().getArray()))))
net/coderextreme/data/KoreanCharacterMotionAnnexD01Jin.java: 
.setValue(new MetadataString().setName("humanoidVersion").setValue(new 
org.web3d.x3d.jsail.fields.MFString(new MFString0().getArray()))))
net/x3djsonld/data/KoreanCharacterMotionAnnexC01Jin.java: 
.setMetadata(new 
MetadataString().setName("humanoidVersion").setValue(new String[] {"2.0"})))
net/x3djsonld/data/KoreanCharacterMotionAnnexD01Jin.java: 
.setMetadata(new 
MetadataString().setName("humanoidVersion").setValue(new String[] {"2.0"})))


As far as I can tell, the former 2 work, and the latter 2 do not.  Your 
mileage may vary.


The former two were generated by the JavaSerializer.js in X3DJSONLD.

The latter two were generate by the X3dToJava.xslt on sourceforge.


Source code (X3D) appears here:


https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/HumanoidAnimation/Specifications/


What I'm wondering is, should setValue take an MFString as input.


In:

/c/x3d-code/www.web3d.org/x3d/stylesheets/java/src/org/web3d/x3d/sai/Core/MetadataString.java


Appears:

public MetadataString setValue(String[] newValue);


X3DUOM says:

       <ConcreteNode name="MetadataString">
          <InterfaceDefinition 
specificationUrl="https://www.web3d.org/specifications/X3Dv4Draft/ISO-IEC19775-1v4-WD3/Part01/components/core.html#MetadataString"
                               appinfo="The metadata provided by this 
node is contained in the strings of the value field.">
             <componentInfo name="Core" level="1"/>
             <Inheritance baseType="X3DNode"/>
             <AdditionalInheritance baseType="X3DMetadataObject"/>
             <field name="name"
                    type="SFString"
                    accessType="inputOutput"
                    inheritedFrom="X3DMetadataObject"
                    description="Depending on the metadata vocabulary, 
the attribute name is usually required for metadata nodes."/>
             <field name="value"
                    type="MFString"
                    accessType="inputOutput"
                    description="The value attribute is a strictly typed 
data array providing relevant metadata information."/>


So it seems like SAI would support MFString.


Indeed in X3DJSAIL:

/c/x3d-code/www.web3d.org/x3d/stylesheets/java/src/org/web3d/x3d/jsail/Core$ 
grep setValue *|grep MetadataString|grep public
MetadataString.java:    public MetadataString setValue(String[] newValue)
MetadataString.java:    public MetadataString setValue(MFString newValue)
MetadataString.java:    public MetadataString setValue(SFString newValue)
MetadataString.java:    public MetadataString setValue(String newValue)
MetadataString.java:    public MetadataString setValue(ArrayList<String> 
newValue)


Halp!

One Java source code file attached.


Here's the javac console errors:

coderextreme at coderextreme-Kubuntu20:~/X3DJSONLD/src/main/java$ javac -cp 
~/pythonSAI/X3DJSAIL.4.0.full.jar:. 
net/coderextreme/data/KoreanCharacterMotion*java
net/coderextreme/data/KoreanCharacterMotionAnnexC01Jin.java:72: error: 
'void' type not allowed here
             .setValue(new 
MetadataString().setName("humanoidVersion").setValue(new 
org.web3d.x3d.jsail.fields.MFString(new MFString0().getArray()))))
                      ^
net/coderextreme/data/KoreanCharacterMotionAnnexD01Jin.java:72: error: 
'void' type not allowed here
             .setValue(new 
MetadataString().setName("humanoidVersion").setValue(new 
org.web3d.x3d.jsail.fields.MFString(new MFString0().getArray()))))

                      ^


2 errors

Suggestions for improving code generation welcome. X3dToJava.xslt seems 
to do fine, until you run the generated Java code--the errors here are 
elsewhere.

coderextreme at coderextreme-Kubuntu20:~/X3DJSONLD/src/main/java$ java -cp 
~/pythonSAI/X3DJSAIL.4.0.full.jar:. 
net.x3djsonld.data.KoreanCharacterMotionAnnexC01Jin
Java program "KoreanCharacterMotionAnnexC01Jin" self-validation test 
results: ERROR_ILLEGAL_VALUE: HAnimSegment DEF='hanim_sacrum' 
name='sacrum' illegal parent found: HAnimJoint 
name='hanim_humanoid_root' name='humanoid_root'
coderextreme at coderextreme-Kubuntu20:~/X3DJSONLD/src/main/java$ java -cp 
~/pythonSAI/X3DJSAIL.4.0.full.jar:. 
net.x3djsonld.data.KoreanCharacterMotionAnnexD01Jin
Java program "KoreanCharacterMotionAnnexD01Jin" self-validation test 
results: ERROR_ILLEGAL_VALUE: HAnimSegment DEF='hanim_sacrum' 
name='sacrum' illegal parent found: HAnimJoint 
name='hanim_humanoid_root' name='humanoid_root'

John



-------------- next part --------------
A non-text attachment was scrubbed...
Name: KoreanCharacterMotionAnnexD01Jin.java
Type: text/x-java
Size: 147247 bytes
Desc: not available
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20210314/255e338f/attachment-0001.bin>


More information about the x3d-public mailing list