public class Misc extends Object
| Constructor and Description |
|---|
Misc() |
| Modifier and Type | Method and Description |
|---|---|
static Object |
accessField(Field f,
Object o,
Object value) |
static String |
getFileName(String fullFileName) |
static String |
getFileNameNoSuffix(String f) |
static Coordinate |
getLineCharPosition(String s,
int index)
Given
index into string s, compute the line and char
position in line. |
static Method |
getMethod(Class<?> c,
String methodName) |
static String |
getParent(String name) |
static String |
getPrefix(String name) |
static Object |
invokeMethod(Method m,
Object o,
Object value) |
static String |
join(Iterator<?> iter,
String separator) |
static boolean |
referenceEquals(Object x,
Object y)
Makes it clear when a comparison is intended as reference equality.
|
static String |
replaceEscapedRightAngle(String s)
Replace >\> with >> in s.
|
static String |
replaceEscapes(String s) |
static String |
strip(String s,
int n) |
static String |
stripLastPathElement(String f)
Given, say,
file:/tmp/test.jar!/org/foo/templates/main.stg
convert to file:/tmp/test.jar!/org/foo/templates |
static String |
trimOneStartingNewline(String s)
Strip a single newline character from the front of
s. |
static String |
trimOneTrailingNewline(String s)
Strip a single newline character from the end of
s. |
static boolean |
urlExists(URL url) |
public static final String newline
public static boolean referenceEquals(Object x, Object y)
public static String trimOneStartingNewline(String s)
s.public static String trimOneTrailingNewline(String s)
s.public static String stripLastPathElement(String f)
file:/tmp/test.jar!/org/foo/templates/main.stg
convert to file:/tmp/test.jar!/org/foo/templatespublic static String replaceEscapedRightAngle(String s)
public static boolean urlExists(URL url)
public static Coordinate getLineCharPosition(String s, int index)
index into string s, compute the line and char
position in line.public static Object accessField(Field f, Object o, Object value) throws IllegalAccessException
IllegalAccessExceptionpublic static Object invokeMethod(Method m, Object o, Object value) throws IllegalAccessException, InvocationTargetException
Copyright © 2013. All Rights Reserved.