com.threerings.export
Class Exporter

java.lang.Object
  extended by com.threerings.export.Exporter
All Implemented Interfaces:
Closeable
Direct Known Subclasses:
BinaryExporter, XMLExporter

public abstract class Exporter
extends Object
implements Closeable

Used to write Exportable objects. Other common object types are supported as well: Boolean, Byte, Character, Short, Integer, Long, Float, Double, String, boolean[], byte[], char[], short[], int[], long[], float[], double[], Object[], Collection, Map, Enum, ByteBuffer, CharBuffer, DoubleBuffer, FloatBuffer, IntBuffer, LongBuffer, ShortBuffer, ....

See Also:
Exportable

Constructor Summary
Exporter()
           
 
Method Summary
abstract  void close()
          Writes out any remaining data and closes the underlying stream.
 void defaultWriteFields()
          Writes the default fields of the object.
abstract  void finish()
          Writes out any remaining data without closing the underlying stream.
abstract  void write(String name, boolean value)
          Associates a boolean value with the current object.
 void write(String name, boolean[] value)
          Associates a boolean array value with the current object.
 void write(String name, boolean[] value, boolean[] defvalue)
          Associates a boolean array value with the current object (if not equal to the default).
 void write(String name, boolean value, boolean defvalue)
          Associates a boolean value with the current object (if not equal to the default).
abstract  void write(String name, byte value)
          Associates a byte value with the current object.
 void write(String name, byte[] value)
          Associates a byte array value with the current object.
 void write(String name, byte[] value, byte[] defvalue)
          Associates a byte array value with the current object (if not equal to the default).
 void write(String name, ByteBuffer value)
          Associates a byte buffer value with the current object.
 void write(String name, ByteBuffer value, ByteBuffer defvalue)
          Associates a byte buffer value with the current object (if not equal to the default).
 void write(String name, byte value, byte defvalue)
          Associates a byte value with the current object (if not equal to the default).
abstract  void write(String name, char value)
          Associates a character value with the current object.
 void write(String name, char[] value)
          Associates a character array value with the current object.
 void write(String name, char[] value, char[] defvalue)
          Associates a character array value with the current object (if not equal to the default).
 void write(String name, CharBuffer value)
          Associates a character buffer value with the current object.
 void write(String name, CharBuffer value, CharBuffer defvalue)
          Associates a character buffer value with the current object (if not equal to the default).
 void write(String name, char value, char defvalue)
          Associates a character value with the current object (if not equal to the default).
 void write(String name, Color4f value)
          Associates a color value with the current object.
 void write(String name, Color4f value, Color4f defvalue)
          Associates a color value with the current object (if not equal to the default).
abstract  void write(String name, double value)
          Associates a double value with the current object.
 void write(String name, double[] value)
          Associates a double array value with the current object.
 void write(String name, double[] value, double[] defvalue)
          Associates a double array value with the current object (if not equal to the default).
 void write(String name, DoubleBuffer value)
          Associates a double buffer value with the current object.
 void write(String name, DoubleBuffer value, DoubleBuffer defvalue)
          Associates a double buffer value with the current object (if not equal to the default).
 void write(String name, double value, double defvalue)
          Associates a double value with the current object (if not equal to the default).
 void write(String name, Exportable value)
          Associates an exportable value with the current object.
 void write(String name, Exportable value, Exportable defvalue)
          Associates an exportable value with the current object (if not equal to the default).
abstract  void write(String name, float value)
          Associates a float value with the current object.
 void write(String name, float[] value)
          Associates a float array value with the current object.
 void write(String name, float[] value, float[] defvalue)
          Associates a float array value with the current object (if not equal to the default).
 void write(String name, FloatBuffer value)
          Associates a float buffer value with the current object.
 void write(String name, FloatBuffer value, FloatBuffer defvalue)
          Associates a float buffer value with the current object (if not equal to the default).
 void write(String name, float value, float defvalue)
          Associates a float value with the current object (if not equal to the default).
abstract  void write(String name, int value)
          Associates an integer value with the current object.
 void write(String name, int[] value)
          Associates an integer array value with the current object.
 void write(String name, int[] value, int[] defvalue)
          Associates an integer array value with the current object (if not equal to the default).
 void write(String name, IntBuffer value)
          Associates an integer buffer value with the current object.
 void write(String name, IntBuffer value, IntBuffer defvalue)
          Associates an integer buffer value with the current object (if not equal to the default).
 void write(String name, int value, int defvalue)
          Associates an integer value with the current object (if not equal to the default).
