com.threerings.export
Class Importer

java.lang.Object
  extended by com.threerings.export.Importer
All Implemented Interfaces:
Closeable
Direct Known Subclasses:
BinaryImporter, XMLImporter

public abstract class Importer
extends Object
implements Closeable

Used to read Exportable objects. Other common object types are supported as well (@see Exporter).

See Also:
Exportable

Constructor Summary
Importer()
           
 
Method Summary
abstract  void close()
          Closes the underlying stream.
 void defaultReadFields()
          Writes the default fields of the object.
abstract  boolean read(String name, boolean defvalue)
          Reads a boolean value associated with the current object.
 boolean[] read(String name, boolean[] defvalue)
          Reads a boolean array value associated with the current object.
abstract  byte read(String name, byte defvalue)
          Reads a byte value associated with the current object.
 byte[] read(String name, byte[] defvalue)
          Reads a byte array value associated with the current object.
 ByteBuffer read(String name, ByteBuffer defvalue)
          Reads a byte buffer value associated with the current object.
abstract  char read(String name, char defvalue)
          Reads a character value associated with the current object.
 char[] read(String name, char[] defvalue)
          Reads a character array value associated with the current object.
 CharBuffer read(String name, CharBuffer defvalue)
          Reads a character buffer value associated with the current object.
 Color4f read(String name, Color4f defvalue)
          Reads a color value associated with the current object.
abstract  double read(String name, double defvalue)
          Reads a double value associated with the current object.
 double[] read(String name, double[] defvalue)
          Reads a double array value associated with the current object.
 DoubleBuffer read(String name, DoubleBuffer defvalue)
          Reads a double buffer value associated with the current object.
 Exportable read(String name, Exportable defvalue)
          Reads an exportable value associated with the current object.
abstract  float read(String name, float defvalue)
          Reads a float value associated with the current object.
 float[] read(String name, float[] defvalue)
          Reads a float array value associated with the current object.
 FloatBuffer read(String name, FloatBuffer defvalue)
          Reads a float buffer value associated with the current object.
abstract  int read(String name, int defvalue)
          Reads an integer value associated with the current object.
 int[] read(String name, int[] defvalue)
          Reads an integer array value associated with the current object.
 IntBuffer read(String name, IntBuffer defvalue)
          Reads an integer buffer value associated with the current object.
abstract  long read(String name, long defvalue)
          Reads a long value associated with the current object.
 long[] read(String name, long[] defvalue)
          Reads a long array value associated with the current object.
 LongBuffer read(String name, LongBuffer defvalue)
          Reads a long buffer value associated with the current object.
 Matrix3f read(String name, Matrix3f defvalue)
          Reads a matrix value associated with the current object.
 Matrix4f read(String name, Matrix4f defvalue)
          Reads a matrix value associated with the current object.
 Quaternion read(String name, Quaternion defvalue)
          Reads a quaternion value associated with the current object.
abstract  short read(String name, short defvalue)
          Reads a short value associated with the current object.
 short[] read(String name, short[] defvalue)
          Reads a short array value associated with the current object.
 ShortBuffer read(String name, ShortBuffer defvalue)
          Reads a short buffer value associated with the current object.
 String read(String name, String defvalue)
          Reads a string value associated with the current object.
abstract
<T> T
read(String name, T defvalue, Class<T> clazz)
          Reads an object value associated with the current object.
 Vector2f read(String name, Vector2f defvalue)
          Reads a vector value associated with the current object.
 Vector3f read(String name, Vector3f defvalue)
          Reads a vector value associated with the current object.
abstract  Object readObject()
          Imports an object from the underlying stream.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Importer

public Importer()
Method Detail

readObject

public abstract Object readObject()
                           throws IOException
Imports an object from the underlying stream.

Throws:
IOException

defaultReadFields

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

Throws:
IOException

read

public abstract boolean read(String name,
                             boolean defvalue)
                      throws IOException
Reads a boolean value associated with the current object.

Throws:
IOException

read

public abstract byte read(String name,
                          byte defvalue)
                   throws IOException
Reads a byte value associated with the current object.

Throws:
IOException

read

public abstract char read(String name,
                          char defvalue)
                   throws IOException
Reads a character value associated with the current object.

Throws:
IOException

read

public abstract double read(String name,
                            double defvalue)
                     throws IOException
