Xj3D 2.0 VRML/X3D Code API

org.web3d.x3d.jaxp
Class X3DSAVAdapter

java.lang.Object
  extended by org.web3d.x3d.jaxp.X3DSAVAdapter
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.ext.LexicalHandler

public class X3DSAVAdapter
extends java.lang.Object
implements org.xml.sax.ext.LexicalHandler, org.xml.sax.ContentHandler

Interface adapter between XML input from a SAX source to the SAV source used by the other parsers.

The implementation is a simplistic way for quickly getting XML content into the normal VRML input sources by adapting the SAX feeds to SAV feeds.

Version:
$Revision: 1.45 $
Author:
Justin Couch

Field Summary
protected static HashSet allowedPublicIDs
          Set of permitted public IDs
protected static HashSet allowedSystemIDs
          Set of permitted system IDs
protected static java.lang.String AS_ATTR
          String constant of the AS attribute
protected static java.util.HashMap attributeMap
          Mapping of reserved attribute names strings to constants
protected  java.lang.StringBuffer characterDataBuffer
          The buffer to put all the scripting string into as we're building up CDATA information.
protected  boolean checkForSceneTag
          Flag to say we need to check next for a valid scene tag
protected  boolean checkForX3DNamespace
          Flag indicating if the X3D namespace is set as the one that does not need to be prepended.
protected static java.lang.String CLASS_ATTR
          String constant of the Class attribute
protected static int CLASS_ATTR_ID
           
protected static int COMPONENT_TAG
           
protected static int CONNECT_TAG
           
protected static java.lang.String CONTAINER_ATTR
          String constant of the containerField attribute
protected static int CONTAINER_ATTR_ID
           
protected static java.lang.String CONTAINER_PROPS_FILE
          Name of the property file holding the default container fields
protected  java.util.Properties containerFields
          Property for container fields
protected  ContentHandler contentHandler
          Reference to the registered content handler if we have one
protected  IntStack declDepthStack
          Stack of fieldDeclDepth counts as we traverse the script and proto instance declarations, particularly field value calls
protected static java.lang.String DEF_ATTR
          String constant of the DEF attribute
protected static int DEF_ATTR_ID
           
protected  IntStack depthCountStack
          Stack of protoBodyDepth counts as we traverse the script and proto declarations.
protected static java.util.HashMap elementMap
          Mapping of element names strings to constants
protected  java.lang.String epUrl
          Stored extern proto url to smooth model differences
protected  ErrorReporter errorReporter
          Reporter instance for handing out errors
protected static int EXPORT_TAG
           
protected static int EXTERNPROTO_DECL_TAG
           
protected static int FIELD_TAG
           
protected static int FIELD_VALUE_TAG
           
protected static java.util.HashMap fieldAccessMap
          Mapping of field access type strings to constant integers
protected  int fieldDeclDepth
          Flag to say we're in the processing of any field element right now
protected  java.lang.String fullURL
          The full URL of the current world
protected static int HEAD_TAG
           
protected static int IMPORT_TAG
           
protected  boolean inScript
          Flag to say we're in the processing of a script fields right now
protected static java.lang.String INVALID_DTD_NAME_MSG
          Message because the DTD name is wrong
protected static java.lang.String INVALID_PUBLIC_ID_MSG
          Message because the PUBLIC ID is wrong
protected static java.lang.String INVALID_SYSTEM_ID_MSG
          Message because the SYSTEM ID is wrong
protected static int IS_TAG
           
protected static int META_TAG
           
protected static java.lang.String NAME_ATTR
          String constant of the name attribute
protected static int NAME_ATTR_ID
           
protected  HashSet namespacePrefixes
          A set of prefixes that we know about for the namespace IDs.
protected static java.lang.String NO_PROFILE_MSG
          Message when no profile was given
protected static java.lang.String NO_SCENE_TAG_MSG
          Message when there was no scene tag provided
protected  boolean overrideLex
          Should we attempt to makeup for missing lexical events
