Package xj3d.filter.filters
Class RemoveUnusedDEFFilter
java.lang.Object
xj3d.filter.AbstractFilter
xj3d.filter.BaseFilter
xj3d.filter.node.CommonEncodedBaseFilter
xj3d.filter.filters.RemoveUnusedDEFFilter
- All Implemented Interfaces:
BinaryContentHandler
,ContentHandler
,ProtoHandler
,RouteHandler
,ScriptHandler
,StringContentHandler
Remove any DEF names not used in this file.
- Version:
- $Revision: 1.18 $
- Author:
- Alan Hudson
-
Field Summary
Fields inherited from class xj3d.filter.node.CommonEncodedBaseFilter
encMap, encodeNodes, encodeRoutes, encStack, factory, scene
Fields inherited from class xj3d.filter.BaseFilter
insideInvalidField, sceneMarker, suppressCalls
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
setArguments
(String[] args) Set the argument parameters to control the filter operation.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.node.CommonEncodedBaseFilter
encode, endExternProtoDecl, endField, endNode, endProtoBody, endProtoDecl, endScriptDecl, externProtoURI, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, fieldValue, protoFieldDecl, protoIsDecl, scriptFieldDecl, setDebug, startDocument, startExternProtoDecl, startProtoBody, startProtoDecl, startScriptDecl
Methods inherited from class xj3d.filter.BaseFilter
componentDecl, exportDecl, getContentHandler, getErrorReporter, getLastErrorCode, getProtoHandler, getRouteHandler, getScriptHandler, importDecl, metaDecl, profileDecl, setContentHandler, setDocumentLocator, setErrorReporter, setProtoHandler, setRouteHandler, setScriptHandler, startField, suppressCalls
Methods inherited from class xj3d.filter.AbstractFilter
setParsingType
-
Constructor Details
-
RemoveUnusedDEFFilter
public RemoveUnusedDEFFilter()Create an 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 classCommonEncodedBaseFilter
- Throws:
SAVException
- This call is taken at the wrong time in the structure of the documentVRMLException
- The content provided is invalid for this part of the document or can't be parsed
-
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 classCommonEncodedBaseFilter
- 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 documentVRMLException
- The content provided is invalid for this part of the document or can't be parsed
-
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 classCommonEncodedBaseFilter
- 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 documentVRMLException
- The content provided is invalid for this part of the document or can't be parsed
-
routeDecl
public void routeDecl(String srcNodeName, String srcFieldName, String destNodeName, String destFieldName) 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 classCommonEncodedBaseFilter
- Parameters:
srcNodeName
- The name of the DEF of the source nodesrcFieldName
- The name of the field to route values fromdestNodeName
- The name of the DEF of the destination nodedestFieldName
- The name of the field to route values to- Throws:
SAVException
- This call is taken at the wrong time in the structure of the documentVRMLException
- The content provided is invalid for this part of the document or can't be parsed
-
setArguments
Set the argument parameters to control the filter operation.- Overrides:
setArguments
in classBaseFilter
- Parameters:
args
- The array of argument parameters.
-