com.jme.scene.model.XMLparser.Converters
Class FormatConverter

java.lang.Object
  extended bycom.jme.scene.model.XMLparser.Converters.FormatConverter
Direct Known Subclasses:
AseToJme, MaxToJme, Md2ToJme, Md3ToJme, MilkToJme, ObjToJme

public abstract class FormatConverter
extends java.lang.Object

Started Date: Jul 1, 2004

This class is a base for all format converters and provides a generic framework to convert to jME format from any other format.

Author:
Jack Lindamood

Constructor Summary
FormatConverter()
           
 
Method Summary
 void attemptFileConvert(java.lang.String[] args)
          Given an array of string arguments representing two files, the first file will be read and the second file will be deleted (if existing), then created and written to.
 void clearProperty(java.lang.String key)
          Removes a property.
abstract  void convert(java.io.InputStream format, java.io.OutputStream jMEFormat)
          Reads a given format and writes it to jMEFormat in the jME binary format.
 void setProperty(java.lang.String key, java.lang.Object property)
          Adds a property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FormatConverter

public FormatConverter()
Method Detail

convert

public abstract void convert(java.io.InputStream format,
                             java.io.OutputStream jMEFormat)
                      throws java.io.IOException
Reads a given format and writes it to jMEFormat in the jME binary format.

Parameters:
format - InputStream representing the format to read
jMEFormat - OutputStream to write the jME binary equivalent too
Throws:
java.io.IOException - If anything goes wrong during the writting

attemptFileConvert

public void attemptFileConvert(java.lang.String[] args)
Given an array of string arguments representing two files, the first file will be read and the second file will be deleted (if existing), then created and written to. Sample Usage "FormatConverter runner.txt runner.jme"

Parameters:
args - The array representing the from file and to file

setProperty

public void setProperty(java.lang.String key,
                        java.lang.Object property)
Adds a property. Properties can tell this how to process this format and are used in a format specific way. Look at the doc for the format to find what keys are used.

Parameters:
key - Key to add (For example "texdir")
property - Property for that key to have (For example "c:\\blarg\\")

clearProperty

public void clearProperty(java.lang.String key)
Removes a property. Properties can tell this how to process this format and are used in a format specific way.

Parameters:
key - The property to remove