abstract  void write(String name, long value)
          Associates a long value with the current object.
 void write(String name, long[] value)
          Associates a long array value with the current object.
 void write(String name, long[] value, long[] defvalue)
          Associates a long array value with the current object (if not equal to the default).
 void write(String name, LongBuffer value)
          Associates a long buffer value with the current object.
 void write(String name, LongBuffer value, LongBuffer defvalue)
          Associates a long buffer value with the current object (if not equal to the default).
 void write(String name, long value, long defvalue)
          Associates a long value with the current object (if not equal to the default).
 void write(String name, Matrix3f value)
          Associates a matrix value with the current object.
 void write(String name, Matrix3f value, Matrix3f defvalue)
          Associates a matrix value with the current object (if not equal to the default).
 void write(String name, Matrix4f value)
          Associates a matrix value with the current object.
 void write(String name, Matrix4f value, Matrix4f defvalue)
          Associates a matrix value with the current object (if not equal to the default).
 void write(String name, Quaternion value)
          Associates a quaternion value with the current object.
 void write(String name, Quaternion value, Quaternion defvalue)
          Associates a quaternion value with the current object (if not equal to the default).
abstract  void write(String name, short value)
          Associates a short value with the current object.
 void write(String name, short[] value)
          Associates a short array value with the current object.
 void write(String name, short[] value, short[] defvalue)
          Associates a short array value with the current object (if not equal to the default).
 void write(String name, ShortBuffer value)
          Associates a short buffer value with the current object.
 void write(String name, ShortBuffer value, ShortBuffer defvalue)
          Associates a short buffer value with the current object (if not equal to the default).
 void write(String name, short value, short defvalue)
          Associates a short value with the current object (if not equal to the default).
 void write(String name, String value)
          Associates a string value with the current object.
 void write(String name, String value, String defvalue)
          Associates a string value with the current object (if not equal to the default).
abstract
<T> void
write(String name, T value, Class<T> clazz)
          Associates an object value with the current object.
<T> void
write(String name, T value, T defvalue, Class<T> clazz)
          Associates an object value with the current object (if not equal to the default).
 void write(String name, Vector2f value)
          Associates a vector value with the current object.
 void write(String name, Vector2f value, Vector2f defvalue)
          Associates a vector value with the current object (if not equal to the default).
 void write(String name, Vector3f value)
          Associates a vector value with the current object.
 void write(String name, Vector3f value, Vector3f defvalue)
          Associates a vector value with the current object (if not equal to the default).
abstract  void writeObject(Object oject)
          Writes the object to the underlying stream.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Exporter

public Exporter()
Method Detail

writeObject

public abstract void writeObject(Object oject)
                          throws IOException
Writes the object to the underlying stream.

Throws:
IOException

defaultWriteFields

public void defaultWriteFields()
                        throws IOException
Writes the default fields of the object.

Throws:
IOException

write

public void write(String name,
                  boolean value,
                  boolean defvalue)
           throws IOException
Associates a boolean value with the current object (if not equal to the default).

Throws:
IOException

write

public abstract void write(String name,
                           boolean value)
                    throws IOException
Associates a boolean value with the current object.

Throws:
IOException

write

public void write(String name,
                  byte value,
                  byte defvalue)
           throws IOException
Associates a byte value with the current object (if not equal to the default).

Throws:
IOException

write

public abstract void write(String name,
                           byte value)
                    throws IOException
Associates a byte value with the current object.

Throws:
IOException

write

public void write(String name,
                  char value,
                  char defvalue)
           throws IOException
Associates a character value with the current object (if not equal to the default).

Throws:
IOException

write

public abstract void write(String name,
                           char value)
                    throws IOException
Associates a character value with the current object.

Throws:
IOException

write

public void write(String name,
                  double value,
                  double defvalue)
           throws IOException
Associates a double value with the current object (if not equal to the default).

Throws:
IOException

write

public abstract void write(String name,
                           double value)
                    throws IOException
Associates a double value with the current object.

Throws:
IOException

write

public void write(String name,
                  float value,
                  float defvalue)
           throws IOException
Associates a float value with the current object (if not equal to the default).