protected static int PROTO_BODY_TAG
           
protected static int PROTO_DECL_TAG
           
protected static int PROTO_INSTANCE_TAG
           
protected static int PROTO_INTERFACE_TAG
           
protected  ProtoHandler protoHandler
          Reference to the registered proto handler if we have one
protected static int ROUTE_TAG
           
protected  RouteHandler routeHandler
          Reference to the registered route handler if we have one
protected  Locator savLocator
          The SAV locator to find error information
protected  org.xml.sax.Locator saxLocator
          The document SAX locator to find error information
protected static int SCENE_TAG
           
protected static int SCRIPT_TAG
           
protected  BooleanStack scriptFlagStack
          Stack holding proto and script declaration semantics
protected  ScriptHandler scriptHandler
          Reference to the registered script handler if we have one
protected  BooleanStack scriptUrlStack
          Stack of flags on whether a Script had a url.
protected static java.util.HashMap specStringMap
          Map the spec version to version string
protected static java.util.HashMap specVersionMap
          Map the public ID to the spec version
protected static HashSet systemSchemaIDs
          Set of permitted schema IDs
protected static java.lang.String TRANSITIONAL_HEADER_MSG
          Message when transitional content detected
protected static java.lang.String UNKNOWN_ACCESS_TYPE_MSG
          Message for a bad field access type
protected static java.lang.String UNKNOWN_DTD_MSG
          Message when transitional content detected
protected static java.lang.String USE_ATTR
          String constant of the USE attribute
protected static int USE_ATTR_ID
           
protected static java.lang.String USE_WITH_KIDS_MSG
          Message when no profile was given
protected  boolean useIsCurrent
          Flag to say the previous startNode() was actually a USE
protected static java.lang.String VALUE_ATTR
          String constant of the value attribute
protected static java.lang.String VERSION_ATTR
          String constant of the version attribute
protected  java.lang.String versionString
          The version string defined by the spec
protected  java.lang.String worldURL
          World URL, for passing on to the listener
protected static int X3D_TAG
           
protected  java.lang.String x3dNamespaceId
          The ID string that is associated with the X3D namespace from the incoming document.
protected static java.lang.String XML_ENCODING
          Keyword describing the XML encoding for the start doc call
 
Constructor Summary
X3DSAVAdapter()
          Construct a default instance of this class.
 
Method Summary
 void characters(char[] ch, int start, int length)
          Notification of character data to be added to the document.
 void comment(char[] ch, int start, int length)
          Report an XML comment anywhere in the document.
 void endCDATA()
          Report the end of a CDATA section.
 void endDocument()
          End the current document that is being parsed.
 void endDTD()
          Report the end of DTD declarations.
 void endElement(java.lang.String namespace, java.lang.String name, java.lang.String qName)
          End the element processing.
 void endEntity(java.lang.String name)
          Report the end of an entity.
 void endPrefixMapping(java.lang.String prefix)
          End the mapping for the named prefix
protected  void endScript()
          End a script.
 ContentHandler getContentHandler()
          Get the currently set ContentHandler instance.
 ProtoHandler getProtoHandler()
          Get the currently set ProtoHandler instance.
 RouteHandler getRouteHandler()
          Get the currently set RouteHandler instance.
 ScriptHandler getScriptHandler()
          Get the currently set ScriptHandler instance.
 void ignorableWhitespace(char[] ch, int start, int length)
          Notification of ignorable whitespace.
protected  void loadContainerProperties(float specVersion)
          Load the properties files for the given spec version.
