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 TypeMethodDescriptionvoidparse(InputSource input) Parse a VRML document represented by the given input source.voidSet the node handler to the given instance.voidsetErrorReporter(org.j3d.util.ErrorReporter eh) Set the error reporter instance.voidSet the proto handler to the given instance.voidSet the route handler to the given instance.voidSet 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:
setErrorReporterin interfaceVRMLReader- Overrides:
setErrorReporterin 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:
setContentHandlerin interfaceVRMLReader- Overrides:
setContentHandlerin 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:
setScriptHandlerin interfaceVRMLReader- Overrides:
setScriptHandlerin 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:
setProtoHandlerin interfaceVRMLReader- Overrides:
setProtoHandlerin 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:
setRouteHandlerin interfaceVRMLReader- Overrides:
setRouteHandlerin classBaseReader- Parameters:
rh- The route handler instance to use
-