Throws:
IOException

write

public abstract void write(String name,
                           float value)
                    throws IOException
Associates a float value with the current object.

Throws:
IOException

write

public void write(String name,
                  int value,
                  int defvalue)
           throws IOException
Associates an integer value with the current object (if not equal to the default).

Throws:
IOException

write

public abstract void write(String name,
                           int value)
                    throws IOException
Associates an integer value with the current object.

Throws:
IOException

write

public void write(String name,
                  long value,
                  long defvalue)
           throws IOException
Associates a long value with the current object (if not equal to the default).

Throws:
IOException

write

public abstract void write(String name,
                           long value)
                    throws IOException
Associates a long value with the current object.

Throws:
IOException

write

public void write(String name,
                  short value,
                  short defvalue)
           throws IOException
Associates a short value with the current object (if not equal to the default).

Throws:
IOException

write

public abstract void write(String name,
                           short value)
                    throws IOException
Associates a short value with the current object.

Throws:
IOException

write

public void write(String name,
                  boolean[] value,
                  boolean[] defvalue)
           throws IOException
Associates a boolean array value with the current object (if not equal to the default).

Throws:
IOException

write

public void write(String name,
                  boolean[] value)
           throws IOException
Associates a boolean array value with the current object.

Throws:
IOException

write

public void write(String name,
                  byte[] value,
                  byte[] defvalue)
           throws IOException
Associates a byte array value with the current object (if not equal to the default).

Throws:
IOException

write

public void write(String name,
                  byte[] value)
           throws IOException
Associates a byte array value with the current object.

Throws:
IOException

write

public void write(String name,
                  char[] value,
                  char[] defvalue)
           throws IOException
Associates a character array value with the current object (if not equal to the default).

Throws:
IOException

write

public void write(String name,
                  char[] value)
           throws IOException
Associates a character array value with the current object.

Throws:
IOException

write

public void write(String name,
                  double[] value,
                  double[] defvalue)
           throws IOException
Associates a double array value with the current object (if not equal to the default).

Throws:
IOException

write

public void write(String name,
                  double[] value)
           throws IOException
Associates a double array value with the current object.

Throws:
IOException

write

public void write(String name,
                  float[] value,
                  float[] defvalue)
           throws IOException
Associates a float array value with the current object (if not equal to the default).

Throws:
IOException

write

public void write(String name,
                  float[] value)
           throws IOException
Associates a float array value with the current object.

Throws:
IOException

write

public void write(String name,
                  int[] value,
                  int[] defvalue)
           throws IOException
Associates an integer array value with the current object (if not equal to the default).

Throws:
IOException

write

public void write(String name,
                  int[] value)
           throws IOException
Associates an integer array value with the current object.

Throws:
IOException

write

public void write(String name,
                  long[] value,
                  long[] defvalue)
           throws IOException
Associates a long array value with the current object (if not equal to the default).

Throws:
IOException

write

public void write(String name,
                  long[] value)
           throws IOException
Associates a long array value with the current object.

Throws:
IOException

write

public void write(String name,
                  short[] value,
                  short[] defvalue)
           throws IOException
Associates a short array value with the current object (if not equal to the default).

Throws:
IOException

write

public void write(String name,
                  short[] value)
           throws IOException
Associates a short array value with the current object.

Throws:
IOException

write

public void write(String name,
                  String value,
                  String defvalue)
           throws IOException
Associates a string value with the current object (if not equal to the default).

Throws:
IOException

write

public void write(String name,
                  String value)
           throws IOException
Associates a string value with the current object.

Throws:
IOException

write

public void write(String name,
                  ByteBuffer value,
                  ByteBuffer defvalue)
           throws IOException
Associates a byte buffer value with the current object (if not equal to the default).

Throws:
IOException

write

public void write(String name,
                  ByteBuffer value)
           throws IOException
Associates a byte buffer value with the current object.

Throws:
IOException

write

public void write(String name,
                  CharBuffer value,
                  CharBuffer defvalue)
           throws IOException
Associates a character buffer value with the current object (if not equal to the default).

Throws:
IOException

write

public void write(String name,
                  CharBuffer value)
           throws IOException
Associates a character buffer value with the current object.

Throws:
IOException

write

public void write(String name,
                  DoubleBuffer value,
                  DoubleBuffer defvalue)
           throws IOException
