Example usage for java.util ListResourceBundle ListResourceBundle

List of usage examples for java.util ListResourceBundle ListResourceBundle

Introduction

In this page you can find the example usage for java.util ListResourceBundle ListResourceBundle.

Prototype

public ListResourceBundle() 

Source Link

Document

Sole constructor.

Usage

From source file:org.pentaho.osgi.i18n.webservice.ResourceBundleMessageBodyWriterTest.java

public ResourceBundle makeResourceBundle(final Map<String, String> map) {
    return new ListResourceBundle() {
        @Override//  w  w w . j  a  v a  2 s. c  om
        protected Object[][] getContents() {
            Object[][] result = new Object[map.size()][];
            int index = 0;
            for (Map.Entry<String, String> entry : map.entrySet()) {
                Object[] entryObj = new Object[2];
                entryObj[0] = entry.getKey();
                entryObj[1] = entry.getValue();
                result[index++] = entryObj;
            }
            return result;
        }
    };
}