Package org.web3d.vrml.sav
Interface VRMLReader
- All Known Implementing Classes:
BaseReader
,VRML97Reader
,VRMLEncodedReader
,X3DReader
,XMLReader
public interface VRMLReader
Representation of a class capable of reading a VRML source and providing
event notification of the items in that file.
The class acts as a serial stream of events as the VRML file is parsed. If a given handler is not registered, events of these types will be ignored.
All SAV interfaces are assumed to be Synchronous. The parse methods shall not return until parsing is complete and readers shall wait for an event handler callback to return before reporting the next event.
- Version:
- $Revision: 1.8 $
- Author:
- Justin Couch
-
Method Summary
Modifier and TypeMethodDescriptionGet the currently setContentHandler
instance.org.j3d.util.ErrorReporter
Get the currently setErrorHandler
instance.getProperty
(String prop) Get the value of the named property.Get the currently setProtoHandler
instance.Get the currently setRouteHandler
instance.Get the currently setScriptHandler
instance.void
parse
(InputSource is) Parse a VRML document represented by the given input source.void
Set the node handler to the given instance.void
Set the error handler to the given instance.void
setErrorReporter
(org.j3d.util.ErrorReporter eh) Set the error handler to the given instance.void
setHeaderIgnore
(boolean enable) Tell the reader that it should not look for the header.void
setProperty
(String name, Object value) Set the value of the named property to the given value.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.
-
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:
is
- The input source to be used- Throws:
IOException
- An I/O error while reading the streamVRMLParseException
- A parsing error occurred in the fileVRMLException
-
getProperty
Get the value of the named property. VRMLReaders are not required to support any specific property names.- Parameters:
prop
- The name of the property to get the value of- Returns:
- The value of the set property or null if not set
- Throws:
SAVNotSupportedException
- The VRMLReader does not recognize or does not support this property name.
-
setProperty
Set the value of the named property to the given value. VRMLReaders are not required to support any specific property names. Using a value of null will clear the currently set property value.- Parameters:
name
- The name of the property to setvalue
- The value of this property- Throws:
SAVNotSupportedException
- The VRMLReader does not recognize or does not support this property name.
-
setHeaderIgnore
void setHeaderIgnore(boolean enable) Tell the reader that it should not look for the header. This is needed to deal with createVrmlFromString() calls that do not include the header as part of the stream and would otherwise cause an error.- Parameters:
enable
- true to stop looking for a header
-
getErrorHandler
org.j3d.util.ErrorReporter getErrorHandler()Get the currently setErrorHandler
instance. If nothing is set it will return null.- Returns:
- The currently set error handler.
-
setErrorHandler
Set the error handler to the given instance. If the value is null it will clear the currently set instance.- Parameters:
eh
- The error handler instance to use
-
setErrorReporter
void setErrorReporter(org.j3d.util.ErrorReporter eh) Set the error handler to the given instance. If the value is null it will clear the currently set instance. If the reporter is also an instance of ErrorHandler, the actions will be the same as for setting an error handler.- Parameters:
eh
- The error reporter instance to use
-
getContentHandler
ContentHandler getContentHandler()Get the currently setContentHandler
instance. If nothing is set it will return null.- Returns:
- The currently set node handler.
-
setContentHandler
Set the node handler to the given instance. If the value is null it will clear the currently set instance.- Parameters:
nh
- The node handler instance to use
-
getScriptHandler
ScriptHandler getScriptHandler()Get the currently setScriptHandler
instance. If nothing is set it will return null.- Returns:
- The currently set script handler.
-
setScriptHandler
Set the script handler to the given instance. If the value is null it will clear the currently set instance.- Parameters:
sh
- The script handler instance to use
-
getProtoHandler
ProtoHandler getProtoHandler()Get the currently setProtoHandler
instance. If nothing is set it will return null.- Returns:
- The currently set proto handler.
-
setProtoHandler
Set the proto handler to the given instance. If the value is null it will clear the currently set instance.- Parameters:
ph
- The proto handler instance to use
-
getRouteHandler
RouteHandler getRouteHandler()Get the currently setRouteHandler
instance. If nothing is set it will return null.- Returns:
- The currently set route handler.
-
setRouteHandler
Set the route handler to the given instance. If the value is null it will clear the currently set instance.- Parameters:
rh
- The route handler instance to use
-