protected  int processFieldAccess(java.lang.String type, java.lang.String fieldName)
          Turn the field access type string into one of the standard contents
 void processingInstruction(java.lang.String target, java.lang.String data)
          Notification that a processing instruction has been added.
 void setContentHandler(ContentHandler ch)
          Set the node handler to the given instance.
 void setDocumentLocator(org.xml.sax.Locator loc)
          Set the saxLocator used to report error information back to the user.
 void setErrorReporter(ErrorReporter reporter)
          Register an error reporter with the manager so that any errors generated by the loading of script code can be reported in a nice, pretty fashion.
 void setLoadState(java.lang.String worldURL, java.lang.String fullURL, boolean overrideLex)
          Set the loading state.
 void setProtoHandler(ProtoHandler ph)
          Set the proto handler to the given instance.
 void setRouteHandler(RouteHandler rh)
          Set the route handler to the given instance.
 void setScriptHandler(ScriptHandler sh)
          Set the script handler to the given instance.
 void skippedEntity(java.lang.String name)
          Notification of an entity that was skipped during the processing.
 void startCDATA()
          Report the start of a CDATA section.
 void startDocument()
          Start a new document to be parsed.
 void startDTD(java.lang.String name, java.lang.String publicId, java.lang.String systemId)
          Report the start of DTD declarations, if any.
 void startElement(java.lang.String namespace, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attribs)
          Start the processing of a new element with the given collection of attribute information.
 void startEntity(java.lang.String name)
          Report the beginning of some internal and external XML entities.
 void startPrefixMapping(java.lang.String prefix, java.lang.String uri)
          Start the prefix mapping for a particular element or attribute.
protected  void startScript()
          Start of a script declaration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CONTAINER_PROPS_FILE

protected static final java.lang.String CONTAINER_PROPS_FILE
Name of the property file holding the default container fields

See Also:
Constant Field Values

INVALID_DTD_NAME_MSG

protected static final java.lang.String INVALID_DTD_NAME_MSG
Message because the DTD name is wrong

See Also:
Constant Field Values

INVALID_PUBLIC_ID_MSG

protected static final java.lang.String INVALID_PUBLIC_ID_MSG
Message because the PUBLIC ID is wrong

See Also:
Constant Field Values

INVALID_SYSTEM_ID_MSG

protected static final java.lang.String INVALID_SYSTEM_ID_MSG
Message because the SYSTEM ID is wrong

See Also:
Constant Field Values

TRANSITIONAL_HEADER_MSG

protected static final java.lang.String TRANSITIONAL_HEADER_MSG
Message when transitional content detected

See Also:
Constant Field Values

UNKNOWN_DTD_MSG

protected static final java.lang.String UNKNOWN_DTD_MSG
Message when transitional content detected

See Also:
Constant Field Values

UNKNOWN_ACCESS_TYPE_MSG

protected static final java.lang.String UNKNOWN_ACCESS_TYPE_MSG
Message for a bad field access type

See Also:
Constant Field Values

NO_PROFILE_MSG

protected static final java.lang.String NO_PROFILE_MSG
Message when no profile was given

See Also:
Constant Field Values

NO_SCENE_TAG_MSG

protected static final java.lang.String NO_SCENE_TAG_MSG
Message when there was no scene tag provided

See Also:
Constant Field Values

USE_WITH_KIDS_MSG

protected static final java.lang.String USE_WITH_KIDS_MSG
Message when no profile was given

See Also:
Constant Field Values

XML_ENCODING

protected static final java.lang.String XML_ENCODING
Keyword describing the XML encoding for the start doc call

See Also:
Constant Field Values

X3D_TAG

protected static final int X3D_TAG
See Also:
Constant Field Values

COMPONENT_TAG

protected static final int COMPONENT_TAG
See Also:
Constant Field Values

SCENE_TAG

protected static final int SCENE_TAG
See Also:
Constant Field Values

PROTO_DECL_TAG

protected static final int PROTO_DECL_TAG
See Also:
Constant Field Values

EXTERNPROTO_DECL_TAG

protected static final int EXTERNPROTO_DECL_TAG
See Also:
Constant Field Values

IS_TAG

protected static final int IS_TAG
See Also:
Constant Field Values

FIELD_TAG

protected static final int FIELD_TAG
See Also:
Constant Field Values

META_TAG

