[x3d-public] issue with ClassCastException, X3DJSAIL: bollard.java, fix for consistent implementation of X3DNode by Metadata* nodes; still a JSON problem

Don Brutzman brutzman at nps.edu
Sun Feb 26 22:13:17 PST 2017


cc: X3D working group

Great catch John.  This turns out to be a pretty important exception.  It reveals that only MetadataSet implements X3DNode and not the other Metadata* nodes.

	7.3.5 X3DNode
	http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/core.html#X3DNode

	7.4.1 MetadataBoolean
	http://www.web3d.org/documents/specifications/19775-1/V3.3/Part01/components/core.html#MetadataBoolean

	etc. for other Metadata* nodes

Potential problems with the MetadataSet content model in the X3D XML Schema are a known issue. As revealed by details in embedded comments, there are some schema-design issues there that might not yet be fully resolved.

Fortunately this particular exception also reveals an inconsistency in the X3D XML Schema that appears to be easily remedied.  MetadataSet includes the following appinfo element, while the other Metadata* nodes are missing it.

	<xs:attribute name="additionalInterface" type="xs:string" default="X3DNode"/>

Adding this appinfo five times in x3d-3.3.xsd schema results in the following AdditionalInheritance entries getting added to X3DObjectModel-3.3.xml for the five Metadata* nodes in question.

	<Inheritance baseType="X3DMetadataObject"/>
	<AdditionalInheritance baseType="X3DNode"/>

bollard.java now runs successfully without exception.  Everything else also seems unchanged and unaffected.  8)

Roy, subject to schema review, I'll post this change to the X3D XML schemas.  Since it is in appinfo, it won't affect XML validation.

John, looks like there is still a problem in .x3d -> .json stylesheet conversion.  Output attached.  Perhaps you can spot the difficulty there?  Looks like the MetadataSet for EntityDefinition doesn't have a proper containerField setting.  Further trickiness...

aha.  Each MetadataSetObject has two child-field methods

   SFNode:
	setMetadata(X3DMetadataObject newValue)
	http://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/sai/Core/MetadataSet.html#setMetadata-org.web3d.x3d.sai.Core.X3DMetadataObject-
   MFNode:
	setValue(X3DNode[] newValue)
	http://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/sai/Core/MetadataSet.html#setValue-org.web3d.x3d.sai.Core.X3DNode:A-

I checked the original model and it appears to have the correct Metadata* containerField values.

	https://savage.nps.edu/Savage/Buildings/SecurityPerimeter/BollardIndex.html
	https://savage.nps.edu/Savage/Buildings/SecurityPerimeter/Bollard.html
	https://savage.nps.edu/Savage/Buildings/SecurityPerimeter/Bollard.x3d

Excerpt:

<MetadataSet name='SMAL' reference=' https://savage.nps.edu/Savage/Tools/SMAL/SMAL.html ' containerField='metadata'>
	<MetadataString containerField='value' name='version' value='"1.0"'>
		<MetadataString name='appinfo' value='"This is the version of SMAL employed, not of the model."' containerField='metadata'/>
	</MetadataString>
	<MetadataSet containerField='value' name='EntityDefinition'>
	<!-- Identifying metadata for the current simulation of interest -->
		etc.

John, it appears that you must already look at containerField values when populating MetadataSet children appropriately.  Please confirm whether all this makes sense.

Since X3DJSAIL correctly produces a matching .x3d file, I share your suspicion that the problem is in the X3dToJson.xslt conversion -metadata fields which causes the mistaken .json output.

Additional references on MetadataSet usage:

	X3D Tooltips: MetadataSet
	http://www.web3d.org/x3d/content/X3dTooltips.html#MetadataSet

	X3D for Web Authors, Chapter 15, Metadata Information
	http://x3dgraphics.com/examples/X3dForWebAuthors/Chapter15-Metadata/Chapter15-MetadataInformation.html

v/r Don

On 2/26/2017 1:00 PM, yottzumm at gmail.com wrote:
>
>
> Did we see this one before?  I’m suspecting it’s because I call addValue on a MetadataSetObject, but not really sure.  Possibly the -metadata fields are getting out of whack?
>
> John
>
>
>
> www_web3d_org/x3d/content/examples/Savage/Buildings/SecurityPerimeter/Bollard.java
>
> java.lang.ClassCastException: org.web3d.x3d.jsail.Core.MetadataStringObject cannot be cast to org.web3d.x3d.sai.Core.X3DNode
>
>         at org.web3d.x3d.jsail.Core.MetadataSetObject.getValue(MetadataSetObject.java:435)
>
>         at org.web3d.x3d.jsail.Core.MetadataSetObject.validate(MetadataSetObject.java:1131)
>
>         at org.web3d.x3d.jsail.Core.MetadataSetObject.validate(MetadataSetObject.java:1128)
>
>         at org.web3d.x3d.jsail.Core.MetadataSetObject.validate(MetadataSetObject.java:1128)
>
>         at org.web3d.x3d.jsail.Core.WorldInfoObject.validate(WorldInfoObject.java:1001)
>
>         at org.web3d.x3d.jsail.Core.SceneObject.validate(SceneObject.java:539)
>
>         at org.web3d.x3d.jsail.Core.X3DObject.validate(X3DObject.java:1638)
>
>         at org.web3d.x3d.jsail.Core.X3DObject.toFileJSON(X3DObject.java:728)
>
>         at www_web3d_org.x3d.content.examples.Savage.Buildings.SecurityPerimeter.Bollard.main(Bollard.java:326)
>


