Class ModelParser

java.lang.Object
  |
  +--ModelParser
Direct Known Subclasses:
DefaultModelParser

public abstract class ModelParser
extends java.lang.Object

An abstract class to encapsulate the functionality required to properly parse a model file representing a 3D physical object. Perhaps should migrate this to com.sun.java.j3d.loaders.* package classes.


Constructor Summary
protected ModelParser()
          Private constructor.
 
Method Summary
abstract  javax.media.j3d.Group getModel()
          Returns a 3D representation created from the Reader stream.
static ModelParser loadParser(java.lang.String s)
          Loads the ModelParser class specified by the given String.
abstract  void read(java.lang.String filename)
          Parses the given filename to create the BranchGroup object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModelParser

protected ModelParser()
Private constructor. Use loadParser to load a specific ModelParser instance instead of instantiating a ModelParser directly.
Method Detail

read

public abstract void read(java.lang.String filename)
                   throws ModelParserException
Parses the given filename to create the BranchGroup object.
Parameters:
filename - the name of the file to parse for 3D model information.
Throws:
ModelParserException - indicates an error parsing Reader.

getModel

public abstract javax.media.j3d.Group getModel()
                                        throws ModelParserException
Returns a 3D representation created from the Reader stream.
Returns:
the 3D representation object created from the file.
Throws:
ModelParserException - indicates the representation is empty.

loadParser

public static final ModelParser loadParser(java.lang.String s)
                                    throws ModelParserException
Loads the ModelParser class specified by the given String.
Parameters:
s - the name of the ModelParser class to be loaded.
Returns:
an instance of the requested ModelParser class.
Throws:
ModelParserException - indicates an error loading the parser.