protected static final int META_TAG
See Also:
Constant Field Values

PROTO_INSTANCE_TAG

protected static final int PROTO_INSTANCE_TAG
See Also:
Constant Field Values

IMPORT_TAG

protected static final int IMPORT_TAG
See Also:
Constant Field Values

EXPORT_TAG

protected static final int EXPORT_TAG
See Also:
Constant Field Values

ROUTE_TAG

protected static final int ROUTE_TAG
See Also:
Constant Field Values

FIELD_VALUE_TAG

protected static final int FIELD_VALUE_TAG
See Also:
Constant Field Values

SCRIPT_TAG

protected static final int SCRIPT_TAG
See Also:
Constant Field Values

CONNECT_TAG

protected static final int CONNECT_TAG
See Also:
Constant Field Values

HEAD_TAG

protected static final int HEAD_TAG
See Also:
Constant Field Values

PROTO_INTERFACE_TAG

protected static final int PROTO_INTERFACE_TAG
See Also:
Constant Field Values

PROTO_BODY_TAG

protected static final int PROTO_BODY_TAG
See Also:
Constant Field Values

NAME_ATTR

protected static final java.lang.String NAME_ATTR
String constant of the name attribute

See Also:
Constant Field Values

VERSION_ATTR

protected static final java.lang.String VERSION_ATTR
String constant of the version attribute

See Also:
Constant Field Values

VALUE_ATTR

protected static final java.lang.String VALUE_ATTR
String constant of the value attribute

See Also:
Constant Field Values

DEF_ATTR

protected static final java.lang.String DEF_ATTR
String constant of the DEF attribute

See Also:
Constant Field Values

USE_ATTR

protected static final java.lang.String USE_ATTR
String constant of the USE attribute

See Also:
Constant Field Values

AS_ATTR

protected static final java.lang.String AS_ATTR
String constant of the AS attribute

See Also:
Constant Field Values

CLASS_ATTR

protected static final java.lang.String CLASS_ATTR
String constant of the Class attribute

See Also:
Constant Field Values

CONTAINER_ATTR

protected static final java.lang.String CONTAINER_ATTR
String constant of the containerField attribute

See Also:
Constant Field Values

NAME_ATTR_ID

protected static final int NAME_ATTR_ID
See Also:
Constant Field Values

DEF_ATTR_ID

protected static final int DEF_ATTR_ID
See Also:
Constant Field Values

USE_ATTR_ID

protected static final int USE_ATTR_ID
See Also:
Constant Field Values

CLASS_ATTR_ID

protected static final int CLASS_ATTR_ID
See Also:
Constant Field Values

CONTAINER_ATTR_ID

protected static final int CONTAINER_ATTR_ID
See Also:
Constant Field Values

specVersionMap

protected static java.util.HashMap specVersionMap
Map the public ID to the spec version


specStringMap

protected static java.util.HashMap specStringMap
Map the spec version to version string


allowedPublicIDs

protected static HashSet allowedPublicIDs
Set of permitted public IDs


allowedSystemIDs

protected static HashSet allowedSystemIDs
Set of permitted system IDs


systemSchemaIDs

protected static HashSet systemSchemaIDs
Set of permitted schema IDs


fieldAccessMap

protected static java.util.HashMap fieldAccessMap
Mapping of field access type strings to constant integers


elementMap

protected static java.util.HashMap elementMap
Mapping of element names strings to constants


attributeMap

protected static java.util.HashMap attributeMap
Mapping of reserved attribute names strings to constants


versionString

protected java.lang.String versionString
The version string defined by the spec


containerFields

protected java.util.Properties containerFields
Property for container fields


errorReporter

protected ErrorReporter errorReporter
Reporter instance for handing out errors


saxLocator

protected org.xml.sax.Locator saxLocator
The document SAX locator to find error information


savLocator

protected Locator savLocator
The SAV locator to find error information


contentHandler

protected ContentHandler contentHandler
Reference to the registered content handler if we have one


routeHandler

