Package org.web3d.x3d.jaxp
Class X3DSAVAdapterTolerant
java.lang.Object
org.web3d.x3d.jaxp.X3DSAVAdapter
org.web3d.x3d.jaxp.X3DSAVAdapterTolerant
- All Implemented Interfaces:
ContentHandler
,LexicalHandler
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. This implementation of the SAVAdapter is tolerant of incorrect files. It will attempt to correct most common errors found in user content.
- Version:
- $Revision: 1.48 $
- Author:
- Alan Hudson
-
Field Summary
FieldsModifier and TypeFieldDescriptionMapping of element names strings to constantsFields inherited from class org.web3d.x3d.jaxp.X3DSAVAdapter
allowedPublicIDs, allowedSystemIDs, AS_ATTR, attributeMap, characterDataBuffer, checkForSceneTag, checkForX3DNamespace, CLASS_ATTR, CLASS_ATTR_ID, COMPONENT_TAG, CONNECT_TAG, CONTAINER_ATTR, CONTAINER_ATTR_ID, CONTAINER_PROPS_FILE, CONTAINER_PROPS_READ_ERR, containerFields, contentHandler, declDepthStack, DEF_ATTR, DEF_ATTR_ID, depthCountStack, elementMap, epUrl, errorReporter, EXPORT_TAG, EXTERNPROTO_DECL_TAG, FIELD_TAG, FIELD_VALUE_TAG, fieldAccessMap, fieldDeclDepth, fullURL, HEAD_TAG, IMPORT_TAG, inScript, INVALID_DTD_NAME_MSG, INVALID_PUBLIC_ID_MSG, INVALID_SYSTEM_ID_MSG, IS_TAG, META_TAG, NAME_ATTR, NAME_ATTR_ID, namespacePrefixes, NO_CONTAINER_PROPS_MSG, NO_PROFILE_MSG, NO_SCENE_TAG_MSG, overrideLex, PROFILE_ATTR, PROTO_BODY_TAG, PROTO_DECL_TAG, PROTO_INSTANCE_TAG, PROTO_INTERFACE_TAG, protoHandler, ROUTE_TAG, routeHandler, savLocator, saxLocator, SCENE_TAG, SCRIPT_TAG, scriptFlagStack, scriptHandler, scriptUrlStack, specStringMap, specVersionMap, systemSchemaIDs, TRANSITIONAL_HEADER_MSG, UNKNOWN_ACCESS_TYPE_MSG, UNKNOWN_DTD_MSG, UNKNOWN_ELEMENT_MSG, USE_ATTR, USE_ATTR_ID, USE_WITH_KIDS_MSG, useIsCurrent, VALUE_ATTR, VERSION_ATTR, versionString, worldURL, X3D_TAG, x3dNamespaceId, XML_ENCODING
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
endElement
(String namespace, String name, String qName) End the element processing.void
Report the start of DTD declarations, if any.void
startElement
(String namespace, String localName, String qName, Attributes attribs) Start the processing of a new element with the given collection of attribute information.Methods inherited from class org.web3d.x3d.jaxp.X3DSAVAdapter
characters, comment, endCDATA, endDocument, endDTD, endEntity, endPrefixMapping, endScript, getContentHandler, getProtoHandler, getRouteHandler, getScriptHandler, ignorableWhitespace, loadContainerProperties, processFieldAccess, processingInstruction, setContentHandler, setDocumentLocator, setErrorReporter, setLoadState, setProtoHandler, setRouteHandler, setScriptHandler, skippedEntity, startCDATA, startDocument, startEntity, startPrefixMapping, startScript
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.xml.sax.ContentHandler
characters, declaration, endDocument, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping
Methods inherited from interface org.xml.sax.ext.LexicalHandler
comment, endCDATA, endDTD, endEntity, startCDATA, startEntity
-
Field Details
-
elementLCMap
-
-
Constructor Details
-
X3DSAVAdapterTolerant
public X3DSAVAdapterTolerant()Construct a default instance of this class.
-
-
Method Details
-
startDTD
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 interfaceLexicalHandler
- Overrides:
startDTD
in classX3DSAVAdapter
- Parameters:
name
- The DTD name stringpublicId
- The Public ID used for the contentsystemId
- The system ID used for the content- Throws:
SAXException
-
startElement
public void startElement(String namespace, String localName, String qName, Attributes attribs) throws SAXException Start the processing of a new element with the given collection of attribute information.- Specified by:
startElement
in interfaceContentHandler
- Overrides:
startElement
in classX3DSAVAdapter
- Parameters:
namespace
- The namespace for the element. Null if not usedlocalName
- The local name of the element to createqName
- The qualified name of the element including prefixattribs
- The collection of attributes to use- Throws:
SAXException
- The element can't be found in the underlying factory
-
endElement
End the element processing.- Specified by:
endElement
in interfaceContentHandler
- Overrides:
endElement
in classX3DSAVAdapter
- Parameters:
namespace
- The namespace for the element. Null if not usedname
- The local name of the element to createqName
- The qualified name of the element including prefix- Throws:
SAXException
- Not thrown in this implementation
-