|
Xj3D 2.0 VRML/X3D Code API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.web3d.vrml.parser.VRMLParserFactory
public abstract class VRMLParserFactory
Representation of a parser factory for VRML 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.file.factory
The value of this property is the fully qualified class name of that
implementation. When the newVRMLParserFactory() 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.
All factories are required to support the feature name "VRML-utf8". The version is the VRML specification version supported in the UTF8 encoding (it is also possible the binary version may use this, but definitely not XML encoding).
The following a standard properties that may be required of all factories and readers
| Name | Values | Default | Description |
|---|---|---|---|
| Required-Version | "2.0", "3.0" | NULL | When defined it says that the VRMLReader provided must only support the given version. If it is not supplied then the reader will do its best effort to adapt it's parsing to the version supplied in the stream's header |
| Required-Format | "VRML", "X3D" | NULL | When defined it says to use this specific file format for the specification. |
| Field Summary | |
|---|---|
static java.lang.String |
FACTORY_CLASS_PROP
Property name for the factory instance |
protected java.util.Map |
propertyMap
The list of properties that have been set. |
static java.lang.String |
REQUIRE_FORMAT_PROP
Property defining the required file type |
static java.lang.String |
REQUIRE_VERSION_PROP
Property defining a required version |
static java.lang.String |
VRML_FEATURE
Feature name for the required VRML feature |
static java.lang.String |
X3D_FEATURE
Feature name for the required VRML feature |
| Constructor Summary | |
|---|---|
protected |
VRMLParserFactory()
Construct a default instance of this factory. |
| Method Summary | |
|---|---|
java.lang.Object |
getProperty(java.lang.String prop)
Get the value of the named property. |
abstract boolean |
hasFeature(java.lang.String feature,
java.lang.String version)
Check to see if this implementation has the nominated feature. |
static VRMLParserFactory |
newVRMLParserFactory()
Create a new factory parser instance each time this method is called. |
abstract VRMLReader |
newVRMLReader()
Request a new instance of a VRMLReader to parse documents. |
void |
setProperty(java.lang.String name,
java.lang.Object value)
Set the value of the named property to the given value. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String FACTORY_CLASS_PROP
public static final java.lang.String VRML_FEATURE
public static final java.lang.String X3D_FEATURE
public static final java.lang.String REQUIRE_VERSION_PROP
public static final java.lang.String REQUIRE_FORMAT_PROP
protected java.util.Map propertyMap
| Constructor Detail |
|---|
protected VRMLParserFactory()
| Method Detail |
|---|
public static VRMLParserFactory newVRMLParserFactory()
throws FactoryConfigurationError
FactoryConfigurationError - The class could not be found for some
reason or other startup error.public abstract VRMLReader newVRMLReader()
public java.lang.Object getProperty(java.lang.String prop)
throws SAVNotSupportedException
prop - The name of the property to get the value of
SAVNotSupportedException - The VRMLReader does not recognize
or does not support this property name.
public void setProperty(java.lang.String name,
java.lang.Object value)
throws SAVNotSupportedException
VRMLReader before it is returned to the user
after creation.
name - The name of the property to setvalue - The value of this property
SAVNotSupportedException - The VRMLReader does not recognize
or does not support this property name.
public abstract boolean hasFeature(java.lang.String feature,
java.lang.String version)
feature - The name of the feature requestedversion - The version of the feature required or null for none
|
Xj3D 2.0 VRML/X3D Code API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||