|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.emf.codegen.util.CodeGenUtil
public class CodeGenUtil
This class contains convenient static methods for EMF code generation.
Methods in the 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.
Nested Class Summary | |
---|---|
static class |
CodeGenUtil.EclipseUtil
|
static class |
CodeGenUtil.StreamProgressMonitor
Deprecated. As of EMF 2.2, moved to EcoreUtil . |
Field Summary | |
---|---|
protected static java.util.regex.Pattern |
BRACE_LINE_PATTERN
|
protected static java.lang.String |
MATCH_LINE_SEPARATOR
|
Constructor Summary | |
---|---|
CodeGenUtil()
|
Method Summary | |
---|---|
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(org.eclipse.core.resources.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 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 |
validJavaIdentifier(java.lang.String name)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final java.lang.String MATCH_LINE_SEPARATOR
protected static final java.util.regex.Pattern BRACE_LINE_PATTERN
Constructor Detail |
---|
public CodeGenUtil()
Method Detail |
---|
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)
@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)
@Deprecated public static boolean isInJavaOutput(IResource resource)
CodeGenUtil.EclipseUtil.isInJavaOutput(org.eclipse.core.resources.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 Monitor createMonitor(Monitor monitor, int ticks)
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)
|
Copyright 2001-2006 IBM Corporation and others. All Rights Reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |