Package org.web3d.vrml.sav
Interface ContentHandler
- All Known Subinterfaces:
BinaryContentHandler
,SceneBuilder
,StringContentHandler
- All Known Implementing Classes:
AbsScaleFilter
,AbstractFilter
,AppearanceFilter
,AppearanceReplacerFilter
,BaseFilter
,BaseRetainedExporter
,BinaryExporter
,CenterFilter
,ColorRGBAtoRGBFilter
,CombineAppearanceFilter
,CombinerFilter
,CombineShapeFilter
,CombineTransformFilter
,CommonEncodedBaseFilter
,CRExternProtoBuilder
,CRMainSceneBuilder
,DebugFilter
,DEFChooserFilter
,DEFReplacerFilter
,DEFUSEImageTextureFilter
,EncodedBaseFilter
,EncodedFilter
,ExceptionGenerator
,ExplodeShapesFilter
,Exporter
,ExportPixelTextureFilter
,FlattenSelectableFilter
,FlattenTextureTransformFilter
,FlattenTransformFilter
,GenNormalsFilter
,GlobalBoundsFilter
,IdentityFilter
,IFSFilter
,IFSToITSFilter
,IFSToTSFilter
,IndexFilter
,ITSCreaseAnglerFilter
,LocalURLFilter
,ManifoldInfoFilter
,MaterialFilter
,MinimizeProfileFilter
,ModifyViewpointFilter
,NewAbstractFilter
,NodeChooserFilter
,NodeCountInfoFilter
,NRExternProtoBuilder
,NRVRMLSceneBuilder
,NullExporter
,OBJFileExporter
,OGLExternProtoBuilder
,OGLVRMLSceneBuilder
,ProtoBuilder
,ReindexFilter
,RemoveNodeFilter
,RemoveNormalsFilter
,RemoveUnusedDEFFilter
,ShortenDEFFilter
,StackTracerFilter
,StatisticsCollector
,STLBinaryFileExporter
,STLFileExporter
,TextureTransformFilter
,ThreeMFFileExporter
,TransformFilter
,TriangleCountInfoFilter
,TriangulationFilter
,TwoPassFilter
,URLCaseCorrectorFilter
,URLFullyQualifyFilter
,USERedundantNodeFilter
,ValidateIndexFilter
,VrmlExporter
,WorldOffsetFilter
,X3DBinaryRetainedDirectExporter
,X3DClassicExporter
,X3DClassicRetainedExporter
,X3DMemoryExporter
,X3DRetainedSAXExporter
,X3DXMLExporter
,X3DXMLRetainedExporter
public interface ContentHandler
Receiver of notifications from the VRML document about node declaration
information.
- Version:
- $Revision: 1.14 $
- Author:
- Justin Couch
-
Method Summary
Modifier and TypeMethodDescriptionvoid
componentDecl
(String componentName) A component declaration has been found in the code.void
Declaration of the end of the document.void
endField()
Notification of the end of a field declaration.void
endNode()
Notification of the end of a node declaration.void
exportDecl
(String defName, String exported) An EXPORT declaration has been found in the document.void
importDecl
(String inline, String exported, String imported) An IMPORT declaration has been found in the document.void
A META declaration has been found in the code.void
profileDecl
(String profileName) A profile declaration has been found in the code.void
Set the document locator that can be used by the implementing code to find out information about the current line information.void
Declaration of the start of the document.void
startField
(String name) Notification of a field declaration.void
Notification of the start of a node.void
The field value is a USE for the given node name.
-
Method Details
-
setDocumentLocator
Set the document locator that can be used by the implementing code to find out information about the current line information. This method is called by the parser to your code to give you a locator to work with. If this has not been set by the timestartDocument()
has been called, you can assume that you will not have one available.- Parameters:
loc
- The locator instance to use
-
startDocument
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.- 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.- 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.- Parameters:
componentName
- 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.
-
metaDecl
A META declaration has been found in the code. There may be zero or more meta declarations in the file, appearing just after the component declaration. Each meta declaration has a key and value strings. No information is to be implied from this. It is for extra data only.- Parameters:
key
- The value of the key stringvalue
- The value of the value string- 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.
-
importDecl
An IMPORT declaration has been found in the document. All three parameters will always be provided, regardless of whether the AS keyword has been used or not. The parser implementation will automatically set the local import name as needed.- Parameters:
inline
- The name of the inline DEF nodesexported
- The exported name from the inlined fileimported
- The local name to use for the exported name- 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.
-
exportDecl
An EXPORT declaration has been found in the document. Both parameters will always be provided regardless of whether the AS keyword has been used. The parser implementation will automatically set the exported name as needed.- Parameters:
defName
- The DEF name of the nodes to be exportedexported
- The name to be exported as- 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.
-
endDocument
Declaration of the end of the document. There will be no further parsing and hence events after this.- 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.- 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.
-
endNode
Notification of the end of a node declaration.- 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.
-
startField
Notification of a field declaration. This notification is only called if it is a standard node. If the node is a script or PROTO declaration then theScriptHandler
orProtoHandler
methods are used.- Parameters:
name
- The name of the field declared- 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()
.- 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.
-
endField
Notification of the end of a field declaration. This is called only at the end of a MFNode declaration or a SFNode declaration without a USE. All other fields are terminated by eitheruseDecl(String)
,StringContentHandler.fieldValue(String)
. or any of the fieldValue methods inBinaryContentHandler
. This will only ever be called if there have been nodes declared. If no nodes have been declared (ie "[]") then you will get afieldValue()
. call with the parameter value of 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.
-