de.jreality.reader
Class Readers

java.lang.Object
  extended by de.jreality.reader.Readers

public final class Readers
extends Object

Entry point to load a jReality SceneGraph from some sort of resource.


Method Summary
static String findFormat(String resourceName)
           
static SceneReader findReader(String format)
          returns a reader for the given format if available - null if not.
static SceneGraphComponent read(File file)
          reads the given file with the matching reader for the file ending.
static SceneGraphComponent read(Input input)
          determines the format of the given input depending on the file ending of the URL.
static SceneGraphComponent read(SceneReader reader, Input input)
          Reads the scene from the given input with the given SceneReader.
static SceneGraphComponent read(String format, Input input)
          Reads the scene from the given input with the SceneReader for the given format.
static SceneGraphComponent read(URL url)
          reads the given url with the matching reader for the file ending.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

findReader

public static SceneReader findReader(String format)
returns a reader for the given format if available - null if not.

Parameters:
format - String representation for the format to read.
Returns:
a matching reader or null.

read

public static SceneGraphComponent read(SceneReader reader,
                                       Input input)
                                throws IOException
Reads the scene from the given input with the given SceneReader.

Parameters:
reader - the SceneReader to read with.
input - the Input to read with the given SceneReader.
Returns:
the root component of the read scene.
Throws:
IOException

read

public static SceneGraphComponent read(String format,
                                       Input input)
                                throws IOException
Reads the scene from the given input with the SceneReader for the given format.

Parameters:
format - the format of the given input.
input - the Input to read with the SceneReader for the given format.
Returns:
the root component of the read scene.
Throws:
IOException

read

public static SceneGraphComponent read(File file)
                                throws IOException
reads the given file with the matching reader for the file ending.

Parameters:
file - the file to read.
Throws:
IOException

read

public static SceneGraphComponent read(URL url)
                                throws IOException
reads the given url with the matching reader for the file ending. NOTE: the URL must end with a supported file extension.

Parameters:
url - the url to read.
Throws:
IOException

read

public static SceneGraphComponent read(Input input)
                                throws IOException
determines the format of the given input depending on the file ending of the URL. That means it can only read Inputs based on filesand URLs.

Parameters:
input -
Returns:
rhe root component of the read input
Throws:
IOException

findFormat

public static String findFormat(String resourceName)