Xj3D VRML/X3D Code API

org.web3d.vrml.lang
Class VRMLFieldDeclaration

java.lang.Object
  extended byorg.web3d.vrml.lang.VRMLFieldDeclaration

public class VRMLFieldDeclaration
extends java.lang.Object

Base representation of any field in the VRML system.

Each node contains a collection of fields. Each field has a fixed index for all instances of this node.

This class represents the declaration of a field rather than the complete field instance. For this reason it is immutable. You should not be allowed to change items of a field declaration on the fly.

Version:
$Revision: 1.13 $
Author:
Justin Couch
See Also:
FieldConstants

Field Summary
static java.lang.String UNKNOWN_IMPORT
          Definition of a field type that we don't know yet because it came from an unresolved IMPORT statement.
 
Constructor Summary
VRMLFieldDeclaration(int accessType, java.lang.String type, java.lang.String name)
          Create an instance of a field declaration.
 
Method Summary
 int getAccessType()
          Get the access type of the field.
 int getFieldSize()
          Get the size of the raw element.
 int getFieldType()
          Get the field type.
 java.lang.String getFieldTypeString()
          Get the field type.
 java.lang.String getName()
          Get the name of this field.
 java.lang.String toString()
          Create a pretty string version of this field.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

UNKNOWN_IMPORT

public static final java.lang.String UNKNOWN_IMPORT
Definition of a field type that we don't know yet because it came from an unresolved IMPORT statement.

See Also:
Constant Field Values
Constructor Detail

VRMLFieldDeclaration

public VRMLFieldDeclaration(int accessType,
                            java.lang.String type,
                            java.lang.String name)
                     throws InvalidFieldTypeException
Create an instance of a field declaration. The string type is automatically converted to the appropriate constant.

Parameters:
accessType - The type of access that this node has
type - The type of the node (eg SFInt32)
name - The name of this field
Throws:
InvalidFieldTypeException - The type is not a recognised type in either X3D or VRML97.
See Also:
FieldConstants
Method Detail

getName

public java.lang.String getName()
Get the name of this field. This will be something like "children" or "translation".

Returns:
The name of this field

getAccessType

public int getAccessType()
Get the access type of the field. Under VRML97 this will be one of field, exposedField, eventIn or eventOut. For VRML 3.0, this will always be exposedField.

Returns:
The access type of this node
See Also:
FieldConstants

getFieldType

public int getFieldType()
Get the field type. This string represents the field type such as MFNode, SFInt32. A string is used to allow full extensibility.

Returns:
A constant describing the field type
See Also:
FieldConstants

getFieldSize

public int getFieldSize()
Get the size of the raw element. Ie an SFVec3f would be 3. The lone exception to this is the IMAGE types which will return 1.

Returns:
A constant describing the element size.

getFieldTypeString

public java.lang.String getFieldTypeString()
Get the field type. This string represents the field type such as MFNode, SFInt32. A string is used to allow full extensibility.

Returns:
A string describing the field type
See Also:
FieldConstants

toString

public java.lang.String toString()
Create a pretty string version of this field. It will produce a string of the form
   access_type field_type field_name
 

Returns:
A string representation of this declaration

Xj3D VRML/X3D Code API

Copyright © 2001 - 2005 Web3D Consortium