Package org.eclipse.xtext.util.internal
Class CodeGenUtil2
- java.lang.Object
-
- org.eclipse.xtext.util.internal.CodeGenUtil2
-
public class CodeGenUtil2 extends java.lang.Object
Partial Copy of EMF's CodeGenUtil
-
-
Constructor Summary
Constructors Constructor Description CodeGenUtil2()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description 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.Set<java.lang.String>
getJavaDefaultTypes()
Returns the short names of the primitives and types in java.lang (i.e.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 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.
-
-
-
Method Detail
-
isJavaLangType
public static boolean isJavaLangType(java.lang.String s)
Tests whether the given string is the name of a java.lang type.
-
isJavaDefaultType
public static boolean isJavaDefaultType(java.lang.String s)
Tests whether the given string is the name of a primitive or java.lang type.
-
format
public 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. A prefix can also be given to be recognized as a separate word or to be trimmed. Leading underscores can be ignored or can cause a leading separator to be prepended.- Since:
- 2.2
-
parseName
public 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.
-
getJavaDefaultTypes
public 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).
-
-