public class StringUtils extends Object
Modifier and Type | Method and Description |
---|---|
static String |
byteArrayToHexString(byte[] bytes)
Convert a byte array into a hexidecimal representation.
|
static String |
capitalize(String string)
Capitalize the first letter of a string.
|
static String |
classNameToFilePath(String className)
Construct the relative path to a class file on the file system for a given class, without the
".class" suffix.
|
static String |
classToTemplatePath(Class<?> clazz)
Compute the /-separated path for a given class.
|
static void |
commaJoin(StringBuilder builder,
Iterable<String> iterable)
Concatenate a list of strings into a single
StringBuilder , with commas between
successive elements. |
static String |
filePathToTemplatePath(String path)
Convert a path using the systems path separator into a /-separated path.
|
static String |
hexify4(int integer)
Compute the 4-digit hexidecimal represenation of an integer between
0 and 0xFFFF . |
static boolean |
isGeneratedClassFilename(String className,
String fileName)
Determine if the given file name could be part of a given class.
|
static String |
templatePathToClassName(String path)
Convert a /-separated path into a class name.
|
static String |
templatePathToFileDir(String path)
Return the directory part of a template path, in filesystem format (i.e.
|
public static String templatePathToFileDir(String path)
File.separator
).path
- the template pathpublic static boolean isGeneratedClassFilename(String className, String fileName)
className
- the class namefileName
- the file namepublic static String templatePathToClassName(String path)
path
- the /-separated pathpublic static String classToTemplatePath(Class<?> clazz)
clazz
- the classpublic static String filePathToTemplatePath(String path)
path
- an OS-specific pathpublic static String classNameToFilePath(String className)
className
- the class namepublic static String capitalize(String string)
string
- the stringp_string
with the first letter capitalizedpublic static String byteArrayToHexString(byte[] bytes)
bytes
- the byte arraypublic static String hexify4(int integer)
0
and 0xFFFF
.integer
- the integerpublic static void commaJoin(StringBuilder builder, Iterable<String> iterable)
StringBuilder
, with commas between
successive elements.builder
- the builderiterable
- the list of stringsCopyright © 2003–2017 Jamon developers. All rights reserved.