[x3d-public] fieldValue.setIS()? Is this valid X3D?

John Carlson yottzumm at gmail.com
Sat Aug 28 17:16:33 PDT 2021


My code and Don's code has been sync'ed up now I think.  We get similar 
issues in verbose mode.  I guess there's no real good way for treating 
an IS like an  X3DNode?  What about creating a "setIS" on fieldValue 
with the IS as a parameter?  That was my first guess at what to do.   
Any feedback on adding a public method setIS(IS) on the fieldValue 
class?  Then I can get rid of the first special case below. I am working 
on statement inheritance in X3DUOM right now, attempting to make some 
statements, potentially "IS" inheriting X3DChildNode

Here's the hard code in my JavaSerializer.js:

// node is child and element is parent*
*

*                if (node.nodeName === "IS" && element.nodeName === 
"fieldValue") {**
**                        method = "Child";**
**                        addpre = "add";**
**                } else *if (node.nodeName === "IS") {
                         method = "IS";
                         addpre = "set";
                 }

Note that the X3DUOM versions are differently handling Statements:

$ grep name=.IS X3dUnifiedObjectModel*xml|grep -v field
X3dUnifiedObjectModel-3.0.xml:      <ConcreteNode name="IS">
X3dUnifiedObjectModel-3.1.xml:      <ConcreteNode name="IS">
X3dUnifiedObjectModel-3.2.xml:      <ConcreteNode name="IS">
X3dUnifiedObjectModel-3.3.xml:      <ConcreteNode name="IS">
X3dUnifiedObjectModel-4.0.xml:      <Statement name="IS">

$ grep Statements X3dUnifiedObjectModel*xml
X3dUnifiedObjectModel-3.0.xml:   <Statements/>
X3dUnifiedObjectModel-3.1.xml:   <Statements/>
X3dUnifiedObjectModel-3.2.xml:   <Statements/>
X3dUnifiedObjectModel-3.3.xml:   <Statements/>
X3dUnifiedObjectModel-4.0.xml:   <Statements>
X3dUnifiedObjectModel-4.0.xml:   </Statements>

Note that I've added a verbose flag to the below, plus I've been 
modifying the X3DJSAIL jar more recently and X3DUOM in attempt to get 
code that passes muster.   I am doing this in my own environment, and 
have not modified XML Schema that I know of.  So this code is kind of 
old at this point:

My code:

javac -cp .:/home/coderextreme/pythonSAI/X3DJSAIL.4.0.full.jar 
-Xdiags:verbose net/coderextreme/data/rubik2x2x2.java
net/coderextreme/data/rubik2x2x2.java:112: error: method addChild in 
class fieldValue cannot be applied to given types;
                   .addChild(new IS()
                   ^
   required: X3DNode
   found:    IS
   reason: argument mismatch; IS cannot be converted to X3DNode
net/coderextreme/data/rubik2x2x2.java:118: error: method addChild in 
class fieldValue cannot be applied to given types;
                   .addChild(new IS()
                   ^
   required: X3DNode
   found:    IS
   reason: argument mismatch; IS cannot be converted to X3DNode
net/coderextreme/data/rubik2x2x2.java:124: error: method addChild in 
class fieldValue cannot be applied to given types;
                   .addChild(new IS()
                   ^
   required: X3DNode
   found:    IS
   reason: argument mismatch; IS cannot be converted to X3DNode
net/coderextreme/data/rubik2x2x2.java:130: error: method addChild in 
class fieldValue cannot be applied to given types;
                   .addChild(new IS()
                   ^
   required: X3DNode
   found:    IS
   reason: argument mismatch; IS cannot be converted to X3DNode
4 errors



Don's code:


coderextreme at coderextreme-Kubuntu20:~/X3DJSONLD/src/main/java$ javac -cp 
.:/home/coderextreme/pythonSAI/X3DJSAIL.4.0.full.jar -Xdiags:verbose 
net/x3djsonld/data/rubik2x2x2.javanet/x3djsonld/data/rubik2x2x2.java:103: 
error: method addChild in class fieldValue cannot be applied to given types;
               .addChild(new IS()
               ^
   required: X3DNode
   found:    IS
   reason: argument mismatch; IS cannot be converted to X3DNode
net/x3djsonld/data/rubik2x2x2.java:108: error: method addChild in class 
fieldValue cannot be applied to given types;
               .addChild(new IS()
               ^
   required: X3DNode
   found:    IS
   reason: argument mismatch; IS cannot be converted to X3DNode
net/x3djsonld/data/rubik2x2x2.java:122: error: method addChild in class 
fieldValue cannot be applied to given types;
               .addChild(new IS()
               ^
   required: X3DNode
   found:    IS
   reason: argument mismatch; IS cannot be converted to X3DNode
net/x3djsonld/data/rubik2x2x2.java:127: error: method addChild in class 
fieldValue cannot be applied to given types;
               .addChild(new IS()
               ^
   required: X3DNode
   found:    IS
   reason: argument mismatch; IS cannot be converted to X3DNode
4 errors

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20210828/8ac79b6d/attachment.html>


More information about the x3d-public mailing list