Here you can find the source of getMessage(String value, Object... args)
public static String getMessage(String value, Object... args)
//package com.java2s; /*/*from w w w.j a v a 2s .c o m*/ * Copyright (C) 2006-2016 Talend Inc. - www.talend.com * * This source code is available under agreement available at * %InstallDIR%\features\org.talend.rcp.branding.%PRODUCTNAME%\%PRODUCTNAME%license.txt * * You should have received a copy of the agreement along with this program; if not, write to Talend SA 9 rue Pages * 92150 Suresnes, France */ import java.text.MessageFormat; import java.util.MissingResourceException; public class Main { public static String getMessage(String value, Object... args) { try { MessageFormat format = new MessageFormat(escape(value)); value = format.format(args); return value; } catch (MissingResourceException e) { return "???" + value + "???"; } } /** * Escape any single quote characters that are included in the specified message string. * * @param string The string to be escaped */ private static String escape(String string) { if ((string == null) || (string.indexOf('\'') < 0)) { return string; } int n = string.length(); StringBuilder builder = new StringBuilder(n); for (int i = 0; i < n; i++) { char ch = string.charAt(i); if (ch == '\'') { builder.append('\''); } builder.append(ch); } return builder.toString(); } }