Associates a double buffer value with the current object (if not equal to the default).

Throws:
IOException

write

public void write(String name,
                  DoubleBuffer value)
           throws IOException
Associates a double buffer value with the current object.

Throws:
IOException

write

public void write(String name,
                  FloatBuffer value,
                  FloatBuffer defvalue)
           throws IOException
Associates a float buffer value with the current object (if not equal to the default).

Throws:
IOException

write

public void write(String name,
                  FloatBuffer value)
           throws IOException
Associates a float buffer value with the current object.

Throws:
IOException

write

public void write(String name,
                  IntBuffer value,
                  IntBuffer defvalue)
           throws IOException
Associates an integer buffer value with the current object (if not equal to the default).

Throws:
IOException

write

public void write(String name,
                  IntBuffer value)
           throws IOException
Associates an integer buffer value with the current object.

Throws:
IOException

write

public void write(String name,
                  LongBuffer value,
                  LongBuffer defvalue)
           throws IOException
Associates a long buffer value with the current object (if not equal to the default).

Throws:
IOException

write

public void write(String name,
                  LongBuffer value)
           throws IOException
Associates a long buffer value with the current object.

Throws:
IOException

write

public void write(String name,
                  ShortBuffer value,
                  ShortBuffer defvalue)
           throws IOException
Associates a short buffer value with the current object (if not equal to the default).

Throws:
IOException

write

public void write(String name,
                  ShortBuffer value)
           throws IOException
Associates a short buffer value with the current object.

Throws:
IOException

write

public void write(String name,
                  Color4f value,
                  Color4f defvalue)
           throws IOException
Associates a color value with the current object (if not equal to the default).

Throws:
IOException

write

public void write(String name,
                  Color4f value)
           throws IOException
Associates a color value with the current object.

Throws:
IOException

write

public void write(String name,
                  Matrix3f value,
                  Matrix3f defvalue)
           throws IOException
Associates a matrix value with the current object (if not equal to the default).

Throws:
IOException

write

public void write(String name,
                  Matrix3f value)
           throws IOException
Associates a matrix value with the current object.

Throws:
IOException

write

public void write(String name,
                  Matrix4f value,
                  Matrix4f defvalue)
           throws IOException
Associates a matrix value with the current object (if not equal to the default).

Throws:
IOException

write

public void write(String name,
                  Matrix4f value)
           throws IOException
Associates a matrix value with the current object.

Throws:
IOException

write

public void write(String name,
                  Quaternion value,
                  Quaternion defvalue)
           throws IOException
Associates a quaternion value with the current object (if not equal to the default).

Throws:
IOException

write

public void write(String name,
                  Quaternion value)
           throws IOException
Associates a quaternion value with the current object.

Throws:
IOException

write

public void write(String name,
                  Vector2f value,
                  Vector2f defvalue)
           throws IOException
Associates a vector value with the current object (if not equal to the default).

Throws:
IOException

write

public void write(String name,
                  Vector2f value)
           throws IOException
Associates a vector value with the current object.

Throws:
IOException

write

public void write(String name,
                  Vector3f value,
                  Vector3f defvalue)
           throws IOException
Associates a vector value with the current object (if not equal to the default).

Throws:
IOException

write

public void write(String name,
                  Vector3f value)
           throws IOException
Associates a vector value with the current object.

Throws:
IOException

write

public void write(String name,
                  Exportable value,
                  Exportable defvalue)
           throws IOException
Associates an exportable value with the current object (if not equal to the default).

Throws:
IOException

write

public void write(String name,
                  Exportable value)
           throws IOException
Associates an exportable value with the current object.

Throws:
IOException

write

public <T> void write(String name,
                      T value,
                      T defvalue,
                      Class<T> clazz)
           throws IOException
Associates an object value with the current object (if not equal to the default).

Throws:
IOException

write

public abstract <T> void write(String name,
                               T value,
                               Class<T> clazz)
                    throws IOException
Associates an object value with the current object.

Throws:
IOException

close

public abstract void close()
                    throws IOException
Writes out any remaining data and closes the underlying stream.

Specified by:
close in interface Closeable
Throws:
IOException

finish

public abstract void finish()
                     throws IOException
Writes out any remaining data without closing the underlying stream.

Throws:
IOException


Copyright © 2011. All Rights Reserved.