Package org.stringtemplate.v4.misc
Class Misc
- java.lang.Object
-
- org.stringtemplate.v4.misc.Misc
-
public class Misc extends Object
-
-
Constructor Summary
Constructors Constructor Description Misc()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringgetFileName(String fullFileName)static StringgetFileNameNoSuffix(String f)static CoordinategetLineCharPosition(String s, int index)Givenindexinto strings, compute the line and char position in line.static StringgetParent(String name)static StringgetPrefix(String name)static Stringjoin(Iterator<?> iter, String separator)static booleanreferenceEquals(Object x, Object y)Makes it clear when a comparison is intended as reference equality.static StringreplaceEscapedRightAngle(String s)Replace >\> with >> in s.static StringreplaceEscapes(String s)static Stringstrip(String s, int n)static StringstripLastPathElement(String f)Given, say,file:/tmp/test.jar!/org/foo/templates/main.stgconvert tofile:/tmp/test.jar!/org/foo/templatesstatic StringtrimOneStartingNewline(String s)Strip a single newline character from the front ofs.static StringtrimOneTrailingNewline(String s)Strip a single newline character from the end ofs.static booleanurlExists(URL url)
-
-
-
Field Detail
-
newline
public static final String newline
-
-
Method Detail
-
referenceEquals
public static boolean referenceEquals(Object x, Object y)
Makes it clear when a comparison is intended as reference equality.
-
trimOneStartingNewline
public static String trimOneStartingNewline(String s)
Strip a single newline character from the front ofs.
-
trimOneTrailingNewline
public static String trimOneTrailingNewline(String s)
Strip a single newline character from the end ofs.
-
stripLastPathElement
public static String stripLastPathElement(String f)
Given, say,file:/tmp/test.jar!/org/foo/templates/main.stgconvert tofile:/tmp/test.jar!/org/foo/templates
-
replaceEscapedRightAngle
public static String replaceEscapedRightAngle(String s)
Replace >\> with >> in s.Replace \> with > in s, unless prefix of \>>>.
Do NOT replace if it's <\\>
-
urlExists
public static boolean urlExists(URL url)
-
getLineCharPosition
public static Coordinate getLineCharPosition(String s, int index)
Givenindexinto strings, compute the line and char position in line.
-
-