Xj3D 2.0 VRML/X3D Code API

org.web3d.vrml.parser
Class FieldParserFactory

java.lang.Object
  extended by org.web3d.vrml.parser.FieldParserFactory
Direct Known Subclasses:
DefaultFieldParserFactory

public abstract class FieldParserFactory
extends java.lang.Object

Representation of a parser factory for field content.

This is the representation of a basic VRML parser. An parser implementation would extend this instance to provide a specific parser. The implementation class is specified by defining a system property

    org.web3d.vrml.parser.field.factory
 
The value of this property is the fully qualified class name of that implementation. When the ngetFieldParserFactory() method is called it will read that property and create a new instance using reflection. The implementation must have a public, zero argument constructor in order to be loaded.

Each time the newVRMLParserFactory() method is called, it will re-read the property and create an instance of the class. This allows you to create different parser instances for each call within the one JVM instance. If no property is defined then the default implementation is used.

Version:
$Revision: 1.4 $
Author:
Justin Couch

Field Summary
static java.lang.String FACTORY_CLASS_PROP
          Property name for the factory instance
 
Constructor Summary
protected FieldParserFactory()
          Construct a default instance of this factory.
 
Method Summary
static FieldParserFactory getFieldParserFactory()
          Create a new factory parser instance each time this method is called.
abstract  VRMLFieldReader newFieldParser(int major, int minor)
          Request a new instance of a parser for fields of the given specification version.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FACTORY_CLASS_PROP

public static final java.lang.String FACTORY_CLASS_PROP
Property name for the factory instance

See Also:
Constant Field Values
Constructor Detail

FieldParserFactory

protected FieldParserFactory()
Construct a default instance of this factory.

Method Detail

getFieldParserFactory

public static FieldParserFactory getFieldParserFactory()
                                                throws FactoryConfigurationError
Create a new factory parser instance each time this method is called. Looks up the sytem property and builds a new instance on demand.

Returns:
An instance of the factory
Throws:
FactoryConfigurationError - The class could not be found for some reason or other startup error.

newFieldParser

public abstract VRMLFieldReader newFieldParser(int major,
                                               int minor)
Request a new instance of a parser for fields of the given specification version.

Parameters:
major - The major version number of the field to be parsed
minor - The minor version number of the field to be parsed
Returns:
A new parser instance

Xj3D 2.0 VRML/X3D Code API

Copyright © 2001 - 2006 Web3D Consortium