Package org.web3d.vrml.parser
Class BaseReader
java.lang.Object
org.web3d.vrml.parser.BaseReader
- All Implemented Interfaces:
VRMLReader
- Direct Known Subclasses:
VRML97Reader
,VRMLEncodedReader
,X3DReader
Common reader implementation that can be either strict or lenient in
the parsing.
This parser supports the following properties:
- "conformance": ["weak", "strict"]. String values. Defaults to weak
- Version:
- $Revision: 1.5 $
- Author:
- Justin Couch
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final String
Name of the property specifying the conformance levelprotected ContentHandler
Reference to the registered content handler if we have oneprotected ErrorHandler
Reference to the registered error handler if we have oneprotected org.j3d.util.ErrorReporter
Reference to the registered error handler if we have oneprotected boolean
Flag to ignore the headerMap of properties held by this readerprotected ProtoHandler
Reference to the registered proto handler if we have oneprotected RouteHandler
Reference to the registered route handler if we have oneprotected ScriptHandler
Reference to the registered script handler if we have oneprotected static final String
Name of the property value specifying strict conformanceprotected static final String
Name of the property value specifying weak conformance -
Constructor Summary
Constructors -
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
Set the node handler to the given instance.void
Set the error handler to the given instance.void
setErrorReporter
(org.j3d.util.ErrorReporter ep) Set the error reporter 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.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.web3d.vrml.sav.VRMLReader
parse
-
Field Details
-
CONFORMANCE_PROP
Name of the property specifying the conformance level- See Also:
-
WEAK_CONFORMANCE
Name of the property value specifying weak conformance- See Also:
-
STRICT_CONFORMANCE
Name of the property value specifying strict conformance- See Also:
-
properties
-
contentHandler
Reference to the registered content handler if we have one -
routeHandler
Reference to the registered route handler if we have one -
scriptHandler
Reference to the registered script handler if we have one -
protoHandler
Reference to the registered proto handler if we have one -
errorReporter
protected org.j3d.util.ErrorReporter errorReporterReference to the registered error handler if we have one -
errorHandler
Reference to the registered error handler if we have one -
ignoreHeader
protected boolean ignoreHeaderFlag to ignore the header
-
-
Constructor Details
-
BaseReader
protected BaseReader()Create a new instance of the reader. Does not initialise anything until we know what sort of input file we have.
-
-
Method Details
-
getProperty
Get the value of the named property. VRMLReaders are not required to support any specific property names.- Specified by:
getProperty
in interfaceVRMLReader
- 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.- Specified by:
setProperty
in interfaceVRMLReader
- 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
public 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.- Specified by:
setHeaderIgnore
in interfaceVRMLReader
- Parameters:
enable
- true to stop looking for a header
-
getErrorHandler
public org.j3d.util.ErrorReporter getErrorHandler()Get the currently setErrorHandler
instance. If nothing is set it will return null.- Specified by:
getErrorHandler
in interfaceVRMLReader
- 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.- Specified by:
setErrorHandler
in interfaceVRMLReader
- Parameters:
eh
- The error handler instance to use
-
setErrorReporter
public void setErrorReporter(org.j3d.util.ErrorReporter ep) Set the error reporter instance. If this is also an ErrorHandler instance, the document locator will also be set.- Specified by:
setErrorReporter
in interfaceVRMLReader
- Parameters:
ep
- The error reporter instance to use
-
getContentHandler
Get the currently setContentHandler
instance. If nothing is set it will return null.- Specified by:
getContentHandler
in interfaceVRMLReader
- 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.- Specified by:
setContentHandler
in interfaceVRMLReader
- Parameters:
ch
- The content handler instance to use
-
getScriptHandler
Get the currently setScriptHandler
instance. If nothing is set it will return null.- Specified by:
getScriptHandler
in interfaceVRMLReader
- 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.- Specified by:
setScriptHandler
in interfaceVRMLReader
- Parameters:
sh
- The script handler instance to use
-
getProtoHandler
Get the currently setProtoHandler
instance. If nothing is set it will return null.- Specified by:
getProtoHandler
in interfaceVRMLReader
- 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.- Specified by:
setProtoHandler
in interfaceVRMLReader
- Parameters:
ph
- The proto handler instance to use
-
getRouteHandler
Get the currently setRouteHandler
instance. If nothing is set it will return null.- Specified by:
getRouteHandler
in interfaceVRMLReader
- 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.- Specified by:
setRouteHandler
in interfaceVRMLReader
- Parameters:
rh
- The route handler instance to use
-