Class ProtoInstance

java.lang.Object
All Implemented Interfaces:
X3DChildNode, X3DNode, X3DPrototypeInstance

public class ProtoInstance extends X3DConcreteNode implements X3DPrototypeInstance, X3DChildNode
ProtoInstance can override field default values via fieldValue initializations. Non-recursive nested ProtoInstance and ProtoDeclare statements are allowed within a ProtoDeclare.

Warning: this is an abstract interface that cannot be instantiated as a concrete object. Java programmers typically only need to use concrete objects provided by the org.web3d.x3d.jsail classes. ProtoInstance statement tooltip: ProtoInstance creates an instance node of a locally or externally declared prototype definition. ProtoDeclare/ExternProtoDeclare definitions are abstract, corresponding ProtoInstance nodes are concrete. ProtoInstance nodes typically contain fieldValue statements to override default field values defined in the original ProtoDeclare statement.
  • Hint: the node type of a ProtoInstance exactly matches the first node in the corresponding ProtoDeclare/ProtoBody declaration.
  • Warning: be sure to correctly set the containerField value to match the intended field in the parent node.
  • Warning: do not mismatch node types when placing a ProtoInstance in a scene graph. Most validation tools will not catch this error.
  • Hint: scene authors can override default initializations of prototype fields by including contained <fieldValue> elements.
  • Hint: Nested ProtoInstance and ProtoDeclare statements are allowed within a ProtoDeclare/ProtoBody.
  • Hint: if contained within a ProtoDeclare, then a ProtoInstance node can also contain IS/connect statements for other defined fields.
  • Warning: a ProtoInstance node may not be instantiated inside its own ProtoDeclare or ExternProtoDeclare declaration (i.e. recursive prototypes are illegal).
  • Warning: the local context of each ProtoInstance node must match the node type of the first node in the original ProtoDeclare declaration.
  • Warning: ProtoInstance substitution for a Metadata* node might not validate. Workaround: put metadata-typed ProtoInstance nodes as contained values within a parent MetadataSet node.
  • Hint: X3D Scene Authoring Hints, Inlines and Prototypes https://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html#InlinesPrototypes
  • Hint: X3D Architecture 4.4.4 Prototype semantics, https://www.web3d.org/specifications/X3Dv4/ISO-IEC19775-1v4-IS//Part01/concepts.html#PROTOdefinitionsemantics Examples: X3D Example Archives, X3D for Web Authors, Chapter 14 Prototypes https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter14Prototypes

Package hint: This org.web3d.x3d.jsail concrete class is used for implementing a standalone X3D object as a Plain Old Java Object (POJO). If you are writing Java code for use inside an X3D Script node, compile separate code using only the org.web3d.x3d.sai package instead.
See Also: