org.ocltf.translation.library
Class LibraryTranslation

java.lang.Object
  extended byorg.ocltf.translation.library.LibraryTranslation

public class LibraryTranslation
extends java.lang.Object

The LibraryTranslation object which stores

Author:
Chad Brandon

Constructor Summary
LibraryTranslation()
           
 
Method Summary
 java.lang.String getFile()
           
 Library getLibrary()
          Returns the Library that this LibraryTranslation belongs too.
 java.lang.String getName()
           
 TemplateEngine getTemplateEngine()
          Gets the TemplateEngine instance that will perform processing of the file.
 java.lang.String getTranslationFragment(java.lang.String name, java.lang.String kind)
          Gets the current "translated" value of this fragmentName for resulting from the last processTranslation method
 Translator getTranslator()
          Gets the Translator instance that will perform processing of the file.
 void handleTranslationFragment(java.lang.String name, java.lang.String kind, java.lang.Object node)
          Calls the handlerMethod from a translation fragment.
 Translation processTranslation(java.util.Map templateObjects)
          Processes the file belonging to this LibraryTranslation.
 void setFile(java.lang.String file)
           
 void setLibrary(Library library)
           
 void setName(java.lang.String name)
          Sets the name.
 void setTemplateEngine(java.lang.String templateEngineClass)
          Sets the TemplateEngine class that will perform processing of the file.
protected  void setTranslation(java.io.Reader translationInput)
          The processed translation template as a Reader.
 void setTranslator(java.lang.String translatorClass)
          Sets the Translator class that will perform the translation processing.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LibraryTranslation

public LibraryTranslation()
Method Detail

getName

public java.lang.String getName()
Returns:
String

setName

public void setName(java.lang.String name)
Sets the name.

Parameters:
name -

getFile

public java.lang.String getFile()
Returns:
String

setFile

public void setFile(java.lang.String file)
Parameters:
file -

getLibrary

public Library getLibrary()
Returns the Library that this LibraryTranslation belongs too.

Returns:
Library

setLibrary

public void setLibrary(Library library)
Parameters:
library -

getTemplateEngine

public TemplateEngine getTemplateEngine()
Gets the TemplateEngine instance that will perform processing of the file.

Returns:
TemplateEngine

setTemplateEngine

public void setTemplateEngine(java.lang.String templateEngineClass)
Sets the TemplateEngine class that will perform processing of the file.

Parameters:
templateEngineClass -

setTranslator

public void setTranslator(java.lang.String translatorClass)
Sets the Translator class that will perform the translation processing.

Parameters:
translatorClass -

getTranslator

public Translator getTranslator()
Gets the Translator instance that will perform processing of the file.

Returns:
Translator

handleTranslationFragment

public void handleTranslationFragment(java.lang.String name,
                                      java.lang.String kind,
                                      java.lang.Object node)
Calls the handlerMethod from a translation fragment. Each handle method must take a java.lang.String as the first argument (the body of the fragment from the translation file) and a java.lang.Object for the second argument (the node being parsed that we may need to retrieve any additional information from).

Parameters:
name - the name of the fragment to retrieve.
node - the node Object which from the parsed expression.
kind - the kind of the translation fragment to handle.

getTranslationFragment

public java.lang.String getTranslationFragment(java.lang.String name,
                                               java.lang.String kind)
Gets the current "translated" value of this fragmentName for resulting from the last processTranslation method

Parameters:
name - the name of the fragment to retrieve.
kind - the kind or type of fragment to retrieve (this is the based on the expression type: body, inv, post, pre, etc).
Returns:
String the value of the translated fragment or null of one wasn't found with the specified name.

setTranslation

protected void setTranslation(java.io.Reader translationInput)
The processed translation template as a Reader.

Parameters:
translationInput -

processTranslation

public Translation processTranslation(java.util.Map templateObjects)
Processes the file belonging to this LibraryTranslation.

Parameters:
templateObjects - - any key/value pairs that should be passed to the TemplateEngine while processing the translation file.
Returns:
Translation - the Translation created from the processing the translation file.

toString

public java.lang.String toString()
See Also:
Object.toString()


Copyright © 2003-2004 Chad Brandon. All Rights Reserved.