Package xj3d.filter
Class MinimizeProfileFilter
java.lang.Object
xj3d.filter.AbstractFilter
xj3d.filter.TwoPassFilter
xj3d.filter.MinimizeProfileFilter
- All Implemented Interfaces:
BinaryContentHandler
,ContentHandler
,ProtoHandler
,RouteHandler
,ScriptHandler
,StringContentHandler
Minimize a files profile and component declaration to the minimal
declaration. Prefer a profile decl to a long component decl.
- Version:
- $Revision: 1.6 $
- 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
componentDecl
(String componentInfo) A component declaration has been found in the code.void
profileDecl
(String profileName) A profile declaration has been found in the code.void
Declaration of the start of the document.void
Notification that the start of the first pass is beginning.void
Notification of the start of a node.void
Notification that the second of the first pass is beginning.Methods inherited from class xj3d.filter.AbstractFilter
endDocument, 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, protoFieldDecl, protoIsDecl, routeDecl, scriptFieldDecl, setArguments, setContentHandler, setDocumentLocator, setErrorReporter, setParsingType, setProtoHandler, setRouteHandler, setScriptHandler, startExternProtoDecl, startField, startProtoBody, startProtoDecl, startScriptDecl, useDecl
-
Constructor Details
-
MinimizeProfileFilter
public MinimizeProfileFilter()A node to component mapper
-
-
Method Details
-
startFirstPass
public void startFirstPass()Notification that the start of the first pass is beginning.- Specified by:
startFirstPass
in classTwoPassFilter
-
startSecondPass
public void startSecondPass()Notification that the second of the first pass is beginning.- Specified by:
startSecondPass
in classTwoPassFilter
-
startDocument
public void startDocument(String uri, String url, String encoding, String type, String version, String comment) throws SAVException, VRMLException Declaration of the start of the document. The parameters are all of the values that are declared on the header line of the file after the#
start. The type string contains the representation of the first few characters of the file after the #. This allows us to work out if it is VRML97 or the later X3D spec.Version numbers change from VRML97 to X3D and aren't logical. In the first, it is
#VRML V2.0
and the second is#X3D V1.0
even though this second header represents a later spec.- Specified by:
startDocument
in interfaceContentHandler
- Overrides:
startDocument
in classAbstractFilter
- Parameters:
uri
- The URI of the file.url
- The base URL of the file for resolving relative URIs contained in the fileencoding
- The encoding of this document - utf8 or binarytype
- The bytes of the first part of the file headerversion
- The full VRML version string of this documentcomment
- Any trailing text on this line. If there is none, this is null.- 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.
-
profileDecl
A profile declaration has been found in the code. IAW the X3D specification, this method will only ever be called once in the lifetime of the parser for this document. The name is the name of the profile for the document to use.- Specified by:
profileDecl
in interfaceContentHandler
- Overrides:
profileDecl
in classAbstractFilter
- Parameters:
profileName
- The name of the profile 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.
-
componentDecl
A component declaration has been found in the code. There may be zero or more component declarations in the file, appearing just after the profile declaration. The textual information after the COMPONENT keyword is left unparsed and presented through this call. It is up to the user application to parse the component information.- Specified by:
componentDecl
in interfaceContentHandler
- Overrides:
componentDecl
in classAbstractFilter
- Parameters:
componentInfo
- The name of the component 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.
-
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.
-