Class X3DConcreteElement

    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected static java.lang.String NAME
      String constant NAME provides name of this element; overridden by implementing class.
      protected java.lang.StringBuilder validationResult
      Results log of local validation.
    • Method Summary

      Modifier and Type Method Description
      abstract X3DConcreteElement addComments​(java.lang.String newComment)
      Add comment as String to contained commentsList.
      abstract X3DConcreteElement addComments​(java.lang.String[] newComments)
      Add comments as String[] array to contained commentsList.
      abstract X3DConcreteElement addComments​(CommentsBlock newCommentsBlock)
      Add CommentsBlock to element
      void clearParentObject()
      Package-protected internal method to clear local reference to parent object, if any.
      X3DConcreteElement findAncestorElementByName​(java.lang.String ancestorElementName)
      Find object reference to ancestor element (i.e. node or statement), if this object is an attached child.
      ProtoBodyObject findAncestorProtoBody()
      Find object reference to ancestor ProtoBody, if this node or statement is a child.
      SceneObject findAncestorSceneObject()
      Find object reference to ancestor Scene element, assumes this object is an attached child.
      X3DObject findAncestorX3DObject()
      Find object reference to ancestor X3D element, if this node or statement is part of an X3DObject model.
      abstract X3DConcreteElement findElementByNameValue​(java.lang.String nameValue)
      Recursive method to provide object reference to node or statement by name attribute, if found as part of this element or in a contained element.
      abstract X3DConcreteElement findElementByNameValue​(java.lang.String nameValue, java.lang.String elementName)
      Recursive method to provide object reference to node or statement by name attribute, if found as part of this element or in a contained element.
      abstract X3DConcreteNode findNodeByDEF​(java.lang.String DEFvalue)
      Recursive method to provide object reference to node by DEF, if found as this node or in a contained node.
      abstract java.lang.String getAccessType​(java.lang.String fieldName)
      Indicate accessType corresponding to given fieldName.
      abstract java.lang.String getComponent()
      Defines X3D component for this element.
      abstract int getComponentLevel()
      Provides default X3D component level for this element
      abstract java.lang.String getElementName()
      Provides name of this element.
      abstract java.lang.String getFieldType​(java.lang.String fieldName)
      Indicate type corresponding to given fieldName.
      static java.lang.String getPackageName​(java.lang.String className)
      Provide fully qualified package for a given element object, including className.
      X3DConcreteElement getParentObject()
      Provide object reference to parent X3D node or statement, if any.
      java.lang.String getValidationResult()
      Get output of results from prior validation, if any
      boolean hasAncestorElementByName​(java.lang.String ancestorElementName)
      Determine whether ancestor element (i.e. node or statement) is found, meaning this object is an attached child.
      boolean hasAncestorProtoBody()
      Determine whether ancestor ProtoBody element is found, meaning this object is an attached child.
      boolean hasAncestorSceneObject()
      Determine whether ancestor Scene element is found, meaning this object is an attached child.
      boolean hasAncestorX3DObject()
      Determine whether ancestor X3D element is found, meaning this object is an attached child.
      boolean hasParentObject()
      Whether parent object exists.
      void setParentObject​(X3DConcreteElement newParentObject)
      Package-internal method to set parent object reference.
      java.lang.String toStringClassicVRML()
      Recursive method to provide ClassicVRML string serialization.
      abstract java.lang.String toStringClassicVRML​(int indentLevel)
      Recursive method to provide ClassicVRML string serialization.
      java.lang.String toStringVRML97()
      Recursive method to provide VRML97 string serialization.
      abstract java.lang.String toStringVRML97​(int indentLevel)
      Recursive method to provide VRML97 string serialization.
      java.lang.String toStringX3D()
      Recursive method to provide X3D string serialization of this model subgraph, utilizing XML encoding and conforming to X3D Canonical Form.
      abstract java.lang.String toStringX3D​(int indentLevel)
      Recursive method to provide X3D string serialization of this model subgraph, utilizing XML encoding and conforming to X3D Canonical Form.
      abstract java.lang.String validate()
      Recursive method to validate this element plus all contained nodes and statements, using both datatype-specification value checks and regular expression (regex) checking of corresponding string values.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • NAME

        protected static final java.lang.String NAME
        String constant NAME provides name of this element; overridden by implementing class.
        See Also:
        Constant Field Values
      • validationResult

        protected java.lang.StringBuilder validationResult
        Results log of local validation.
    • Constructor Detail

      • X3DConcreteElement

        public X3DConcreteElement()
    • Method Detail

      • getParentObject

        public X3DConcreteElement getParentObject()
        Provide object reference to parent X3D node or statement, if any. This reference is named "parentObject" rather than "parent" to avoid potential name collision with any X3D field named "parent".
        Returns:
        object reference to parent X3D node or statement, otherwise null if none
      • hasParentObject

        public boolean hasParentObject()
        Whether parent object exists. This reference is named "parentObject" rather than "parent" to avoid potential name collision with any X3D field named "parent".
        Returns:
        true if found
      • setParentObject

        public void setParentObject​(X3DConcreteElement newParentObject)
        Package-internal method to set parent object reference.
        Parameters:
        newParentObject - object reference to parent node or X3D statement that contains this node
      • clearParentObject

        public void clearParentObject()
        Package-protected internal method to clear local reference to parent object, if any.
      • findAncestorElementByName

        public X3DConcreteElement findAncestorElementByName​(java.lang.String ancestorElementName)
        Find object reference to ancestor element (i.e. node or statement), if this object is an attached child.
        Parameters:
        ancestorElementName - elementName of ancestor of interest (e.g. first Transform)
        Returns:
        ancestor node reference if attached and found, otherwise null
      • hasAncestorElementByName

        public boolean hasAncestorElementByName​(java.lang.String ancestorElementName)
        Determine whether ancestor element (i.e. node or statement) is found, meaning this object is an attached child.
        Parameters:
        ancestorElementName - elementName of ancestor of interest (e.g. first Transform)
        Returns:
        whether ancestor element is found
        See Also:
        findAncestorProtoBody()
      • findAncestorProtoBody

        public ProtoBodyObject findAncestorProtoBody()
        Find object reference to ancestor ProtoBody, if this node or statement is a child.
        Returns:
        ancestor ProtoBodyObject reference if attached and found, otherwise null
        See Also:
        hasAncestorProtoBody()
      • hasAncestorProtoBody

        public boolean hasAncestorProtoBody()
        Determine whether ancestor ProtoBody element is found, meaning this object is an attached child.
        Returns:
        whether ancestor ProtoBody element is found
        See Also:
        findAncestorProtoBody()
      • getElementName

        public abstract java.lang.String getElementName()
        Provides name of this element.
        Returns:
        name of this element
      • getComponent

        public abstract java.lang.String getComponent()
        Defines X3D component for this element.
        Returns:
        X3D component for this element
      • getComponentLevel

        public abstract int getComponentLevel()
        Provides default X3D component level for this element
        Returns:
        default X3D component level for this element
      • getFieldType

        public abstract java.lang.String getFieldType​(java.lang.String fieldName)
        Indicate type corresponding to given fieldName.
        Parameters:
        fieldName - name of field in this X3D statement
        Returns:
        X3D type (SFvec3f etc.), otherwise ConfigurationProperties.ERROR_UNKNOWN_FIELD_TYPE if not recognized
        See Also:
        ConfigurationProperties.ERROR_UNKNOWN_FIELD_TYPE
      • getAccessType

        public abstract java.lang.String getAccessType​(java.lang.String fieldName)
        Indicate accessType corresponding to given fieldName.
        Parameters:
        fieldName - name of field in this X3D statement
        Returns:
        X3D accessType (inputOnly etc.), otherwise ConfigurationProperties.ERROR_UNKNOWN_FIELD_TYPE if not recognized
        See Also:
        ConfigurationProperties.ERROR_UNKNOWN_FIELD_TYPE
      • findElementByNameValue

        public abstract X3DConcreteElement findElementByNameValue​(java.lang.String nameValue,
                                                                  java.lang.String elementName)
        Recursive method to provide object reference to node or statement by name attribute, if found as part of this element or in a contained element. Elements with name fields include meta, Metadata* nodes, field/fieldValue, ProtoDeclare/ExternProtoDeclare/ProtoInstance, CAD and HAnim nodes.

        Warning: first start with findAncestorSceneObject() to check entire scene graph, or findAncestorX3DObject() to check entire model document.

        Parameters:
        nameValue - is value of the name field being searched for in this element and child elements(if any)
        elementName - identifies the element of interest (meta MetadataString ProtoDeclare CADassembly ProtoInstance HAnimHumanoid etc.)
        Returns:
        object reference to found element, null otherwise
        See Also:
        findNodeByDEF(String), hasAncestorSceneObject(), findAncestorX3DObject(), metaObject, Warning: more than one element may be found that has the same name, this method does not handle that case.
      • findElementByNameValue

        public abstract X3DConcreteElement findElementByNameValue​(java.lang.String nameValue)
        Recursive method to provide object reference to node or statement by name attribute, if found as part of this element or in a contained element. Elements with name fields include meta, Metadata* nodes, field/fieldValue, ProtoDeclare/ExternProtoDeclare/ProtoInstance, CAD and HAnim nodes.

        Warning: first start with findAncestorSceneObject() to check entire scene graph, or findAncestorX3DObject() to check entire model document.

        Warning: more than one element may be found that has the same name, this method does not handle that case.
        Parameters:
        nameValue - is value of the name field being searched for in this element and child elements(if any)
        Returns:
        object reference to found element, null otherwise
        See Also:
        findNodeByDEF(String), hasAncestorSceneObject(), findAncestorX3DObject()
      • findNodeByDEF

        public abstract X3DConcreteNode findNodeByDEF​(java.lang.String DEFvalue)
        Recursive method to provide object reference to node by DEF, if found as this node or in a contained node.

        Warning: first start with findAncestorSceneObject() to check entire scene graph, or findAncestorX3DObject() to check entire model document.

        Warning: more than one element may be found that has the same DEF, this method does not handle that case.
        Parameters:
        DEFvalue - is value of the name field being searched for in this element and child elements(if any)
        Returns:
        object reference to found node, null otherwise
        See Also:
        findElementByNameValue(String), hasAncestorSceneObject(), findAncestorX3DObject()
      • getPackageName

        public static java.lang.String getPackageName​(java.lang.String className)
        Provide fully qualified package for a given element object, including className. Helpful for reflection.
        Parameters:
        className - X3D statement or node of interest
        Returns:
        fully qualified package for className
      • addComments

        public abstract X3DConcreteElement addComments​(java.lang.String newComment)
        Add comment as String to contained commentsList.
        Parameters:
        newComment - initial value
        Returns:
        this same object to allow sequential method pipelining (i.e. consecutive setAttribute method invocations).
      • addComments

        public abstract X3DConcreteElement addComments​(java.lang.String[] newComments)
        Add comments as String[] array to contained commentsList.
        Parameters:
        newComments - array of comments
        Returns:
        this same object to allow sequential method pipelining (i.e. consecutive setAttribute method invocations).
      • addComments

        public abstract X3DConcreteElement addComments​(CommentsBlock newCommentsBlock)
        Add CommentsBlock to element
        Parameters:
        newCommentsBlock - block of comments to add
        Returns:
        this same object to allow sequential method pipelining (i.e. consecutive method invocations on the same object).
      • getValidationResult

        public java.lang.String getValidationResult()
        Get output of results from prior validation, if any
        Returns:
        validation results (if any)
      • validate

        public abstract java.lang.String validate()
        Recursive method to validate this element plus all contained nodes and statements, using both datatype-specification value checks and regular expression (regex) checking of corresponding string values.
        Returns:
        validation results (if any)