org.apache.pivot.wtkx
Class Translator

java.lang.Object
  extended by org.apache.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.


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.

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.
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.

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