Reads a double value associated with the current object.

Throws:
IOException

read

public abstract float read(String name,
                           float defvalue)
                    throws IOException
Reads a float value associated with the current object.

Throws:
IOException

read

public abstract int read(String name,
                         int defvalue)
                  throws IOException
Reads an integer value associated with the current object.

Throws:
IOException

read

public abstract long read(String name,
                          long defvalue)
                   throws IOException
Reads a long value associated with the current object.

Throws:
IOException

read

public abstract short read(String name,
                           short defvalue)
                    throws IOException
Reads a short value associated with the current object.

Throws:
IOException

read

public boolean[] read(String name,
                      boolean[] defvalue)
               throws IOException
Reads a boolean array value associated with the current object.

Throws:
IOException

read

public byte[] read(String name,
                   byte[] defvalue)
            throws IOException
Reads a byte array value associated with the current object.

Throws:
IOException

read

public char[] read(String name,
                   char[] defvalue)
            throws IOException
Reads a character array value associated with the current object.

Throws:
IOException

read

public double[] read(String name,
                     double[] defvalue)
              throws IOException
Reads a double array value associated with the current object.

Throws:
IOException

read

public float[] read(String name,
                    float[] defvalue)
             throws IOException
Reads a float array value associated with the current object.

Throws:
IOException

read

public int[] read(String name,
                  int[] defvalue)
           throws IOException
Reads an integer array value associated with the current object.

Throws:
IOException

read

public long[] read(String name,
                   long[] defvalue)
            throws IOException
Reads a long array value associated with the current object.

Throws:
IOException

read

public short[] read(String name,
                    short[] defvalue)
             throws IOException
Reads a short array value associated with the current object.

Throws:
IOException

read

public String read(String name,
                   String defvalue)
            throws IOException
Reads a string value associated with the current object.

Throws:
IOException

read

public ByteBuffer read(String name,
                       ByteBuffer defvalue)
                throws IOException
Reads a byte buffer value associated with the current object.

Throws:
IOException

read

public CharBuffer read(String name,
                       CharBuffer defvalue)
                throws IOException
Reads a character buffer value associated with the current object.

Throws:
IOException

read

public DoubleBuffer read(String name,
                         DoubleBuffer defvalue)
                  throws IOException
Reads a double buffer value associated with the current object.

Throws:
IOException

read

public FloatBuffer read(String name,
                        FloatBuffer defvalue)
                 throws IOException
Reads a float buffer value associated with the current object.

Throws:
IOException

read

public IntBuffer read(String name,
                      IntBuffer defvalue)
               throws IOException
Reads an integer buffer value associated with the current object.

Throws:
IOException

read

public LongBuffer read(String name,
                       LongBuffer defvalue)
                throws IOException
Reads a long buffer value associated with the current object.

Throws:
IOException

read

public ShortBuffer read(String name,
                        ShortBuffer defvalue)
                 throws IOException
Reads a short buffer value associated with the current object.

Throws:
IOException

read

public Color4f read(String name,
                    Color4f defvalue)
             throws IOException
Reads a color value associated with the current object.

Throws:
IOException

read

public Matrix3f read(String name,
                     Matrix3f defvalue)
              throws IOException
Reads a matrix value associated with the current object.

Throws:
IOException

read

public Matrix4f read(String name,
                     Matrix4f defvalue)
              throws IOException
Reads a matrix value associated with the current object.

Throws:
IOException

read

public Quaternion read(String name,
                       Quaternion defvalue)
                throws IOException
Reads a quaternion value associated with the current object.

Throws:
IOException

read

public Vector2f read(String name,
                     Vector2f defvalue)
              throws IOException
Reads a vector value associated with the current object.

Throws:
IOException

read

public Vector3f read(String name,
                     Vector3f defvalue)
              throws IOException
Reads a vector value associated with the current object.

Throws:
IOException

read

public Exportable read(String name,
                       Exportable defvalue)
                throws IOException
Reads an exportable value associated with the current object.

Throws:
IOException

read

public abstract <T> T read(String name,
                           T defvalue,
                           Class<T> clazz)
                throws IOException
Reads an object value associated with the current object.

Throws:
IOException

close

public abstract void close()
                    throws IOException
Closes the underlying stream.

Specified by:
close in interface Closeable
Throws:
IOException


Copyright © 2011. All Rights Reserved.