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 StringName of the property specifying the conformance levelprotected ContentHandlerReference to the registered content handler if we have oneprotected ErrorHandlerReference to the registered error handler if we have oneprotected org.j3d.util.ErrorReporterReference to the registered error handler if we have oneprotected booleanFlag to ignore the headerMap of properties held by this readerprotected ProtoHandlerReference to the registered proto handler if we have oneprotected RouteHandlerReference to the registered route handler if we have oneprotected ScriptHandlerReference to the registered script handler if we have oneprotected static final StringName of the property value specifying strict conformanceprotected static final StringName of the property value specifying weak conformance -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the currently setContentHandlerinstance.org.j3d.util.ErrorReporterGet the currently setErrorHandlerinstance.getProperty(String prop) Get the value of the named property.Get the currently setProtoHandlerinstance.Get the currently setRouteHandlerinstance.Get the currently setScriptHandlerinstance.voidSet the node handler to the given instance.voidSet the error handler to the given instance.voidsetErrorReporter(org.j3d.util.ErrorReporter ep) Set the error reporter instance.voidsetHeaderIgnore(boolean enable) Tell the reader that it should not look for the header.voidsetProperty(String name, Object value) Set the value of the named property to the given value.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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
getPropertyin 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:
setPropertyin 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:
setHeaderIgnorein interfaceVRMLReader- Parameters:
enable- true to stop looking for a header
-
getErrorHandler
public org.j3d.util.ErrorReporter getErrorHandler()Get the currently setErrorHandlerinstance. If nothing is set it will return null.- Specified by:
getErrorHandlerin 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:
setErrorHandlerin 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:
setErrorReporterin interfaceVRMLReader- Parameters:
ep- The error reporter instance to use
-
getContentHandler
Get the currently setContentHandlerinstance. If nothing is set it will return null.- Specified by:
getContentHandlerin 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:
setContentHandlerin interfaceVRMLReader- Parameters:
ch- The content handler instance to use
-
getScriptHandler
Get the currently setScriptHandlerinstance. If nothing is set it will return null.- Specified by:
getScriptHandlerin 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:
setScriptHandlerin interfaceVRMLReader- Parameters:
sh- The script handler instance to use
-
getProtoHandler
Get the currently setProtoHandlerinstance. If nothing is set it will return null.- Specified by:
getProtoHandlerin 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:
setProtoHandlerin interfaceVRMLReader- Parameters:
ph- The proto handler instance to use
-
getRouteHandler
Get the currently setRouteHandlerinstance. If nothing is set it will return null.- Specified by:
getRouteHandlerin 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:
setRouteHandlerin interfaceVRMLReader- Parameters:
rh- The route handler instance to use
-