/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* representation of types and symbols.
*
* <p><b>This is NOT part of any supported API.
* If you write code that depends on this, you do so at your own risk.
* This code and its internal interfaces are subject to change or
* deletion without notice.</b>
*/
public abstract class Printer implements Type.Visitor<String, Locale>, Symbol.Visitor<String, Locale> {
/**
* This method should be overriden in order to provide proper i18n support.
*
* @param locale the locale in which the string is to be rendered
* @param key the key corresponding to the message to be displayed
* @param args a list of optional arguments
* @return localized string representation
*/
/**
* Maps a captured type into an unique identifier.
*
* @param t the captured type for which an id is to be retrieved
* @param locale locale settings
* @return unique id representing this captured type
*/
/**
* Create a printer with default i18n support provided by Messages. By default,
* captured types ids are generated using hashcode.
*
* @param messages Messages class to be used for i18n
* @return printer visitor instance
*/
return new Printer() {
}
}};
}
/**
* Get a localized string representation for all the types in the input list.
*
* @param ts types to be displayed
* @param locale the locale in which the string is to be rendered
* @return localized string representation
*/
}
}
/**
* * Get a localized string representation for all the symbols in the input list.
*
* @param ts symbols to be displayed
* @param locale the locale in which the string is to be rendered
* @return localized string representation
*/
}
}
/**
* Get a localized string represenation for a given type.
*
* @param ts type to be displayed
* @param locale the locale in which the string is to be rendered
* @return localized string representation
*/
}
/**
* Get a localized string represenation for a given symbol.
*
* @param ts symbol to be displayed
* @param locale the locale in which the string is to be rendered
* @return localized string representation
*/
}
if (seenCaptured.contains(t))
capturedVarId(t, locale));
else {
try {
capturedVarId(t, locale),
}
finally {
}
}
}
}
} else {
}
}
}
} else {
}
if (t.getTypeArguments().nonEmpty()) {
}
}
}
}
StringBuffer s = new StringBuffer();
}
return s.toString();
}
}
}
return s;
}
/**
* Converts a class name into a (possibly localized) string. Anonymous
* inner classes gets converted into a localized string.
*
* @param t the type of the class whose name is to be rendered
* @param longform if set, the class' fullname is displayed - if unset the
* short name is chosen (w/o package)
* @param locale the locale in which the string is to be rendered
* @return localized string representation
*/
s.append("&");
}
return s.toString();
String s;
} else {
}
return s;
} else if (longform) {
} else {
}
}
/**
* Converts a set of method argument types into their corresponding
* localized string representation.
*
* @param args arguments to be rendered
* @param varArgs if true, the last method argument is regarded as a vararg
* @param locale the locale in which the string is to be rendered
* @return localized string representation
*/
if (!varArgs) {
} else {
}
} else {
}
}
}
}
if (s.isStaticOrInstanceInit()) {
} else {
}
s.type.getParameterTypes(),
locale) + ")";
}
return ms;
}
}
return visitMethodSymbol(s, locale);
}
return s.isUnnamed()
}
return visitSymbol(s, locale);
}
return visitSymbol(s, locale);
}
}
}