protected RouteHandler routeHandler
Reference to the registered route handler if we have one


scriptHandler

protected ScriptHandler scriptHandler
Reference to the registered script handler if we have one


protoHandler

protected ProtoHandler protoHandler
Reference to the registered proto handler if we have one


worldURL

protected java.lang.String worldURL
World URL, for passing on to the listener


fullURL

protected java.lang.String fullURL
The full URL of the current world


useIsCurrent

protected boolean useIsCurrent
Flag to say the previous startNode() was actually a USE


characterDataBuffer

protected java.lang.StringBuffer characterDataBuffer
The buffer to put all the scripting string into as we're building up CDATA information.


scriptFlagStack

protected BooleanStack scriptFlagStack
Stack holding proto and script declaration semantics


inScript

protected boolean inScript
Flag to say we're in the processing of a script fields right now


fieldDeclDepth

protected int fieldDeclDepth
Flag to say we're in the processing of any field element right now


depthCountStack

protected IntStack depthCountStack
Stack of protoBodyDepth counts as we traverse the script and proto declarations.


declDepthStack

protected IntStack declDepthStack
Stack of fieldDeclDepth counts as we traverse the script and proto instance declarations, particularly field value calls


overrideLex

protected boolean overrideLex
Should we attempt to makeup for missing lexical events


checkForSceneTag

protected boolean checkForSceneTag
Flag to say we need to check next for a valid scene tag


epUrl

protected java.lang.String epUrl
Stored extern proto url to smooth model differences


scriptUrlStack

protected BooleanStack scriptUrlStack
Stack of flags on whether a Script had a url. Used to ignore CDATA.


x3dNamespaceId

protected java.lang.String x3dNamespaceId
The ID string that is associated with the X3D namespace from the incoming document. This will be defined in the X3D tag as one of the attributes.


namespacePrefixes

protected HashSet namespacePrefixes
A set of prefixes that we know about for the namespace IDs. These will be extracted from the xmlns: values in the X3D tag.


checkForX3DNamespace

protected boolean checkForX3DNamespace
Flag indicating if the X3D namespace is set as the one that does not need to be prepended. This can be determined from the xsd:noNamespaceSchemaLocation attribute on the X3D tag. We look for one of the matching schema locations.

Constructor Detail

X3DSAVAdapter

public X3DSAVAdapter()
Construct a default instance of this class.

Method Detail

setLoadState

public void setLoadState(java.lang.String worldURL,
                         java.lang.String fullURL,
                         boolean overrideLex)
Set the loading state. Generally this is information that is gotten from the lexicalHandler. Seems XSLT transformation is keeping the lex handler to itself.

Parameters:
worldURL - the worldURL
fullURL - the full URL
overrideLex - Enable if lexicalHandling not working.

comment

public void comment(char[] ch,
                    int start,
                    int length)
Report an XML comment anywhere in the document.

Specified by:
comment in interface org.xml.sax.ext.LexicalHandler

startDTD

public void startDTD(java.lang.String name,
                     java.lang.String publicId,
                     java.lang.String systemId)
              throws org.xml.sax.SAXException
Report the start of DTD declarations, if any. There are two formal doctypes supported. The first type is the required type by the X3D specification:
   <!DOCTYPE X3D PUBLIC "-//Web3D//DTD X3D 3.0//EN"
    "http://www.web3d.org/specification/x3d/x3d-3_0.dtd">
 
The second type are the transitional DOCTYPEs used during development of the X3D specification.
   <!DOCTYPE X3D PUBLIC
    "http://www.web3D.org/TaskGroups/x3d/translation/x3d-compact.dtd"
    "/www.web3D.org/TaskGroups/x3d/translation/x3d-compact.dtd">
 
   <!DOCTYPE X3D PUBLIC
    "http://www.web3d.org/specifications/x3d-3.0.dtd"
    "/www.web3d.org/TaskGroups/x3d/translation/x3d-3.0.dtd">
 
