Class BaseRetainedExporter
- All Implemented Interfaces:
BinaryContentHandler
,ContentHandler
,ProtoHandler
,RouteHandler
,ScriptHandler
,StringContentHandler
- Direct Known Subclasses:
X3DClassicRetainedExporter
,X3DRetainedSAXExporter
- Version:
- $Revision: 1.33 $
- Author:
- Alan Hudson
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected SceneBuilder
The NR scene builder to create the scene graphprotected List
<ComponentInfo> Additional components to add, list of ComponentInfoprotected static final String
Name of the property file holding the default container fieldsprotected Properties
Property for container fieldsprotected boolean
Should VRML97 optional nodes like HAnim and GeoVRML be convertedprotected org.ietf.uri.ResourceConnection
The current resource connection if being usedThe current DEF map, node to DEF nameprotected Map
<Integer, List<ProtoFieldInfo>> The current IS mapprotected PrototypeDecl
The current proto definitionprotected VRMLNodeType
The current default valued nodeA cache of nodes with default valuesprotected String
The current encodingMapping of EXTERNPROTO to url[]protected VRMLFieldReader
An X3DField reader for converting field types.Fields to remap their types.protected boolean
Where there Geospatial nodes foundGeospatial nodesprotected boolean
Where there HAnim nodes foundHAnim nodesprotected Map
<Map<Integer, List<ProtoFieldInfo>>, Map.Entry<Integer, List<ProtoFieldInfo>>[]> A cache of IS map preprocessed versionsprotected VRMLNodeFactory
The NR node factory to get default values fromProtos/Extern Proto definitions to remove if convertOldContent is trueprotected OutputStream
The stream to write results toprotected PrintWriter
The printerprotected boolean
Are we processing a documentprotected String
The profileprotected CRProtoCreator
The creator used to instantiate protosprotected VRMLScene
The top sceneprotected Pattern[]
Upgrade patterns for scriptsprotected String[]
The replacement valuesprotected int
The number of significant digits when printing floats, -1 not to changeprotected long
Start time used for optimizationprotected boolean
Should we strip whitespaceprotected boolean
Are we upgrading from VRML to X3DFields inherited from class org.web3d.vrml.export.Exporter
errorReporter, lastErrorCode, majorVersion, minorVersion
-
Constructor Summary
ConstructorsConstructorDescriptionBaseRetainedExporter
(int major, int minor, org.j3d.util.ErrorReporter reporter, int sigDigits) Create a new exporter for the given spec version -
Method Summary
Modifier and TypeMethodDescriptionvoid
componentDecl
(String componentName) A component declaration has been found in the code.protected void
convertFieldData
(int newType, VRMLFieldData data, VRMLFieldDeclaration decl) Convert a field data from one type to another.void
Declaration of the end of the document.void
Notification of the end of an EXTERNPROTO declaration.void
endField()
Notification of the end of a field declaration.void
endNode()
Notification of the end of a node declaration.void
Notification of the end of an ordinary proto body.void
Notification of the end of an ordinary proto declaration statement.void
Notification of the end of a script declaration.void
exportDecl
(String defName, String exported) An EXPORT declaration has been found in the document.void
externProtoURI
(String[] values) Notification of the URI list for an EXTERNPROTO.void
fieldValue
(boolean value) Set the value of the field at the given index as an boolean.void
fieldValue
(boolean[] value, int len) Set the value of the field at the given index as an array of boolean.void
fieldValue
(double value) Set the value of the field at the given index as an double.void
fieldValue
(double[] value, int len) Set the value of the field at the given index as an array of doubles.void
fieldValue
(float value) Set the value of the field at the given index as a float.void
fieldValue
(float[] value, int len) Set the value of the field at the given index as an array of floats.void
fieldValue
(int value) Set the value of the field at the given index as an integer.void
fieldValue
(int[] value, int len) Set the value of the field at the given index as an array of integers.void
fieldValue
(long value) Set the value of the field at the given index as an long.void
fieldValue
(long[] value, int len) Set the value of the field at the given index as an array of longs.void
fieldValue
(String value) The value of a normal field.void
fieldValue
(String[] values) The value of an MFField where the underlying parser knows about how the values are broken up.void
fieldValue
(String[] value, int len) Set the value of the field at the given index as an array of strings.protected String
findIS
(VRMLNodeType node, int idx, Map<Integer, List<ProtoFieldInfo>> isMap) Find the IS relationship for a node.protected String
getPublicId
(int major, int minor) Get the publicId for this spec versionprotected String
getSystemId
(int major, int minor) Get the https publicId for this spec versionvoid
importDecl
(String inline, String exported, String imported) An IMPORT declaration has been found in the document.protected void
loadContainerProperties
(int majorVersion, int minorVersion) Load the properties files for the given spec version.void
A META declaration has been found in the code.protected abstract void
printComponents
(ComponentInfo[] comps) Print the component declprotected void
printDefMap
(Map<VRMLNode, String> defMap) Utility to print DEF mapping for debugging purposes.protected abstract void
Print identifying information about this exporterprotected abstract void
printExports
(Map<String, String> exports) Print Exports.protected abstract void
printHeader
(int major, int minor) Print the header.protected abstract void
printImports
(Map<String, VRMLNode> imports) Print Imports.protected void
printIS
(Map<Integer, List<ProtoFieldInfo>> isMap) Utility to print IS mapping for debugging purposes.protected abstract void
printMetaData
(Map<String, String> meta) Print the MetaData.protected abstract void
printProfile
(String profile) Print the profile decl.protected abstract void
printPrototypeDecl
(PrototypeDecl proto) Print a proto declaration.protected abstract void
printROUTE
(ROUTE route, Map<VRMLNode, String> defMap) Print a ROUTE statement.void
profileDecl
(String profileName) A profile declaration has been found in the code.void
protoFieldDecl
(int access, String type, String name, Object value) Notification of a proto's field declaration.void
protoIsDecl
(String fieldName) Notification of a field value uses an IS statement.protected void
Reverse a maps key/value mapping.void
Notification of a ROUTE declaration in the file.void
scriptFieldDecl
(int access, String type, String name, Object value) Notification of a script's field declaration.void
setConvertOldContent
(boolean convert) Should old optional content like HAnim and GeoVRML be converted to native nodes.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
startExternProtoDecl
(String name) Notification of the start of an EXTERNPROTO declaration of the given name.void
startField
(String name) Notification of a field declaration.void
Notification of the start of a node.void
Notification of the start of an ordinary proto body.void
startProtoDecl
(String name) Notification of the start of an ordinary (inline) proto declaration.void
Notification of the start of a script declaration.void
The field value is a USE for the given node name.Methods inherited from class org.web3d.vrml.export.Exporter
getLastErrorCode
-
Field Details
-
CONTAINER_PROPS_FILE
Name of the property file holding the default container fields- See Also:
-
oStream
The stream to write results to -
builder
The NR scene builder to create the scene graph -
nodeFactory
The NR node factory to get default values from -
defaultNodes
-
defaultNode
The current default valued node -
upgrading
protected boolean upgradingAre we upgrading from VRML to X3D -
currentDefMap
-
currentIsMap
The current IS map -
currentPrototypeDecl
The current proto definition -
protoCreator
The creator used to instantiate protos -
scene
The top scene -
profile
The profile -
componentList
Additional components to add, list of ComponentInfo -
p
The printer -
epToUrl
-
scriptPatterns
Upgrade patterns for scripts -
scriptReplacements
The replacement values -
convertOldContent
protected boolean convertOldContentShould VRML97 optional nodes like HAnim and GeoVRML be converted -
oldProtos
-
fieldRemap
-
hanimFound
protected boolean hanimFoundWhere there HAnim nodes found -
hanimNodes
-
geospatialFound
protected boolean geospatialFoundWhere there Geospatial nodes found -
geospatialNodes
-
isCache
A cache of IS map preprocessed versions -
containerFields
Property for container fields -
encodingTo
The current encoding -
stripWhitespace
protected boolean stripWhitespaceShould we strip whitespace -
processingDocument
protected boolean processingDocumentAre we processing a document -
fieldReader
An X3DField reader for converting field types. -
currentConnection
protected org.ietf.uri.ResourceConnection currentConnectionThe current resource connection if being used -
startTime
protected long startTimeStart time used for optimization -
sigDigits
protected int sigDigitsThe number of significant digits when printing floats, -1 not to change
-
-
Constructor Details
-
BaseRetainedExporter
public BaseRetainedExporter(int major, int minor, org.j3d.util.ErrorReporter reporter, int sigDigits) Create a new exporter for the given spec version- Parameters:
major
- The major version number of this sceneminor
- The minor version number of this scenereporter
- The error reporter to usesigDigits
- The number of significant digits for floats, -1 for unchanged
-
-
Method Details
-
setConvertOldContent
public void setConvertOldContent(boolean convert) Should old optional content like HAnim and GeoVRML be converted to native nodes.- Parameters:
convert
- true to convert the protos
-
printHeader
protected abstract void printHeader(int major, int minor) Print the header.- Parameters:
major
- The major versionminor
- The minor version
-
printExporterInfo
protected abstract void printExporterInfo()Print identifying information about this exporter -
printProfile
Print the profile decl.- Parameters:
profile
- The profile
-
printComponents
Print the component decl- Parameters:
comps
- The component list
-
printMetaData
-
printPrototypeDecl
Print a proto declaration.- Parameters:
proto
- The decl to print
-
printROUTE
-
printExports
-
printImports
-
endDocument
Description copied from interface:ContentHandler
Declaration of the end of the document. There will be no further parsing and hence events after this.- Specified by:
endDocument
in interfaceContentHandler
- 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.
-
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.- Specified by:
setDocumentLocator
in interfaceContentHandler
- Parameters:
loc
- The locator instance to use
-
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
- 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 VRML version 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 documentVRMLException
- The content provided is invalid for this part of the document or can't be parsed
-
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
- 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
- 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.- Specified by:
metaDecl
in interfaceContentHandler
- 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
public void importDecl(String inline, String exported, String imported) throws SAVException, VRMLException 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.- Specified by:
importDecl
in interfaceContentHandler
- 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.- Specified by:
exportDecl
in interfaceContentHandler
- 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.
-
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
- 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.- Specified by:
endNode
in interfaceContentHandler
- 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.- Specified by:
startField
in interfaceContentHandler
- 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.
-
fieldValue
The value of a normal field. This is a string that represents the entire value of the field. MFStrings will have to be parsed. This is a terminating call for startField as well. The next call will either be anotherstartField()
orendNode()
.If this field is an SFNode with a USE declaration you will have the
useDecl(String)
method called rather than this method. If the SFNode is empty the value returned here will be "NULL".There are times where we have an MFField that is declared in the file to be empty. To signify this case, this method will be called with a parameter value of null. A lot of the time this is because we can't really determine if the incoming node is an MFNode or not.
- Specified by:
fieldValue
in interfaceBinaryContentHandler
- Specified by:
fieldValue
in interfaceStringContentHandler
- Parameters:
value
- The value of this field- 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.
-
fieldValue
The value of an MFField where the underlying parser knows about how the values are broken up. The parser is not required to support this callback, but implementors of this interface should understand it. The most likely time we will have this method called is for MFString or URL lists. If called, it is guaranteed to split the strings along the SF node type boundaries.- Specified by:
fieldValue
in interfaceStringContentHandler
- Parameters:
values
- The list of string representing the values- 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.
-
fieldValue
Set the value of the field at the given index as an integer. This would be used to set SFInt32 field types.- Specified by:
fieldValue
in interfaceBinaryContentHandler
- Parameters:
value
- The new value to use for the 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.
-
fieldValue
Set the value of the field at the given index as an array of integers. This would be used to set MFInt32 field types.- Specified by:
fieldValue
in interfaceBinaryContentHandler
- Parameters:
value
- The new value to use for the nodelen
- The number of valid entries in the value array- 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.
-
fieldValue
Set the value of the field at the given index as an boolean. This would be used to set SFBool field types.- Specified by:
fieldValue
in interfaceBinaryContentHandler
- Parameters:
value
- The new value to use for the 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.
-
fieldValue
Set the value of the field at the given index as an array of boolean. This would be used to set MFBool field types.- Specified by:
fieldValue
in interfaceBinaryContentHandler
- Parameters:
value
- The new value to use for the nodelen
- The number of valid entries in the value array- 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.
-
fieldValue
Set the value of the field at the given index as a float. This would be used to set SFFloat field types.- Specified by:
fieldValue
in interfaceBinaryContentHandler
- Parameters:
value
- The new value to use for the 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.
-
fieldValue
Set the value of the field at the given index as an array of floats. This would be used to set MFFloat, SFVec2f, SFVec3f and SFRotation field types.- Specified by:
fieldValue
in interfaceBinaryContentHandler
- Parameters:
value
- The new value to use for the nodelen
- The number of valid entries in the value array- 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.
-
fieldValue
Set the value of the field at the given index as an long. This would be used to set SFTime field types.- Specified by:
fieldValue
in interfaceBinaryContentHandler
- Parameters:
value
- The new value to use for the 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.
-
fieldValue
Set the value of the field at the given index as an array of longs. This would be used to set MFTime field types.- Specified by:
fieldValue
in interfaceBinaryContentHandler
- Parameters:
value
- The new value to use for the nodelen
- The number of valid entries in the value array- 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.
-
fieldValue
Set the value of the field at the given index as an double. This would be used to set SFDouble field types.- Specified by:
fieldValue
in interfaceBinaryContentHandler
- Parameters:
value
- The new value to use for the 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.
-
fieldValue
Set the value of the field at the given index as an array of doubles. This would be used to set MFDouble, SFVec2d and SFVec3d field types.- Specified by:
fieldValue
in interfaceBinaryContentHandler
- Parameters:
value
- The new value to use for the nodelen
- The number of valid entries in the value array- 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.
-
fieldValue
Set the value of the field at the given index as an array of strings. This would be used to set MFString field types.- Specified by:
fieldValue
in interfaceBinaryContentHandler
- Parameters:
value
- The new value to use for the nodelen
- The number of valid entries in the value array- 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
- 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 an MFNode declaration. All other fields are terminated by eitheruseDecl(String)
orfieldValue(String)
. 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.- Specified by:
endField
in interfaceContentHandler
- 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
- 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
-
startScriptDecl
Notification of the start of a script declaration. All calls between now and the correspondingendScriptDecl()
call belong to this script node. This method will be called after the ContentHandlerstartNode()
method call. All DEF information is contained in that method call and this just signifies the start of script processing so that we know to treat the field parsing callbacks a little differently.- Specified by:
startScriptDecl
in interfaceScriptHandler
- 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.
-
endScriptDecl
Notification of the end of a script declaration. This is guaranteed to be called before the ContentHandlerendNode()
callback.- Specified by:
endScriptDecl
in interfaceScriptHandler
- 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.
-
scriptFieldDecl
public void scriptFieldDecl(int access, String type, String name, Object value) throws SAVException, VRMLException Notification of a script's field declaration. This is used for all fields excepturl
,mustEvaluate
anddirectOutput
fields. These fields use the normal field callbacks ofContentHandler
.If the current parsing is in a proto and the field "value" is defined with an IS statement then the value returned here is null. There will be a subsequent call to the ProtoHandlers
protoIsDecl()
method with the name of the field included.- Specified by:
scriptFieldDecl
in interfaceScriptHandler
- Parameters:
access
- The access type (eg exposedField, field etc)type
- The field type (eg SFInt32, MFVec3d etc)name
- The name of the fieldvalue
- The default value of the field as either String or String[]. Null if not allowed.- 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.
-
startProtoDecl
Notification of the start of an ordinary (inline) proto declaration. The proto has the given node name.- Specified by:
startProtoDecl
in interfaceProtoHandler
- Parameters:
name
- The name of the proto- 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.
-
endProtoDecl
Notification of the end of an ordinary proto declaration statement. This is called just after the closing bracket of the declaration and before the opening of the body statement. If the next thing called is not astartProtoBody()
Then that method should toss an exception.- Specified by:
endProtoDecl
in interfaceProtoHandler
- 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.
-
protoFieldDecl
public void protoFieldDecl(int access, String type, String name, Object value) throws SAVException, VRMLException Notification of a proto's field declaration. This is used for both external and ordinary protos. Externprotos don't allow the declaration of a value for the field. In this case, the parameter value will be null.- Specified by:
protoFieldDecl
in interfaceProtoHandler
- Parameters:
access
- The access type (eg exposedField, field etc)type
- The field type (eg SFInt32, MFVec3d etc)name
- The name of the fieldvalue
- The default value of the field as either String or String[]. Null if not allowed.- 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.
-
protoIsDecl
Notification of a field value uses an IS statement.- Specified by:
protoIsDecl
in interfaceProtoHandler
- Parameters:
fieldName
- The name of the field that is being IS'd- 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.
-
startProtoBody
Notification of the start of an ordinary proto body. All nodes contained between here and the correspondingendProtoBody()
statement form the body and not the normal scene graph information.- Specified by:
startProtoBody
in interfaceProtoHandler
- 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.
-
endProtoBody
Notification of the end of an ordinary proto body. Parsing now returns to ordinary node declarations.- Specified by:
endProtoBody
in interfaceProtoHandler
- 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.
-
startExternProtoDecl
Notification of the start of an EXTERNPROTO declaration of the given name. Between here and the matchingendExternProtoDecl()
call you should only receiveprotoFieldDecl(int, java.lang.String, java.lang.String, java.lang.Object)
calls.- Specified by:
startExternProtoDecl
in interfaceProtoHandler
- Parameters:
name
- The node name of the extern proto- 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.
-
endExternProtoDecl
Notification of the end of an EXTERNPROTO declaration. This is called just after the closing bracket of the declaration and before the opening of the body statement. If the next thing called is not aexternProtoURI(java.lang.String[])
Then that method should toss an exception.- Specified by:
endExternProtoDecl
in interfaceProtoHandler
- 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.
-
externProtoURI
Notification of the URI list for an EXTERNPROTO. This is a complete list as an array of URI strings. The calling application is required to interpret the incoming string. Even if the externproto has no URIs registered, this method shall be called. If there are none available, this will be called with a zero length list of values.- Specified by:
externProtoURI
in interfaceProtoHandler
- Parameters:
values
- A list of strings representing all of the URI values- 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.
-
findIS
Find the IS relationship for a node.- Parameters:
node
- The current nodeidx
- The current fieldisMap
- The current IS map- Returns:
- the IS relationship for a node
-
printIS
Utility to print IS mapping for debugging purposes.- Parameters:
isMap
- The map to print
-
printDefMap
-
getPublicId
Get the publicId for this spec version- Parameters:
major
- The major versionminor
- The minor version- Returns:
- The spec'd public id
-
getSystemId
Get the https publicId for this spec version- Parameters:
major
- The major versionminor
- The minor version- Returns:
- The spec'd public id
-
reverseMap
-
loadContainerProperties
protected void loadContainerProperties(int majorVersion, int minorVersion) Load the properties files for the given spec version.- Parameters:
majorVersion
- The spec major versionminorVersion
- The spec minor version
-
convertFieldData
Convert a field data from one type to another.- Parameters:
newType
- The new typedata
- The data to convert in placedecl
- The field decl
-