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 String
getFileName(String fullFileName)
static String
getFileNameNoSuffix(String f)
static Coordinate
getLineCharPosition(String s, int index)
Givenindex
into strings
, compute the line and char position in line.static String
getParent(String name)
static String
getPrefix(String name)
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 tofile:/tmp/test.jar!/org/foo/templates
static String
trimOneStartingNewline(String s)
Strip a single newline character from the front ofs
.static String
trimOneTrailingNewline(String s)
Strip a single newline character from the end ofs
.static boolean
urlExists(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.stg
convert 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)
Givenindex
into strings
, compute the line and char position in line.
-
-