all the best, Don
-- 
Don Brutzman  Naval Postgraduate School, Code USW/Br       brutzman at nps.edu
Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149
X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzman
-------------- next part --------------
{ "X3D": {
    "encoding":"UTF-8",
    "@profile":"Interchange",
    "@version":"3.1",
    "@xsd:noNamespaceSchemaLocation":"http://www.web3d.org/specifications/x3d-3.1.xsd",
    "JSON schema":"http://www.web3d.org/specifications/x3d-3.3-JSONSchema.json",
    "head": {
        "meta": [
          {
            "@name":"title",
            "@content":"Bollard.x3d"
          },
          {
            "@name":"description",
            "@content":"Rising/retractable security bollard"
          },
          {
            "@name":"creator",
            "@content":"Alan Hudson"
          },
          {
            "@name":"created",
            "@content":"30 May 2007"
          },
          {
            "@name":"modified",
            "@content":"27 March 2016"
          },
          {
            "@name":"reference",
            "@content":"http://www.atgaccess.com"
          },
          {
            "@name":"warning",
            "@content":"under development, initial functionality completed. TODO: how to string together multiple bollards - add fields for spacing and count?"
          },
          {
            "@name":"identifier",
            "@content":"https://savage.nps.edu/Savage/Buildings/SecurityPerimeter/Bollard.x3d"
          },
          {
            "@name":"generator",
            "@content":"X3D-Edit 3.2, https://savage.nps.edu/X3D-Edit"
          },
          {
            "@name":"license",
            "@content":"../../license.html"
          },
          {
            "@name":"translated",
            "@content":"26 February 2017"
          },
          {
            "@name":"generator",
            "@content":"X3dToJson.xslt, http://www.web3d.org/x3d/stylesheets/X3dToJson.html"
          },
          {
            "@name":"warning",
            "@content":"An experimental version of X3D JSON encoding is used for this scene.  Status online at http://www.web3d.org/wiki/index.php/X3D_JSON_Encoding"
          }
        ]
    },
    "Scene": {
        "-children":[
          { "WorldInfo":
            {
              "@info":["http://www.fas.org/man/dod-101/sys/ship/index.html"],
              "@title":"Bollard",
              "-metadata":
                { "MetadataSet":
                  {
                    "@name":"SMAL",
                    "@reference":"https://savage.nps.edu/Savage/Tools/SMAL/SMAL.html",
                    "-metadata":
                      { "MetadataString":
                        {
                          "@name":"version",
                          "@value":["1.0"],
                          "-metadata":
                            { "MetadataString":
                              {
                                "@name":"appinfo",
                                "@value":["This is the version of SMAL employed, not of the model."]
                              }
                            }
                        }
                      },
                      { "MetadataSet":
                        {
                          "@name":"EntityDefinition",
                          "-metadata":
                            { "MetadataSet":
                              {
                                "@name":"Classification",
                                "-metadata":
                                  { "MetadataString":
                                    {
                                      "@name":"level",
                                      "@value":["UNCLASSIFIED"],
                                      "-metadata":
                                        { "MetadataString":
                                          {
                                            "@name":"appinfo",
                                            "@value":["UNCLASSIFIED","FOUO","CONFIDENTIAL","SECRET"]
                                          }
                                        }
                                    }
                                  },
                                  { "MetadataString":
                                    {
                                      "@name":"reference",
                                      "@value":["http://www.fas.org/man/dod-101/sys/ship/index.html"],
                                      "-metadata":
                                        { "MetadataString":
                                          {
                                            "@name":"appinfo",
                                            "@value":["The published source of classified information, if any, contained in the Metadata."]
                                          }
                                        }
                                    }
                                  },
                                  { "MetadataString":
                                    {
                                      "@name":"rationale",
                                      "-metadata":
                                        { "MetadataString":
                                          {
                                            "@name":"appinfo",
                                            "@value":["The specific element which contains the information classifying this document."]
                                          }
                                        }
                                    }
                                  }
                              }
                            },
                            { "MetadataSet":
                              {
                                "@name":"IdentificationParameters",
                                "-metadata":
                                  { "MetadataString":
                                    {
                                      "@name":"name",
                                      "@value":["Bollard"],
                                      "-metadata":
                                        { "MetadataString":
                                          {
                                            "@name":"appinfo",
                                            "@value":["The plain language name of the vehicle this model represents, i.e. the base class (DDG-51), or vehicle designation (M1A2)."]
                                          }
                                        }
                                    }
                                  }
                              }
                            },
                            { "MetadataSet":
                              {
                                "@name":"X3DArchiveModel",
                                "-metadata":
                                  { "MetadataString":
                                    {
                                      "@name":"appinfo",
                                      "@value":["This is a placeholder element which ensures the proper validation of autogenerated SMAL code."]
                                    }
                                  }
                              }
                            },
                            { "MetadataSet":
                              {
                                "@name":"PhysicalParameters",
                                "-metadata":
                                  { "MetadataSet":
                                    {
                                      "@name":"PhysicalConstraints",
                                      "-metadata":
                                        { "MetadataFloat":
                                          {
                                            "@name":"height",
                                            "@value":[2],
                                            "-metadata":
                                              { "MetadataString":
                                                {
                                                  "@name":"appinfo",
                                                  "@value":["The maximum structural height of the object in meters. This may be used for clearance checking or other calculations."]
                                                }
                                              }
                                          }
                                        },
                                        { "MetadataFloat":
                                          {
                                            "@name":"width",
                                            "@value":[1],
                                            "-metadata":
                                              { "MetadataString":
                                                {
                                                  "@name":"appinfo",
                                                  "@value":["The maximum width, beam, or wingspan of the vehicle in meters. This may be used for clearance checking or other calculations."]
                                                }
                                              }
                                          }
                                        },
                                        { "MetadataFloat":
                                          {
                                            "@name":"length",
                                            "@value":[8],
                                            "-metadata":
                                              { "MetadataString":
                                                {
                                                  "@name":"appinfo",
                                                  "@value":["The maximum structural length of the object in meters. This may be used for clearance checking or other calculations."]
                                                }
                                              }
                                          }
                                        },
                                        { "MetadataFloat":
                                          {
                                            "@name":"draft",
                                            "@value":[0.2],
                                            "-metadata":
                                              { "MetadataString":
                                                {
                                                  "@name":"appinfo",
                                                  "@value":["The vertical distance in meters from the deepest point (keel or other structure) to the waterline of a vehicle at its stated displacement or gross weight."]
                                                }
                                              }
                                          }
                                        }
                                    }
                                  },
                                  { "MetadataSet":
                                    {
                                      "@name":"DynamicResponseConstraints",
                                      "-metadata":
                                        { "MetadataFloat":
                                          {
                                            "@name":"maximumSpeed",
                                            "@value":[25],
                                            "-metadata":
                                              { "MetadataString":
                                                {
                                                  "@name":"appinfo",
                                                  "@value":["The maximum rated speed for this vehicle in knots."]
                                                }
                                              }
                                          }
                                        },
                                        { "MetadataFloat":
                                          {
                                            "@name":"cruiseSpeed",
                                            "@value":[10],
                                            "-metadata":
                                              { "MetadataString":
                                                {
                                                  "@name":"appinfo",
                                                  "@value":["The published cruise speed for this vehicle in knots."]
                                                }
                                              }
                                          }
                                        },
                                        { "MetadataFloat":
                                          {
                                            "@name":"maximumAcceleration",
                                            "@value":[1.3],
                                            "-metadata":
                                              { "MetadataString":
                                                {
                                                  "@name":"appinfo",
                                                  "@value":["The ideal maximum acceleration achievable by this vehicle in meters per second squared, as in at maximum Power excess for aircraft."]
                                                }
                                              }
                                          }
                                        },
                                        { "MetadataFloat":
                                          {
                                            "@name":"maximumFuelCapacity",
                                            "@value":[40],
                                            "-metadata":
                                              { "MetadataString":
                                                {
                                                  "@name":"appinfo",
                                                  "@value":["The maximum usable fuel capacity in liters."]
                                                }
                                              }
                                          }
                                        }
                                    }
                                  },
                                  { "MetadataSet":
                                    {
                                      "@name":"TacticalConstraints",
                                      "-children":[
                                        { "#comment":"none defined"
                                        }
                                      ]
                                    }
                                  }
                              }
                            },
                            { "MetadataSet":
                              {
                                "@name":"NetworkedCommunicationParameterSet",
                                "-metadata":
                                  { "MetadataSet":
                                    {
                                      "@name":"DisConfiguration",
                                      "-metadata":
                                        { "MetadataInteger":
                                          {
                                            "@name":"entityKind",
                                            "@value":[1],
                                            "-metadata":
                                              { "MetadataString":
                                                {
                                                  "@name":"appinfo",
                                                  "@value":["The DIS enumeration for this objects overall type (for vehicles this value should be 1)."]
                                                }
                                              }
                                          }
                                        },
                                        { "MetadataInteger":
                                          {
                                            "@name":"entityDomain",
                                            "@value":[3],
                                            "-metadata":
                                              { "MetadataString":
                                                {
                                                  "@name":"appinfo",
                                                  "@value":["The DIS enumeration for the domain of operations of this object (air, surface, sub-surface, etc.)."]
                                                }
                                              }
                                          }
                                        },
                                        { "MetadataInteger":
                                          {
                                            "@name":"entityCountry",
                                            "@value":[225],
                                            "-metadata":
                                              { "MetadataString":
                                                {
                                                  "@name":"appinfo",
                                                  "@value":["The DIS enumeration for the country of origin of this object (the value for United States is 225)."]
                                                }
                                              }
                                          }
                                        },
                                        { "MetadataInteger":
                                          {
                                            "@name":"entityCategory",
                                            "@value":[0],
                                            "-metadata":
                                              { "MetadataString":
                                                {
                                                  "@name":"appinfo",
                                                  "@value":["The DIS enumeration for the type of this vehicle (cruiser or destroyer, tank or truck, bomber or fighter, etc.)."]
                                                }
                                              }
                                          }
                                        }
                                    }
                                  }
                              }
                            },
                          "-children":[
                            { "#comment":"Identifying metadata for the current simulation of interest"
                            }
                          ]
                        }
                      }
                  }
                }
            }
          },
          { "Transform":
            {
              "@DEF":"BollardTransform",
              "-children":[
                { "#comment":"first Cylinder displays only the sides, with an optional texture applied"
                },
                { "Shape":
                  {
                    "-appearance":
                      { "Appearance":
                        {
                          "-material":
                            { "Material":
                              {
                                "@diffuseColor":[1,0,0]
                              }
                            }
                        }
                      },
                    "-geometry":
                      { "Box":
                        {
                          "@size":[8,2,1]
                        }
                      }
                  }
                }
              ]
            }
          }
        ]
    }
  }
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Bollard.x3d
Type: model/x3d+xml
Size: 7920 bytes
Desc: not available
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20170226/477c9fa2/attachment-0001.x3d>
-------------- next part --------------
import org.web3d.x3d.jsail.*;
import org.web3d.x3d.jsail.CADGeometry.*;
import org.web3d.x3d.jsail.Core.*;
import org.web3d.x3d.jsail.CubeMapTexturing.*;
import org.web3d.x3d.jsail.DIS.*;
import org.web3d.x3d.jsail.EnvironmentalEffects.*;
import org.web3d.x3d.jsail.EnvironmentalSensor.*;
import org.web3d.x3d.jsail.EventUtilities.*;
import org.web3d.x3d.jsail.Followers.*;
import org.web3d.x3d.jsail.Geometry2D.*;
import org.web3d.x3d.jsail.Geometry3D.*;
import org.web3d.x3d.jsail.Geospatial.*;
import org.web3d.x3d.jsail.Grouping.*;
import org.web3d.x3d.jsail.HAnim.*;
import org.web3d.x3d.jsail.Interpolation.*;
import org.web3d.x3d.jsail.KeyDeviceSensor.*;
import org.web3d.x3d.jsail.Layering.*;
import org.web3d.x3d.jsail.Layout.*;
import org.web3d.x3d.jsail.Lighting.*;
import org.web3d.x3d.jsail.NURBS.*;
import org.web3d.x3d.jsail.Navigation.*;
import org.web3d.x3d.jsail.Networking.*;
import org.web3d.x3d.jsail.ParticleSystems.*;
import org.web3d.x3d.jsail.Picking.*;
import org.web3d.x3d.jsail.PointingDeviceSensor.*;
import org.web3d.x3d.jsail.Rendering.*;
import org.web3d.x3d.jsail.RigidBodyPhysics.*;
import org.web3d.x3d.jsail.Scripting.*;
import org.web3d.x3d.jsail.Shaders.*;
import org.web3d.x3d.jsail.Shape.*;
import org.web3d.x3d.jsail.Sound.*;
import org.web3d.x3d.jsail.Text.*;
import org.web3d.x3d.jsail.Texturing3D.*;
import org.web3d.x3d.jsail.Texturing.*;
import org.web3d.x3d.jsail.Time.*;
import org.web3d.x3d.jsail.VolumeRendering.*;
import org.web3d.x3d.jsail.fields.*;
import org.web3d.x3d.sai.*;
import org.web3d.x3d.sai.CADGeometry.*;
import org.web3d.x3d.sai.Core.*;
import org.web3d.x3d.sai.CubeMapTexturing.*;
import org.web3d.x3d.sai.DIS.*;
import org.web3d.x3d.sai.EnvironmentalEffects.*;
import org.web3d.x3d.sai.EnvironmentalSensor.*;
import org.web3d.x3d.sai.EventUtilities.*;
import org.web3d.x3d.sai.Followers.*;
import org.web3d.x3d.sai.Geometry2D.*;
import org.web3d.x3d.sai.Geometry3D.*;
import org.web3d.x3d.sai.Geospatial.*;
import org.web3d.x3d.sai.Grouping.*;
import org.web3d.x3d.sai.HAnim.*;
import org.web3d.x3d.sai.Interpolation.*;
import org.web3d.x3d.sai.KeyDeviceSensor.*;
import org.web3d.x3d.sai.Layering.*;
import org.web3d.x3d.sai.Layout.*;
import org.web3d.x3d.sai.Lighting.*;
import org.web3d.x3d.sai.NURBS.*;
import org.web3d.x3d.sai.Navigation.*;
import org.web3d.x3d.sai.Networking.*;
import org.web3d.x3d.sai.ParticleSystems.*;
import org.web3d.x3d.sai.Picking.*;
import org.web3d.x3d.sai.PointingDeviceSensor.*;
import org.web3d.x3d.sai.Rendering.*;
import org.web3d.x3d.sai.RigidBodyPhysics.*;
import org.web3d.x3d.sai.Scripting.*;
import org.web3d.x3d.sai.Shaders.*;
import org.web3d.x3d.sai.Shape.*;
import org.web3d.x3d.sai.Sound.*;
import org.web3d.x3d.sai.Text.*;
import org.web3d.x3d.sai.Texturing3D.*;
import org.web3d.x3d.sai.Texturing.*;
import org.web3d.x3d.sai.Time.*;
import org.web3d.x3d.sai.VolumeRendering.*;
public class Bollard {
	public static void main(String[] args) {
		X3DObject X3D0 = new X3DObject();
		X3D0.setProfile("Interchange");
		X3D0.setVersion("3.1");
		headObject head0_0 = new headObject();
		metaObject meta0_0_0 = new metaObject();
		meta0_0_0.setName("title");
		meta0_0_0.setContent("Bollard.x3d");
		head0_0.addMeta(meta0_0_0);
		metaObject meta0_0_2 = new metaObject();
		meta0_0_2.setName("description");
		meta0_0_2.setContent("Rising/retractable security bollard");
		head0_0.addMeta(meta0_0_2);
		metaObject meta0_0_4 = new metaObject();
		meta0_0_4.setName("creator");
		meta0_0_4.setContent("Alan Hudson");
		head0_0.addMeta(meta0_0_4);
		metaObject meta0_0_6 = new metaObject();
		meta0_0_6.setName("created");
		meta0_0_6.setContent("30 May 2007");
		head0_0.addMeta(meta0_0_6);
		metaObject meta0_0_8 = new metaObject();
		meta0_0_8.setName("modified");
		meta0_0_8.setContent("27 March 2016");
		head0_0.addMeta(meta0_0_8);
		metaObject meta0_0_10 = new metaObject();
		meta0_0_10.setName("reference");
		meta0_0_10.setContent("http://www.atgaccess.com");
		head0_0.addMeta(meta0_0_10);
		metaObject meta0_0_12 = new metaObject();
		meta0_0_12.setName("warning");
		meta0_0_12.setContent("under development, initial functionality completed. TODO: how to string together multiple bollards - add fields for spacing and count?");
		head0_0.addMeta(meta0_0_12);
		metaObject meta0_0_14 = new metaObject();
		meta0_0_14.setName("identifier");
		meta0_0_14.setContent("https://savage.nps.edu/Savage/Buildings/SecurityPerimeter/Bollard.x3d");
		head0_0.addMeta(meta0_0_14);
		metaObject meta0_0_16 = new metaObject();
		meta0_0_16.setName("generator");
		meta0_0_16.setContent("X3D-Edit 3.2, https://savage.nps.edu/X3D-Edit");
		head0_0.addMeta(meta0_0_16);
		metaObject meta0_0_18 = new metaObject();
		meta0_0_18.setName("license");
		meta0_0_18.setContent("../../license.html");
		head0_0.addMeta(meta0_0_18);
		X3D0.setHead(head0_0);
		SceneObject Scene0_2 = new SceneObject();
		WorldInfoObject WorldInfo0_2_0 = new WorldInfoObject();
		WorldInfo0_2_0.setInfo(new String[] {"http://www.fas.org/man/dod-101/sys/ship/index.html"});
		WorldInfo0_2_0.setTitle("Bollard");
		MetadataSetObject MetadataSet0_2_0_0 = new MetadataSetObject();
		WorldInfo0_2_0.setMetadata(MetadataSet0_2_0_0);
		MetadataSet0_2_0_0.setName("SMAL");
		MetadataSet0_2_0_0.setReference("https://savage.nps.edu/Savage/Tools/SMAL/SMAL.html");
		MetadataStringObject MetadataString0_2_0_0_0 = new MetadataStringObject();
		MetadataString0_2_0_0_0.setName("version");
		MetadataString0_2_0_0_0.setValue(new String[] {"1.0"});
		MetadataStringObject MetadataString0_2_0_0_0_0 = new MetadataStringObject();
		MetadataString0_2_0_0_0.setMetadata(MetadataString0_2_0_0_0_0);
		MetadataString0_2_0_0_0_0.setName("appinfo");
		MetadataString0_2_0_0_0_0.setValue(new String[] {"This is the version of SMAL employed, not of the model."});
		MetadataSet0_2_0_0.addValue(MetadataString0_2_0_0_0);
		MetadataSetObject MetadataSet0_2_0_0_2 = new MetadataSetObject();
		MetadataSet0_2_0_0_2.setName("EntityDefinition");
		CommentsBlock commentsBlock0_2_0_0_2_0 = new CommentsBlock("Identifying metadata for the current simulation of interest");
		MetadataSet0_2_0_0_2.addComments(commentsBlock0_2_0_0_2_0);
		MetadataSetObject MetadataSet0_2_0_0_2_1 = new MetadataSetObject();
		MetadataSet0_2_0_0_2_1.setName("Classification");
		MetadataStringObject MetadataString0_2_0_0_2_1_0 = new MetadataStringObject();
		MetadataString0_2_0_0_2_1_0.setName("level");
		MetadataString0_2_0_0_2_1_0.setValue(new String[] {"UNCLASSIFIED"});
		MetadataStringObject MetadataString0_2_0_0_2_1_0_0 = new MetadataStringObject();
		MetadataString0_2_0_0_2_1_0.setMetadata(MetadataString0_2_0_0_2_1_0_0);
		MetadataString0_2_0_0_2_1_0_0.setName("appinfo");
		MetadataString0_2_0_0_2_1_0_0.setValue(new String[] {"UNCLASSIFIED","FOUO","CONFIDENTIAL","SECRET"});
		MetadataSet0_2_0_0_2_1.addValue(MetadataString0_2_0_0_2_1_0);
		MetadataStringObject MetadataString0_2_0_0_2_1_2 = new MetadataStringObject();
		MetadataString0_2_0_0_2_1_2.setName("reference");
		MetadataString0_2_0_0_2_1_2.setValue(new String[] {"http://www.fas.org/man/dod-101/sys/ship/index.html"});
		MetadataStringObject MetadataString0_2_0_0_2_1_2_0 = new MetadataStringObject();
		MetadataString0_2_0_0_2_1_2.setMetadata(MetadataString0_2_0_0_2_1_2_0);
		MetadataString0_2_0_0_2_1_2_0.setName("appinfo");
		MetadataString0_2_0_0_2_1_2_0.setValue(new String[] {"The published source of classified information, if any, contained in the Metadata."});
		MetadataSet0_2_0_0_2_1.addValue(MetadataString0_2_0_0_2_1_2);
		MetadataStringObject MetadataString0_2_0_0_2_1_4 = new MetadataStringObject();
		MetadataString0_2_0_0_2_1_4.setName("rationale");
		MetadataStringObject MetadataString0_2_0_0_2_1_4_0 = new MetadataStringObject();
		MetadataString0_2_0_0_2_1_4.setMetadata(MetadataString0_2_0_0_2_1_4_0);
		MetadataString0_2_0_0_2_1_4_0.setName("appinfo");
		MetadataString0_2_0_0_2_1_4_0.setValue(new String[] {"The specific element which contains the information classifying this document."});
		MetadataSet0_2_0_0_2_1.addValue(MetadataString0_2_0_0_2_1_4);
		MetadataSet0_2_0_0_2.addValue(MetadataSet0_2_0_0_2_1);
		MetadataSetObject MetadataSet0_2_0_0_2_3 = new MetadataSetObject();
		MetadataSet0_2_0_0_2_3.setName("IdentificationParameters");
		MetadataStringObject MetadataString0_2_0_0_2_3_0 = new MetadataStringObject();
		MetadataString0_2_0_0_2_3_0.setName("name");
		MetadataString0_2_0_0_2_3_0.setValue(new String[] {"Bollard"});
		MetadataStringObject MetadataString0_2_0_0_2_3_0_0 = new MetadataStringObject();
		MetadataString0_2_0_0_2_3_0.setMetadata(MetadataString0_2_0_0_2_3_0_0);
		MetadataString0_2_0_0_2_3_0_0.setName("appinfo");
		MetadataString0_2_0_0_2_3_0_0.setValue(new String[] {"The plain language name of the vehicle this model represents, i.e. the base class (DDG-51), or vehicle designation (M1A2)."});
		MetadataSet0_2_0_0_2_3.addValue(MetadataString0_2_0_0_2_3_0);
		MetadataSet0_2_0_0_2.addValue(MetadataSet0_2_0_0_2_3);
		MetadataSetObject MetadataSet0_2_0_0_2_5 = new MetadataSetObject();
		MetadataSet0_2_0_0_2_5.setName("X3DArchiveModel");
		MetadataStringObject MetadataString0_2_0_0_2_5_0 = new MetadataStringObject();
		MetadataSet0_2_0_0_2_5.setMetadata(MetadataString0_2_0_0_2_5_0);
		MetadataString0_2_0_0_2_5_0.setName("appinfo");
		MetadataString0_2_0_0_2_5_0.setValue(new String[] {"This is a placeholder element which ensures the proper validation of autogenerated SMAL code."});
		MetadataSet0_2_0_0_2.addValue(MetadataSet0_2_0_0_2_5);
		MetadataSetObject MetadataSet0_2_0_0_2_7 = new MetadataSetObject();
		MetadataSet0_2_0_0_2_7.setName("PhysicalParameters");
		MetadataSetObject MetadataSet0_2_0_0_2_7_0 = new MetadataSetObject();
		MetadataSet0_2_0_0_2_7_0.setName("PhysicalConstraints");
		MetadataFloatObject MetadataFloat0_2_0_0_2_7_0_0 = new MetadataFloatObject();
		MetadataFloat0_2_0_0_2_7_0_0.setName("height");
		MetadataFloat0_2_0_0_2_7_0_0.setValue(new float[] {2f});
		MetadataStringObject MetadataString0_2_0_0_2_7_0_0_0 = new MetadataStringObject();
		MetadataFloat0_2_0_0_2_7_0_0.setMetadata(MetadataString0_2_0_0_2_7_0_0_0);
		MetadataString0_2_0_0_2_7_0_0_0.setName("appinfo");
		MetadataString0_2_0_0_2_7_0_0_0.setValue(new String[] {"The maximum structural height of the object in meters. This may be used for clearance checking or other calculations."});
		MetadataSet0_2_0_0_2_7_0.addValue(MetadataFloat0_2_0_0_2_7_0_0);
		MetadataFloatObject MetadataFloat0_2_0_0_2_7_0_2 = new MetadataFloatObject();
		MetadataFloat0_2_0_0_2_7_0_2.setName("width");
		MetadataFloat0_2_0_0_2_7_0_2.setValue(new float[] {1f});
		MetadataStringObject MetadataString0_2_0_0_2_7_0_2_0 = new MetadataStringObject();
		MetadataFloat0_2_0_0_2_7_0_2.setMetadata(MetadataString0_2_0_0_2_7_0_2_0);
		MetadataString0_2_0_0_2_7_0_2_0.setName("appinfo");
		MetadataString0_2_0_0_2_7_0_2_0.setValue(new String[] {"The maximum width, beam, or wingspan of the vehicle in meters. This may be used for clearance checking or other calculations."});
		MetadataSet0_2_0_0_2_7_0.addValue(MetadataFloat0_2_0_0_2_7_0_2);
		MetadataFloatObject MetadataFloat0_2_0_0_2_7_0_4 = new MetadataFloatObject();
		MetadataFloat0_2_0_0_2_7_0_4.setName("length");
		MetadataFloat0_2_0_0_2_7_0_4.setValue(new float[] {8f});
		MetadataStringObject MetadataString0_2_0_0_2_7_0_4_0 = new MetadataStringObject();
		MetadataFloat0_2_0_0_2_7_0_4.setMetadata(MetadataString0_2_0_0_2_7_0_4_0);
		MetadataString0_2_0_0_2_7_0_4_0.setName("appinfo");
		MetadataString0_2_0_0_2_7_0_4_0.setValue(new String[] {"The maximum structural length of the object in meters. This may be used for clearance checking or other calculations."});
		MetadataSet0_2_0_0_2_7_0.addValue(MetadataFloat0_2_0_0_2_7_0_4);
		MetadataFloatObject MetadataFloat0_2_0_0_2_7_0_6 = new MetadataFloatObject();
		MetadataFloat0_2_0_0_2_7_0_6.setName("draft");
		MetadataFloat0_2_0_0_2_7_0_6.setValue(new float[] {0.2f});
		MetadataStringObject MetadataString0_2_0_0_2_7_0_6_0 = new MetadataStringObject();
		MetadataFloat0_2_0_0_2_7_0_6.setMetadata(MetadataString0_2_0_0_2_7_0_6_0);
		MetadataString0_2_0_0_2_7_0_6_0.setName("appinfo");
		MetadataString0_2_0_0_2_7_0_6_0.setValue(new String[] {"The vertical distance in meters from the deepest point (keel or other structure) to the waterline of a vehicle at its stated displacement or gross weight."});
		MetadataSet0_2_0_0_2_7_0.addValue(MetadataFloat0_2_0_0_2_7_0_6);
		MetadataSet0_2_0_0_2_7.addValue(MetadataSet0_2_0_0_2_7_0);
		MetadataSetObject MetadataSet0_2_0_0_2_7_2 = new MetadataSetObject();
		MetadataSet0_2_0_0_2_7_2.setName("DynamicResponseConstraints");
		MetadataFloatObject MetadataFloat0_2_0_0_2_7_2_0 = new MetadataFloatObject();
		MetadataFloat0_2_0_0_2_7_2_0.setName("maximumSpeed");
		MetadataFloat0_2_0_0_2_7_2_0.setValue(new float[] {25f});
		MetadataStringObject MetadataString0_2_0_0_2_7_2_0_0 = new MetadataStringObject();
		MetadataFloat0_2_0_0_2_7_2_0.setMetadata(MetadataString0_2_0_0_2_7_2_0_0);
		MetadataString0_2_0_0_2_7_2_0_0.setName("appinfo");
		MetadataString0_2_0_0_2_7_2_0_0.setValue(new String[] {"The maximum rated speed for this vehicle in knots."});
		MetadataSet0_2_0_0_2_7_2.addValue(MetadataFloat0_2_0_0_2_7_2_0);
		MetadataFloatObject MetadataFloat0_2_0_0_2_7_2_2 = new MetadataFloatObject();
		MetadataFloat0_2_0_0_2_7_2_2.setName("cruiseSpeed");
		MetadataFloat0_2_0_0_2_7_2_2.setValue(new float[] {10f});
		MetadataStringObject MetadataString0_2_0_0_2_7_2_2_0 = new MetadataStringObject();
		MetadataFloat0_2_0_0_2_7_2_2.setMetadata(MetadataString0_2_0_0_2_7_2_2_0);
		MetadataString0_2_0_0_2_7_2_2_0.setName("appinfo");
		MetadataString0_2_0_0_2_7_2_2_0.setValue(new String[] {"The published cruise speed for this vehicle in knots."});
		MetadataSet0_2_0_0_2_7_2.addValue(MetadataFloat0_2_0_0_2_7_2_2);
		MetadataFloatObject MetadataFloat0_2_0_0_2_7_2_4 = new MetadataFloatObject();
		MetadataFloat0_2_0_0_2_7_2_4.setName("maximumAcceleration");
		MetadataFloat0_2_0_0_2_7_2_4.setValue(new float[] {1.3f});
		MetadataStringObject MetadataString0_2_0_0_2_7_2_4_0 = new MetadataStringObject();
		MetadataFloat0_2_0_0_2_7_2_4.setMetadata(MetadataString0_2_0_0_2_7_2_4_0);
		MetadataString0_2_0_0_2_7_2_4_0.setName("appinfo");
		MetadataString0_2_0_0_2_7_2_4_0.setValue(new String[] {"The ideal maximum acceleration achievable by this vehicle in meters per second squared, as in at maximum Power excess for aircraft."});
		MetadataSet0_2_0_0_2_7_2.addValue(MetadataFloat0_2_0_0_2_7_2_4);
		MetadataFloatObject MetadataFloat0_2_0_0_2_7_2_6 = new MetadataFloatObject();
		MetadataFloat0_2_0_0_2_7_2_6.setName("maximumFuelCapacity");
		MetadataFloat0_2_0_0_2_7_2_6.setValue(new float[] {40f});
		MetadataStringObject MetadataString0_2_0_0_2_7_2_6_0 = new MetadataStringObject();
		MetadataFloat0_2_0_0_2_7_2_6.setMetadata(MetadataString0_2_0_0_2_7_2_6_0);
		MetadataString0_2_0_0_2_7_2_6_0.setName("appinfo");
		MetadataString0_2_0_0_2_7_2_6_0.setValue(new String[] {"The maximum usable fuel capacity in liters."});
		MetadataSet0_2_0_0_2_7_2.addValue(MetadataFloat0_2_0_0_2_7_2_6);
		MetadataSet0_2_0_0_2_7.addValue(MetadataSet0_2_0_0_2_7_2);
		MetadataSetObject MetadataSet0_2_0_0_2_7_4 = new MetadataSetObject();
		MetadataSet0_2_0_0_2_7_4.setName("TacticalConstraints");
		CommentsBlock commentsBlock0_2_0_0_2_7_4_0 = new CommentsBlock("none defined");
		MetadataSet0_2_0_0_2_7_4.addComments(commentsBlock0_2_0_0_2_7_4_0);
		MetadataSet0_2_0_0_2_7.addValue(MetadataSet0_2_0_0_2_7_4);
		MetadataSet0_2_0_0_2.addValue(MetadataSet0_2_0_0_2_7);
		MetadataSetObject MetadataSet0_2_0_0_2_9 = new MetadataSetObject();
		MetadataSet0_2_0_0_2_9.setName("NetworkedCommunicationParameterSet");
		MetadataSetObject MetadataSet0_2_0_0_2_9_0 = new MetadataSetObject();
		MetadataSet0_2_0_0_2_9_0.setName("DisConfiguration");
		MetadataIntegerObject MetadataInteger0_2_0_0_2_9_0_0 = new MetadataIntegerObject();
		MetadataInteger0_2_0_0_2_9_0_0.setName("entityKind");
		MetadataInteger0_2_0_0_2_9_0_0.setValue(new int[] {1});
		MetadataStringObject MetadataString0_2_0_0_2_9_0_0_0 = new MetadataStringObject();
		MetadataInteger0_2_0_0_2_9_0_0.setMetadata(MetadataString0_2_0_0_2_9_0_0_0);
		MetadataString0_2_0_0_2_9_0_0_0.setName("appinfo");
		MetadataString0_2_0_0_2_9_0_0_0.setValue(new String[] {"The DIS enumeration for this objects overall type (for vehicles this value should be 1)."});
		MetadataSet0_2_0_0_2_9_0.addValue(MetadataInteger0_2_0_0_2_9_0_0);
		MetadataIntegerObject MetadataInteger0_2_0_0_2_9_0_2 = new MetadataIntegerObject();
		MetadataInteger0_2_0_0_2_9_0_2.setName("entityDomain");
		MetadataInteger0_2_0_0_2_9_0_2.setValue(new int[] {3});
		MetadataStringObject MetadataString0_2_0_0_2_9_0_2_0 = new MetadataStringObject();
		MetadataInteger0_2_0_0_2_9_0_2.setMetadata(MetadataString0_2_0_0_2_9_0_2_0);
		MetadataString0_2_0_0_2_9_0_2_0.setName("appinfo");
		MetadataString0_2_0_0_2_9_0_2_0.setValue(new String[] {"The DIS enumeration for the domain of operations of this object (air, surface, sub-surface, etc.)."});
		MetadataSet0_2_0_0_2_9_0.addValue(MetadataInteger0_2_0_0_2_9_0_2);
		MetadataIntegerObject MetadataInteger0_2_0_0_2_9_0_4 = new MetadataIntegerObject();
		MetadataInteger0_2_0_0_2_9_0_4.setName("entityCountry");
		MetadataInteger0_2_0_0_2_9_0_4.setValue(new int[] {225});
		MetadataStringObject MetadataString0_2_0_0_2_9_0_4_0 = new MetadataStringObject();
		MetadataInteger0_2_0_0_2_9_0_4.setMetadata(MetadataString0_2_0_0_2_9_0_4_0);
		MetadataString0_2_0_0_2_9_0_4_0.setName("appinfo");
		MetadataString0_2_0_0_2_9_0_4_0.setValue(new String[] {"The DIS enumeration for the country of origin of this object (the value for United States is 225)."});
		MetadataSet0_2_0_0_2_9_0.addValue(MetadataInteger0_2_0_0_2_9_0_4);
		MetadataIntegerObject MetadataInteger0_2_0_0_2_9_0_6 = new MetadataIntegerObject();
		MetadataInteger0_2_0_0_2_9_0_6.setName("entityCategory");
		MetadataInteger0_2_0_0_2_9_0_6.setValue(new int[] {0});
		MetadataStringObject MetadataString0_2_0_0_2_9_0_6_0 = new MetadataStringObject();
		MetadataInteger0_2_0_0_2_9_0_6.setMetadata(MetadataString0_2_0_0_2_9_0_6_0);
		MetadataString0_2_0_0_2_9_0_6_0.setName("appinfo");
		MetadataString0_2_0_0_2_9_0_6_0.setValue(new String[] {"The DIS enumeration for the type of this vehicle (cruiser or destroyer, tank or truck, bomber or fighter, etc.)."});
		MetadataSet0_2_0_0_2_9_0.addValue(MetadataInteger0_2_0_0_2_9_0_6);
		MetadataSet0_2_0_0_2_9.addValue(MetadataSet0_2_0_0_2_9_0);
		MetadataSet0_2_0_0_2.addValue(MetadataSet0_2_0_0_2_9);
		MetadataSet0_2_0_0.addValue(MetadataSet0_2_0_0_2);
		Scene0_2.addChild(WorldInfo0_2_0);
		TransformObject Transform0_2_2 = new TransformObject();
		Transform0_2_2.setDEF("BollardTransform");
		CommentsBlock commentsBlock0_2_2_0 = new CommentsBlock("first Cylinder displays only the sides, with an optional texture applied");
		Transform0_2_2.addComments(commentsBlock0_2_2_0);
		ShapeObject Shape0_2_2_1 = new ShapeObject();
		BoxObject Box0_2_2_1_0 = new BoxObject();
		Shape0_2_2_1.setGeometry(Box0_2_2_1_0);
		Box0_2_2_1_0.setSize(new float[] {8f,2f,1f});
		AppearanceObject Appearance0_2_2_1_2 = new AppearanceObject();
		Shape0_2_2_1.setAppearance(Appearance0_2_2_1_2);
		MaterialObject Material0_2_2_1_2_0 = new MaterialObject();
		Appearance0_2_2_1_2.setMaterial(Material0_2_2_1_2_0);
		Material0_2_2_1_2_0.setDiffuseColor(new float[] {1f,0f,0f});
		Transform0_2_2.addChild(Shape0_2_2_1);
		Scene0_2.addChild(Transform0_2_2);
		X3D0.setScene(Scene0_2);
        ConfigurationProperties.setShowDefaultAttributes(true);
        ConfigurationProperties.setIndentCharacter(ConfigurationProperties.indentCharacter_DEFAULT);
        ConfigurationProperties.setIndentIncrement(ConfigurationProperties.indentIncrement_DEFAULT);
        ConfigurationProperties.setX3dCanonicalForm();
        ConfigurationProperties.initialize();
	ConfigurationProperties.setXsltEngine(ConfigurationProperties.XSLT_ENGINE_nativeJava);
	X3D0.toFileJSON("Bollard.json");
	X3D0.toFileX3D ("Bollard.x3d");
	}
}


More information about the x3d-public mailing list