|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.uni_paderborn.tools.util.TextUtil
A class that contains some text-based utilities for fujaba.
Method Summary | |
static java.lang.String |
getNameWithoutPackage(java.lang.String className)
Get the nameWithoutPackage attribute of the TextUtil class |
static java.lang.String |
getPackageWithoutName(java.lang.String className)
Get the packageWithoutName attribute of the TextUtil class |
static boolean |
isJavaIdentifier(java.lang.String string)
Calls the Character.isJavaIdentifierPart(char) method for each char in string. |
static boolean |
isJavaIdentifier(java.lang.String string,
boolean considerStartLetter)
Calls the Character.isJavaIdentifierPart(char) method for each char in string. |
static boolean |
isJavaKeyword(java.lang.String str)
This method returns true if the provided String represents one of the Java
keywords as defined in the language specification. |
static boolean |
isJavaKeyword(java.lang.String str,
boolean literalsIncluded)
This method returns true if the provided String represents one of the Java
keywords as defined in the language specification. |
static boolean |
isJavaKeyword(java.lang.String str,
boolean literalsIncluded,
boolean trim)
This method returns true if the provided String represents one of the Java
keywords as defined in the language specification. |
static boolean |
isJavaSuitable(java.lang.String string)
Calls the Character.isJavaIdentifierPart(char) method for each char in string. |
static boolean |
isJavaSuitable(java.lang.String string,
boolean considerStartLetter)
Calls the Character.isJavaIdentifierPart(char) method for each char in string. |
static java.lang.String |
makeFujabaSuitable(java.lang.String s)
Turns a String, that represents a parameter or return type, to the right value so that a comparison of this String with the list of parameters e. g. in a method declaration will return true. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static boolean isJavaKeyword(java.lang.String str)
true
if the provided String represents one of the Java
keywords as defined in the language specification. It returns true
as well,
if the String represents a Java literal, which are "true", "false" and "null". If the
String itself is null, false is returned. When the String is compared, it has
to match cases. All Keywords and literals are lower-case-words.isJavaKeyword(str, true, true)
.
Note:
Beginning spaces and spaces at the end will be ignored because of invoking the trim()-method
on this String.
str
- The String to be possibly a Java keyword.
true
, if the provided String represents a Java keyword or Java
literal, false
otherwise.public static boolean isJavaKeyword(java.lang.String str, boolean literalsIncluded)
true
if the provided String represents one of the Java
keywords as defined in the language specification. By setting the boolean value literalsIncluded
to true, it returns true
as well, if the String represents a Java literal,
which are "true", "false" and "null". If the String itself is null, false is returned.
When the String is compared, it has to match cases. All Keywords and literals are lower-case-words.
isJavaKeyword(str, true, true)
.
Note:
Beginning spaces and spaces at the end will be ignored because of invoking the trim()-method
on this String.
str
- The String to be possibly a Java keyword.literalsIncluded
- If true
, the test will be extended to the Java
literals "false", "true" and "null"
.
true
, if the provided String represents a Java
keyword or, depending on the boolean parameter, represents a Java literal, false
otherwise.public static boolean isJavaKeyword(java.lang.String str, boolean literalsIncluded, boolean trim)
true
if the provided String represents one of the Java
keywords as defined in the language specification. By setting the boolean value literalsIncluded
to true, it returns true
as well, if the String represents a Java literal,
which are "true", "false" and "null". If the String itself is null, false is returned.
When the String is compared, it has to match cases. All Keywords and literals are lower-case-words.
str
- The String to be possibly a Java keyword.literalsIncluded
- If true
, the test will be extended to the Java
literals "false", "true" and "null"
.trim
- Indicates if the trim()-method should be invoked on the String
before testing.
true
, if the provided String represents a Java
keyword or, depending on the boolean parameter, represents a Java literal, false
otherwise.public static boolean isJavaIdentifier(java.lang.String string)
string
- No description provided
public static boolean isJavaSuitable(java.lang.String string)
string
- No description provided
public static boolean isJavaIdentifier(java.lang.String string, boolean considerStartLetter)
string
- No description providedconsiderStartLetter
- No description provided
public static boolean isJavaSuitable(java.lang.String string, boolean considerStartLetter)
string
- No description providedconsiderStartLetter
- No description provided
public static java.lang.String makeFujabaSuitable(java.lang.String s)
String
Modified String
boolean
Boolean
boolean[]
BooleanArray
byte
Byte
byte[]
ByteArray
char
Character
char[]
CharacterArray
double
Double
double[]
DoubleArray
float
Float
float[]
FloatArray
int
Integer
int[]
IntegerArray
long
LongInteger
long[]
LongIntegerArray
short
ShortInteger
short[]
ShortIntegerArray
String[]
StringArray
void
Void
s
- The String to be "translated".
public static java.lang.String getNameWithoutPackage(java.lang.String className)
className
- No description provided
public static java.lang.String getPackageWithoutName(java.lang.String className)
className
- No description provided
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |