Package xj3d.filter
Class ShortenDEFFilter
java.lang.Object
xj3d.filter.AbstractFilter
xj3d.filter.ShortenDEFFilter
- All Implemented Interfaces:
BinaryContentHandler
,ContentHandler
,ProtoHandler
,RouteHandler
,ScriptHandler
,StringContentHandler
Shorten's DEF names. Assigns a small name to each one.
- Version:
- $Revision: 1.7 $
- Author:
- Alan Hudson
-
Field Summary
Fields inherited from class xj3d.filter.AbstractFilter
contentHandler, documentLocator, errorHandler, fieldHandler, fieldReader, fieldStack, lastErrorCode, majorVersion, minorVersion, nodeStack, parsingType, protoHandler, routeHandler, scriptHandler
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Declaration of the end of the document.void
Notification of a ROUTE declaration in the file.void
Notification of the start of a node.void
The field value is a USE for the given node name.Methods inherited from class xj3d.filter.AbstractFilter
componentDecl, endExternProtoDecl, endField, endNode, endProtoBody, endProtoDecl, endScriptDecl, exportDecl, externProtoURI, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, getContentHandler, getErrorReporter, getLastErrorCode, getProtoHandler, getRouteHandler, getScriptHandler, importDecl, metaDecl, profileDecl, protoFieldDecl, protoIsDecl, scriptFieldDecl, setArguments, setContentHandler, setDocumentLocator, setErrorReporter, setParsingType, setProtoHandler, setRouteHandler, setScriptHandler, startDocument, startExternProtoDecl, startField, startProtoBody, startProtoDecl, startScriptDecl
-
Constructor Details
-
ShortenDEFFilter
public ShortenDEFFilter()Create a new default instance of the filter.
-
-
Method Details
-
endDocument
Declaration of the end of the document. There will be no further parsing and hence events after this.- Specified by:
endDocument
in interfaceContentHandler
- Overrides:
endDocument
in classAbstractFilter
- Throws:
SAVException
- This call is taken at the wrong time in the structure of the document.VRMLException
- This call is taken at the wrong time in the structure of the document.
-
startNode
Notification of the start of a node. This is the opening statement of a node and it's DEF name. USE declarations are handled in a separate method.- Specified by:
startNode
in interfaceContentHandler
- Overrides:
startNode
in classAbstractFilter
- Parameters:
name
- The name of the node that we are about to parsedefName
- The string associated with the DEF name. Null if not given for this node.- Throws:
SAVException
- This call is taken at the wrong time in the structure of the document.VRMLException
- This call is taken at the wrong time in the structure of the document.
-
useDecl
The field value is a USE for the given node name. This is a terminating call for startField as well. The next call will either be anotherstartField()
orendNode()
.- Specified by:
useDecl
in interfaceContentHandler
- Overrides:
useDecl
in classAbstractFilter
- Parameters:
defName
- The name of the DEF string to use- Throws:
SAVException
- This call is taken at the wrong time in the structure of the document.VRMLException
- This call is taken at the wrong time in the structure of the document.
-
routeDecl
public void routeDecl(String srcNode, String srcField, String destNode, String destField) throws SAVException, VRMLException Notification of a ROUTE declaration in the file. The context of this route should be assumed from the surrounding calls to start and end of proto and node bodies.- Specified by:
routeDecl
in interfaceRouteHandler
- Overrides:
routeDecl
in classAbstractFilter
- Parameters:
srcNode
- The name of the DEF of the source nodesrcField
- The name of the field to route values fromdestNode
- The name of the DEF of the destination nodedestField
- The name of the field to route values to- Throws:
SAVException
- This call is taken at the wrong time in the structure of the document.VRMLException
- The content provided is invalid for this part of the document or can't be parsed
-