pivot.wtkx
Class Translator

java.lang.Object
  extended by pivot.wtkx.Translator

public class Translator
extends Object

Translates WTKX documents into compilable Java file objects.

NOTE: This class contains experimental functionality and should be considered a "preview" until a future release.

Author:
tvolkert

Constructor Summary
Translator()
          Creates a new Translator.
 
Method Summary
 JavaFileObject translate(Class<?> referenceClass, String resourceName)
          Translates a WTKX resource into a Java source file.
 JavaFileObject translate(InputStream inputStream, String className)
          Translates a WTKX input stream into a Java source file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Translator

public Translator()
Creates a new Translator.

Method Detail

translate

public JavaFileObject translate(Class<?> referenceClass,
                                String resourceName)
                         throws IOException
Translates a WTKX resource into a Java source file. The translated class will implement the Bindable.ObjectHierarchy interface.

Parameters:
referenceClass - The class relative to which the WTKX resource can be found.
resourceName - A path name that identifies the WTKX resource. The path name should be of the form defined by Class.getResource(String) and is relative to the base package. Note that this is the same form as is defined in Bindable.Load.resourceName().
Returns:
The Java source file representation of the WTKX resource.
Throws:
IOException

translate

public JavaFileObject translate(InputStream inputStream,
                                String className)
                         throws IOException
Translates a WTKX input stream into a Java source file. The translated class will implement the Bindable.ObjectHierarchy interface.

Parameters:
inputStream - The data stream from which the WTKX will be read.
className - The fully qualified class name of the class to generate.
Returns:
The Java source file representation of the WTKX.
Throws:
IOException