Package org.web3d.parser.x3d
Class X3DReader
java.lang.Object
org.web3d.vrml.parser.BaseReader
org.web3d.parser.x3d.X3DReader
- All Implemented Interfaces:
VRMLReader
Implementation of an X3D reader that can be either strict or lenient in
the parsing and supports both VRML and XML encoded files.
When requested to parse, the reader will open the stream and check to see that we have the right sort of parser.
This parser supports the following properties:
- "conformance": ["weak", "strict"]. String values. Defaults to weak
- Version:
- $Revision: 1.15 $
- Author:
- Justin Couch
-
Field Summary
Fields inherited from class org.web3d.vrml.parser.BaseReader
CONFORMANCE_PROP, contentHandler, errorHandler, errorReporter, ignoreHeader, properties, protoHandler, routeHandler, scriptHandler, STRICT_CONFORMANCE, WEAK_CONFORMANCE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
parse
(InputSource input) Parse a VRML document represented by the given input source.void
Set the node handler to the given instance.void
setErrorReporter
(org.j3d.util.ErrorReporter eh) Set the error reporter instance.void
Set the proto handler to the given instance.void
Set the route handler to the given instance.void
Set the script handler to the given instance.Methods inherited from class org.web3d.vrml.parser.BaseReader
getContentHandler, getErrorHandler, getProperty, getProtoHandler, getRouteHandler, getScriptHandler, setErrorHandler, setHeaderIgnore, setProperty
-
Constructor Details
-
X3DReader
public X3DReader()Create a new instance of the reader. Does not initialise anything until we know what sort of input file we have.
-
-
Method Details
-
parse
Parse a VRML document represented by the given input source. This method should not be called while currently processing a stream. If multiple concurrent streams need to be parsed then multiple instances of this interface should be used.- Parameters:
input
- is The input source to be used- Throws:
IOException
- An I/O error while reading the streamVRMLParseException
- A parsing error occurred in the fileSAVNotSupportedException
- The input file is not VRML97 UTF8 encoded.VRMLException
-
setErrorReporter
public void setErrorReporter(org.j3d.util.ErrorReporter eh) Set the error reporter instance. If this is also an ErrorHandler instance, the document locator will also be set.- Specified by:
setErrorReporter
in interfaceVRMLReader
- Overrides:
setErrorReporter
in classBaseReader
- Parameters:
eh
- The error handler instance to use
-
setContentHandler
Set the node handler to the given instance. If the value is null it will clear the currently set instance.- Specified by:
setContentHandler
in interfaceVRMLReader
- Overrides:
setContentHandler
in classBaseReader
- Parameters:
ch
- The content handler instance to use
-
setScriptHandler
Set the script handler to the given instance. If the value is null it will clear the currently set instance.- Specified by:
setScriptHandler
in interfaceVRMLReader
- Overrides:
setScriptHandler
in classBaseReader
- Parameters:
sh
- The script handler instance to use
-
setProtoHandler
Set the proto handler to the given instance. If the value is null it will clear the currently set instance.- Specified by:
setProtoHandler
in interfaceVRMLReader
- Overrides:
setProtoHandler
in classBaseReader
- Parameters:
ph
- The proto handler instance to use
-
setRouteHandler
Set the route handler to the given instance. If the value is null it will clear the currently set instance.- Specified by:
setRouteHandler
in interfaceVRMLReader
- Overrides:
setRouteHandler
in classBaseReader
- Parameters:
rh
- The route handler instance to use
-