It is advised that these forms are never used, it is for transitional content only. When this header is detected, a warning message is generated on the output, but parsing continues normally.

Specified by:
startDTD in interface org.xml.sax.ext.LexicalHandler
Parameters:
name - The DTD name string
publicId - The Public ID used for the content
systemId - The system ID used for the content
Throws:
org.xml.sax.SAXException

endDTD

public void endDTD()
Report the end of DTD declarations. Does nothing.

Specified by:
endDTD in interface org.xml.sax.ext.LexicalHandler

startCDATA

public void startCDATA()
Report the start of a CDATA section. Script data for the URLs are sent this way.

Specified by:
startCDATA in interface org.xml.sax.ext.LexicalHandler

endCDATA

public void endCDATA()
Report the end of a CDATA section.

Specified by:
endCDATA in interface org.xml.sax.ext.LexicalHandler

startEntity

public void startEntity(java.lang.String name)
Report the beginning of some internal and external XML entities.

Specified by:
startEntity in interface org.xml.sax.ext.LexicalHandler

endEntity

public void endEntity(java.lang.String name)
Report the end of an entity.

Specified by:
endEntity in interface org.xml.sax.ext.LexicalHandler

setDocumentLocator

public void setDocumentLocator(org.xml.sax.Locator loc)
Set the saxLocator used to report error information back to the user. Setting a value of null will clear the current saxLocator.

Specified by:
setDocumentLocator in interface org.xml.sax.ContentHandler
Parameters:
loc - The saxLocator to use or null to clear

startDocument

public void startDocument()
                   throws org.xml.sax.SAXException
Start a new document to be parsed. If the instance is currently in the middle of parsing a document, this will throw an exception. Does nothing because the document start is assumed to be sent to the SAV content handler after the DTD has been read.

Specified by:
startDocument in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException - The document is currently being parsed

endDocument

public void endDocument()
                 throws org.xml.sax.SAXException
End the current document that is being parsed. Cleans up any internal structures currently in use but leaves the Document object about to work with.

Specified by:
endDocument in interface org.xml.sax.ContentHandler
Throws:
org.xml.sax.SAXException - Not thrown in this implementation

startPrefixMapping

public void startPrefixMapping(java.lang.String prefix,
                               java.lang.String uri)
                        throws org.xml.sax.SAXException
Start the prefix mapping for a particular element or attribute. Not implemented yet

Specified by:
startPrefixMapping in interface org.xml.sax.ContentHandler
Parameters:
prefix - The prefix string used
uri - The namespace URI the prefix is mapped to
Throws:
org.xml.sax.SAXException - Not thrown in this implementation

endPrefixMapping

public void endPrefixMapping(java.lang.String prefix)
                      throws org.xml.sax.SAXException
End the mapping for the named prefix

Specified by:
endPrefixMapping in interface org.xml.sax.ContentHandler
Parameters:
prefix - The prefix to stop the URI mapping for
Throws:
org.xml.sax.SAXException - Not thrown in this implementation

startElement

public void startElement(java.lang.String namespace,
                         java.lang.String localName,
                         java.lang.String qName,
                         org.xml.sax.Attributes attribs)
                  throws org.xml.sax.SAXException
Start the processing of a new element with the given collection of attribute information.

Specified by:
startElement in interface org.xml.sax.ContentHandler
Parameters:
namespace - The namespace for the element. Null if not used
localName - The local name of the element to create
qName - The qualified name of the element including prefix
attribs - The collection of attributes to use
Throws:
org.xml.sax.SAXException - The element can't be found in the underlying factory

endElement

public void endElement(java.lang.String namespace,
                       java.lang.String name,
                       java.lang.String qName)
                throws org.xml.sax.SAXException
End the element processing.

Specified by:
endElement in interface org.xml.sax.ContentHandler
Parameters:
namespace - The namespace for the element. Null if not used
name - The local name of the element to create
qName - The qualified name of the element including prefix
Throws:
org.xml.sax.SAXException - Not thrown in this implementation

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws org.xml.sax.SAXException
Notification of character data to be added to the document. If we are currently parsing a CDATA section then we just append the string to the current string.

