org.ocltf.translation.library
Class Library

java.lang.Object
  extended byorg.ocltf.translation.library.Library
All Implemented Interfaces:
Plugin

public class Library
extends java.lang.Object
implements Plugin

This class contains the translation library information loaded from a translation-library.xml file.

Author:
Chad Brandon

Constructor Summary
Library()
           
 
Method Summary
 void addLibraryTranslation(LibraryTranslation libraryTranslation)
          Adds a new LibraryTranslation.
 void addTemplateObject(TemplateObject templateObject)
          Adds a TransformerConfig object which will make a Transformer object available to this Library.
static Library getInstance(java.net.URL libraryXml)
          Returns a new configured instance of this Library from the libraryXml URL.
 LibraryTranslation getLibraryTranslation(java.lang.String name)
          Retrieves the LibraryTranslation with the specified name.
 java.util.Map getLibraryTranslations()
          Gets the LibraryTranslation instances (keyed by name) which are part of this Library.
 java.lang.String getName()
          Returns the name of this Library.
 java.net.URL getResource()
          The resource URI from which this Library was configured.
 java.lang.String getResourceName()
          The name of the resource (i.e META-INF/cartridge.xml) that will configure an instance of this Plugin.
 java.util.Map getTemplateObjects()
          Returns all the TemplateObject objects that are available to this Cartridge.
 void setName(java.lang.String name)
          Sets the name of this Library.
 void setTemplateEngine(java.lang.String templateEngineClass)
          Sets the TemplateEngine class that will perform processing of the translation file.
 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

Library

public Library()
Method Detail

getInstance

public static Library getInstance(java.net.URL libraryXml)
Returns a new configured instance of this Library from the libraryXml URL.

Parameters:
libraryXml - the URI to the library XML configuration document.
Returns:
Library the configured Library instance.

getName

public java.lang.String getName()
Returns the name of this Library.

Specified by:
getName in interface Plugin
Returns:
String

setName

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

Parameters:
name -

getResource

public java.net.URL getResource()
The resource URI from which this Library was configured.

Returns:
URL the URI from which this Library was configured.

addLibraryTranslation

public void addLibraryTranslation(LibraryTranslation libraryTranslation)
Adds a new LibraryTranslation.

Parameters:
libraryTranslation -

getLibraryTranslations

public java.util.Map getLibraryTranslations()
Gets the LibraryTranslation instances (keyed by name) which are part of this Library.

Returns:
Map

getLibraryTranslation

public LibraryTranslation getLibraryTranslation(java.lang.String name)
Retrieves the LibraryTranslation with the specified name.

Parameters:
name -
Returns:
LibraryTranslation the LibraryTranslation corresponding to the name.

setTemplateEngine

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

Parameters:
templateEngineClass - the Class to use for the TemplateEngine

setTranslator

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

Parameters:
translatorClass - the Class for the Translator implementation.

addTemplateObject

public void addTemplateObject(TemplateObject templateObject)
Adds a TransformerConfig object which will make a Transformer object available to this Library.


getTemplateObjects

public java.util.Map getTemplateObjects()
Returns all the TemplateObject objects that are available to this Cartridge.

Returns:
Map the templateObjects keyed by name.

getResourceName

public java.lang.String getResourceName()
Description copied from interface: Plugin
The name of the resource (i.e META-INF/cartridge.xml) that will configure an instance of this Plugin.

Specified by:
getResourceName in interface Plugin
Returns:
String the name of the resource that can configure an instance of this Plugin.
See Also:
Plugin.getResourceName()

toString

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


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