public class CodeGenUtil
extends java.lang.Object
EclipseHelper
inner class may only be used running under Eclipse.
The same applies to those that are deprecated and replaced by methods in the inner class, too.
All other methods can be used in a stand-alone scenario, too.
This class, like much of the code in this plug-in, is currently undergoing change and should not be considered API.
Modifier and Type | Class and Description |
---|---|
static class |
CodeGenUtil.EclipseUtil |
static class |
CodeGenUtil.StreamProgressMonitor
Deprecated.
As of EMF 2.2, moved to
EcoreUtil . |
Modifier and Type | Field and Description |
---|---|
protected static java.util.regex.Pattern |
BRACE_LINE_PATTERN |
protected static java.lang.String |
MATCH_LINE_SEPARATOR |
Constructor and Description |
---|
CodeGenUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
addClasspathEntries(java.util.Collection<?> classpathEntries,
java.lang.String pluginID)
Deprecated.
in 2.2. Please use
CodeGenUtil.EclipseUtil.addClasspathEntries(Collection, String) instead. |
static void |
addClasspathEntries(java.util.Collection<?> classpathEntries,
java.lang.String variableName,
java.lang.String pluginID)
Deprecated.
in 2.2. Please use
CodeGenUtil.EclipseUtil.addClasspathEntries(Collection, String, String) instead. |
static java.lang.String |
capName(java.lang.String name) |
static java.lang.String |
capName(java.lang.String name,
java.util.Locale locale) |
static java.lang.String |
convertFormat(java.lang.String tabReplacement,
boolean convertToStandardBraceStyle,
java.lang.String value) |
static Monitor |
createMonitor(Monitor monitor,
int ticks) |
static IContainer |
findOrCreateContainer(IPath path,
boolean forceRefresh,
IPath localLocation,
IProgressMonitor progressMonitor)
Deprecated.
in 2.2. Please use
CodeGenUtil.EclipseUtil.findOrCreateContainer(IPath, boolean, IPath, IProgressMonitor) instead. |
static IContainer |
findOrCreateContainer(IPath path,
boolean forceRefresh,
IProjectDescription projectDescription,
IProgressMonitor progressMonitor)
Deprecated.
in 2.2. Please use
CodeGenUtil.EclipseUtil.findOrCreateContainer(IPath, boolean, IProjectDescription, IProgressMonitor) instead. |
static java.lang.String |
format(java.lang.String name,
char separator,
java.lang.String prefix,
boolean includePrefix)
Deprecated.
In 2.2. Please use
format(String, char, String, boolean, boolean) instead. |
static java.lang.String |
format(java.lang.String name,
char separator,
java.lang.String prefix,
boolean includePrefix,
boolean includeLeadingSeparator)
Formats a name by parsing it into words separated by underscores and/or mixed-casing and then
recombining them using the specified separator.
|
static java.util.List<java.lang.String> |
getClasspathPaths(java.lang.String pluginID)
Deprecated.
in 2.2. Please use
CodeGenUtil.EclipseUtil.getClasspathPaths(java.lang.String) instead. |
static java.util.Set<java.lang.String> |
getJavaDefaultTypes()
Returns the short names of the primitives and types in java.lang (i.e. those
that don't need qualification).
|
static java.util.Set<java.lang.String> |
getJavaReservedWords()
Returns the set of all Java's keywords and textual literals, as of Java 5.0.
|
static java.lang.String |
getPackageName(java.lang.String qualifiedClassName)
Returns the package name for a qualified class name, i.e., a substring
from the first char until the last ".
|
static java.lang.String |
getSimpleClassName(java.lang.String qualifiedClassName)
Returns the simple class name for a qualified class name, i.e., a substring
from starting after the last ".
|
static FacadeHelper |
instantiateFacadeHelper(java.lang.String facadeHelperClass) |
static boolean |
isInJavaOutput(IResource resource)
Deprecated.
in 2.2. Please use
CodeGenUtil.EclipseUtil.isInJavaOutput(IResource) instead. |
static boolean |
isJavaDefaultType(java.lang.String s)
Tests whether the given string is the name of a primitive or java.lang type.
|
static boolean |
isJavaLangType(java.lang.String s)
Tests whether the given string is the name of a java.lang type.
|
static boolean |
isJavaPrimitiveType(java.lang.String s)
Tests whether the given string is the name of a primitive type.
|
static boolean |
isJavaReservedWord(java.lang.String s)
Tests whether a given string is a Java reserved word.
|
static boolean |
isUncheckedCast(java.lang.String type)
Return true if the string representing a type contains type arguments that specify anything other than unbounded wildcards.
|
static java.lang.String |
javaIdentifier(java.lang.String sourceName,
java.util.Locale locale)
This method breaks sourceName into words delimited by mixed-case naming, the separators '_' and '$', and non-Java identifier characters.
|
static char |
parseChar(java.lang.String c) |
static java.util.List<java.lang.String> |
parseName(java.lang.String sourceName,
char separator)
This method breaks sourceName into words delimited by separator and/or mixed-case naming.
|
static java.lang.String |
parseString(java.lang.String s) |
static java.lang.String |
safeName(java.lang.String name) |
static java.lang.String |
uncapName(java.lang.String name) |
static java.lang.String |
uncapName(java.lang.String name,
java.util.Locale locale) |
static java.lang.String |
uncapPrefixedName(java.lang.String name,
boolean forceDifferent) |
static java.lang.String |
uncapPrefixedName(java.lang.String name,
boolean forceDifferent,
java.util.Locale locale) |
static java.lang.String |
unicodeEscapeEncode(java.lang.String unicode)
Performs escape encoding on the given string so that it can be represented using 1-byte characters.
|
static java.lang.String |
upperName(java.lang.String name) |
static java.lang.String |
upperName(java.lang.String name,
java.util.Locale locale) |
static java.lang.String |
validJavaIdentifier(java.lang.String name) |
static java.lang.String |
validPluginID(java.lang.String base) |
protected static final java.lang.String MATCH_LINE_SEPARATOR
protected static final java.util.regex.Pattern BRACE_LINE_PATTERN
public static java.util.Set<java.lang.String> getJavaReservedWords()
public static java.util.Set<java.lang.String> getJavaDefaultTypes()
public static boolean isJavaReservedWord(java.lang.String s)
public static boolean isJavaDefaultType(java.lang.String s)
public static boolean isJavaLangType(java.lang.String s)
public static boolean isJavaPrimitiveType(java.lang.String s)
public static java.lang.String parseString(java.lang.String s)
public static char parseChar(java.lang.String c)
public static java.lang.String validJavaIdentifier(java.lang.String name)
public static java.lang.String capName(java.lang.String name, java.util.Locale locale)
public static java.lang.String capName(java.lang.String name)
public static java.lang.String uncapName(java.lang.String name, java.util.Locale locale)
public static java.lang.String uncapName(java.lang.String name)
public static java.lang.String uncapPrefixedName(java.lang.String name, boolean forceDifferent, java.util.Locale locale)
public static java.lang.String uncapPrefixedName(java.lang.String name, boolean forceDifferent)
public static java.lang.String safeName(java.lang.String name)
public static java.lang.String upperName(java.lang.String name, java.util.Locale locale)
public static java.lang.String upperName(java.lang.String name)
@Deprecated public static java.lang.String format(java.lang.String name, char separator, java.lang.String prefix, boolean includePrefix)
format(String, char, String, boolean, boolean)
instead.public static java.lang.String format(java.lang.String name, char separator, java.lang.String prefix, boolean includePrefix, boolean includeLeadingSeparator)
public static java.util.List<java.lang.String> parseName(java.lang.String sourceName, char separator)
public static java.lang.String javaIdentifier(java.lang.String sourceName, java.util.Locale locale)
capitalized
words into a valid Java identifier,
prefixing the result with "_" if that's necessary to make the result a well-formed Java identifier.@Deprecated public static boolean isInJavaOutput(IResource resource)
CodeGenUtil.EclipseUtil.isInJavaOutput(IResource)
instead.@Deprecated public static IContainer findOrCreateContainer(IPath path, boolean forceRefresh, IPath localLocation, IProgressMonitor progressMonitor) throws CoreException
CodeGenUtil.EclipseUtil.findOrCreateContainer(IPath, boolean, IPath, IProgressMonitor)
instead.CoreException
@Deprecated public static IContainer findOrCreateContainer(IPath path, boolean forceRefresh, IProjectDescription projectDescription, IProgressMonitor progressMonitor) throws CoreException
CodeGenUtil.EclipseUtil.findOrCreateContainer(IPath, boolean, IProjectDescription, IProgressMonitor)
instead.CoreException
@Deprecated public static java.util.List<java.lang.String> getClasspathPaths(java.lang.String pluginID) throws JETException
CodeGenUtil.EclipseUtil.getClasspathPaths(java.lang.String)
instead.JETException
@Deprecated public static void addClasspathEntries(java.util.Collection<?> classpathEntries, java.lang.String variableName, java.lang.String pluginID) throws JETException
CodeGenUtil.EclipseUtil.addClasspathEntries(Collection, String, String)
instead.JETException
@Deprecated public static void addClasspathEntries(java.util.Collection<?> classpathEntries, java.lang.String pluginID) throws java.lang.Exception
CodeGenUtil.EclipseUtil.addClasspathEntries(Collection, String)
instead.java.lang.Exception
public static java.lang.String getPackageName(java.lang.String qualifiedClassName)
qualifiedClassName
- public static java.lang.String getSimpleClassName(java.lang.String qualifiedClassName)
qualifiedClassName
- public static java.lang.String convertFormat(java.lang.String tabReplacement, boolean convertToStandardBraceStyle, java.lang.String value)
public static java.lang.String unicodeEscapeEncode(java.lang.String unicode)
public static FacadeHelper instantiateFacadeHelper(java.lang.String facadeHelperClass)
public static java.lang.String validPluginID(java.lang.String base)
public static boolean isUncheckedCast(java.lang.String type)