Xj3D VRML/X3D Code API

org.web3d.vrml.lang
Class InvalidFieldFormatException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended byjava.lang.RuntimeException
              extended byorg.web3d.vrml.lang.VRMLException
                  extended byorg.web3d.vrml.lang.FieldException
                      extended byorg.web3d.vrml.lang.InvalidFieldFormatException
All Implemented Interfaces:
java.io.Serializable

public class InvalidFieldFormatException
extends FieldException

Exception for when the format provided by the field is invalid for what the field requires.

The exception also has the option of including line and column number information for when it is generated from a file that was read. If the field was parsed from a non-file source, such as the SAI, then no number information will be present and the two getter methods will return a value of -1.

Version:
$Revision: 1.3 $
Author:
Justin Couch
See Also:
Serialized Form

Constructor Summary
InvalidFieldFormatException()
          Create a new exception with no message.
InvalidFieldFormatException(java.lang.String msg)
          Create a new exception with a message.
InvalidFieldFormatException(java.lang.String msg, int lineNumber, int columnNumber)
          Create a new exception with a message and the name of the field that had the error.
InvalidFieldFormatException(java.lang.String msg, int lineNumber, int columnNumber, java.lang.String field)
          Create a new exception with a message and the name of the field that had the error.
InvalidFieldFormatException(java.lang.String msg, java.lang.String field)
          Create a new exception with a message and the name of the field that had the error.
 
Method Summary
 int getColumnNumber()
          Get the column number this exception occurred on.
 java.lang.String getFieldName()
          Get the name of the field that generated this exception.
 int getLineNumber()
          Get the line number this exception occurred on.
 void setColumnNumber(int columnNumber)
          Get the column number this exception occurred on.
 void setFieldName(java.lang.String field)
          Set the name of the field that caused this error.
 void setLineNumber(int lineNumber)
          Get the line number this exception occurred on.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InvalidFieldFormatException

public InvalidFieldFormatException()
Create a new exception with no message.


InvalidFieldFormatException

public InvalidFieldFormatException(java.lang.String msg)
Create a new exception with a message.

Parameters:
msg - The message associated with this exception

InvalidFieldFormatException

public InvalidFieldFormatException(java.lang.String msg,
                                   java.lang.String field)
Create a new exception with a message and the name of the field that had the error.

Parameters:
msg - The message associated with this exception
field - The name of the field with the error

InvalidFieldFormatException

public InvalidFieldFormatException(java.lang.String msg,
                                   int lineNumber,
                                   int columnNumber)
Create a new exception with a message and the name of the field that had the error.

Parameters:
msg - The message associated with this exception
lineNumber - The line number the error occurred on
columnNumber - The column number the error occurred on

InvalidFieldFormatException

public InvalidFieldFormatException(java.lang.String msg,
                                   int lineNumber,
                                   int columnNumber,
                                   java.lang.String field)
Create a new exception with a message and the name of the field that had the error.

Parameters:
msg - The message associated with this exception
field - The name of the field with the error
Method Detail

setFieldName

public void setFieldName(java.lang.String field)
Set the name of the field that caused this error. Used only by the code that generated the exception if the format error and field names are kept in two separate places.

Parameters:
field - The name of the field with the error

getFieldName

public java.lang.String getFieldName()
Get the name of the field that generated this exception. It may or may not be set, depending on the underlying implementation. If not set, this will return null;

Returns:
The name of the field with the invalid error

setLineNumber

public void setLineNumber(int lineNumber)
Get the line number this exception occurred on. If the original parser did not support line numbers this returns -1;

Parameters:
lineNumber - The line number the error was on.

getLineNumber

public int getLineNumber()
Get the line number this exception occurred on. If the original parser did not support line numbers this returns -1;

Returns:
The line number the error was on.

setColumnNumber

public void setColumnNumber(int columnNumber)
Get the column number this exception occurred on. If the original parser did not support column numbers this returns -1;

Parameters:
columnNumber - The column number the error was on.

getColumnNumber

public int getColumnNumber()
Get the column number this exception occurred on. If the original parser did not support column numbers this returns -1;

Returns:
The column number the error was on.

Xj3D VRML/X3D Code API

Copyright © 2001 - 2005 Web3D Consortium