Specified by:
characters in interface org.xml.sax.ContentHandler
Parameters:
ch - The characters to add as a comment
start - The start position in the character array
length - The number of characters to use as a comment
Throws:
org.xml.sax.SAXException - The node containing the characters in is invalid

ignorableWhitespace

public void ignorableWhitespace(char[] ch,
                                int start,
                                int length)
                         throws org.xml.sax.SAXException
Notification of ignorable whitespace. If we are set to ignore whitespace then this method does nothing. If we do not ignore it then we add it to the current CDATA section if we are processing a CDATA, else append it as data to the current top node

Specified by:
ignorableWhitespace in interface org.xml.sax.ContentHandler
Parameters:
ch - The characters to add as a comment
start - The start position in the character array
length - The number of characters to use as a comment
Throws:
org.xml.sax.SAXException - The node containing the characters in is invalid

processingInstruction

public void processingInstruction(java.lang.String target,
                                  java.lang.String data)
                           throws org.xml.sax.SAXException
Notification that a processing instruction has been added. Ignored.

Specified by:
processingInstruction in interface org.xml.sax.ContentHandler
Parameters:
target - The target instruction name
data - Data associated with the instruction
Throws:
org.xml.sax.SAXException - The instruction is invalid

skippedEntity

public void skippedEntity(java.lang.String name)
                   throws org.xml.sax.SAXException
Notification of an entity that was skipped during the processing. Not implemented yet.

Specified by:
skippedEntity in interface org.xml.sax.ContentHandler
Parameters:
name - The name of the entity that was skipped
Throws:
org.xml.sax.SAXException - Not thrown in this implementation

setErrorReporter

public void setErrorReporter(ErrorReporter reporter)
Register an error reporter with the manager so that any errors generated by the loading of script code can be reported in a nice, pretty fashion. Setting a value of null will clear the currently set reporter. If one is already set, the new value replaces the old.

Parameters:
reporter - The instance to use or null

getContentHandler

public ContentHandler getContentHandler()
Get the currently set ContentHandler instance. If nothing is set it will return null.

Returns:
The currently set node handler.

setContentHandler

public void setContentHandler(ContentHandler ch)
Set the node handler to the given instance. If the value is null it will clear the currently set instance.

Parameters:
ch - The content handler instance to use

getScriptHandler

public ScriptHandler getScriptHandler()
Get the currently set ScriptHandler instance. If nothing is set it will return null.

Returns:
The currently set script handler.

setScriptHandler

public void setScriptHandler(ScriptHandler sh)
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

public ProtoHandler getProtoHandler()
Get the currently set ProtoHandler instance. If nothing is set it will return null.

Returns:
The currently set proto handler.

setProtoHandler

public void setProtoHandler(ProtoHandler ph)
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

public RouteHandler getRouteHandler()
Get the currently set RouteHandler instance. If nothing is set it will return null.

Returns:
The currently set route handler.

setRouteHandler

public void setRouteHandler(RouteHandler rh)
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

processFieldAccess

protected int processFieldAccess(java.lang.String type,
                                 java.lang.String fieldName)
                          throws org.xml.sax.SAXException
Turn the field access type string into one of the standard contents

Parameters:
type - A string representing the access type
fieldName - The name of the field to process
Returns:
The access type as an int from FieldConstants constants
Throws:
org.xml.sax.SAXException

loadContainerProperties

protected void loadContainerProperties(float specVersion)
Load the properties files for the given spec version.

Parameters:
specVersion - The spec version in floating point format

startScript

protected void startScript()
Start of a script declaration.


endScript

protected void endScript()
End a script. Sends url data from the CDATA block.


Xj3D 2.0 VRML/X3D Code API

Copyright © 2001 - 2006 Web3D Consortium