FileDocCategorySizeDatePackage
Localizer.javaAPI DocApache Tomcat 6.0.145439Fri Jul 20 04:20:32 BST 2007org.apache.jasper.compiler

Localizer

public class Localizer extends Object
Class responsible for converting error codes to corresponding localized error messages.
author
Jan Luehe

Fields Summary
private static ResourceBundle
bundle
Constructors Summary
Methods Summary
public static java.lang.StringgetMessage(java.lang.String errCode)

    
     
        try {
        bundle = ResourceBundle.getBundle(
            "org.apache.jasper.resources.LocalStrings");
        } catch (Throwable t) {
            t.printStackTrace();
        }
    
	String errMsg = errCode;
	try {
	    errMsg = bundle.getString(errCode);
	} catch (MissingResourceException e) {
	}
	return errMsg;
    
public static java.lang.StringgetMessage(java.lang.String errCode, java.lang.String arg)

	return getMessage(errCode, new Object[] {arg});
    
public static java.lang.StringgetMessage(java.lang.String errCode, java.lang.String arg1, java.lang.String arg2)

	return getMessage(errCode, new Object[] {arg1, arg2});
    
public static java.lang.StringgetMessage(java.lang.String errCode, java.lang.String arg1, java.lang.String arg2, java.lang.String arg3)

	return getMessage(errCode, new Object[] {arg1, arg2, arg3});
    
public static java.lang.StringgetMessage(java.lang.String errCode, java.lang.String arg1, java.lang.String arg2, java.lang.String arg3, java.lang.String arg4)

	return getMessage(errCode, new Object[] {arg1, arg2, arg3, arg4});
    
public static java.lang.StringgetMessage(java.lang.String errCode, java.lang.Object[] args)

	String errMsg = errCode;
	try {
	    errMsg = bundle.getString(errCode);
	    if (args != null) {
		MessageFormat formatter = new MessageFormat(errMsg);
		errMsg = formatter.format(args);
	    }
	} catch (MissingResourceException e) {
	}
	
	return errMsg;