Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.aendvari.common.notices
Class ResourceNoticeTranslator  view ResourceNoticeTranslator download ResourceNoticeTranslator.java

java.lang.Object
  extended bycom.aendvari.common.notices.ResourceNoticeTranslator
All Implemented Interfaces:
NoticeTranslator

public class ResourceNoticeTranslator
extends java.lang.Object
implements NoticeTranslator

Provides the ability to translate formatted notices into plain text.

The text of the notice is used as a java.util.ResourceBundle key.


Field Summary
private  java.util.ResourceBundle resourceBundle
          The resource bundle to use for parsing notices.
 
Constructor Summary
ResourceNoticeTranslator(java.lang.String resourcePath)
          Constructs a ResourceNoticeTranslator with a default locale.
ResourceNoticeTranslator(java.lang.String resourcePath, java.util.Locale locale)
          Constructs a ResourceNoticeTranslator with the given resource.
 
Method Summary
 java.util.Collection translate(java.util.Collection notices)
          Translates a Collection of notices.
 java.lang.String translate(Notice notice)
          Translates a single notice.
 java.lang.String[] translate(Notice[] notices)
          Translates an array of notices.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

resourceBundle

private java.util.ResourceBundle resourceBundle
The resource bundle to use for parsing notices.

Constructor Detail

ResourceNoticeTranslator

public ResourceNoticeTranslator(java.lang.String resourcePath)
Constructs a ResourceNoticeTranslator with a default locale.


ResourceNoticeTranslator

public ResourceNoticeTranslator(java.lang.String resourcePath,
                                java.util.Locale locale)
Constructs a ResourceNoticeTranslator with the given resource.

Method Detail

translate

public java.lang.String translate(Notice notice)
Translates a single notice.

Specified by:
translate in interface NoticeTranslator

translate

public java.util.Collection translate(java.util.Collection notices)
Translates a Collection of notices.

Specified by:
translate in interface NoticeTranslator

translate

public java.lang.String[] translate(Notice[] notices)
Translates an array of notices.

Specified by:
translate in interface NoticeTranslator