org.stringtemplate.v4.misc
Class Misc

java.lang.Object
  extended by org.stringtemplate.v4.misc.Misc

public class Misc
extends Object


Field Summary
static String newline
           
 
Constructor Summary
Misc()
           
 
Method Summary
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, 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 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)
           
static String trimOneTrailingNewline(String s)
           
static boolean urlExists(URL url)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

newline

public static final String newline
Constructor Detail

Misc

public Misc()
Method Detail

join

public static String join(Iterator iter,
                          String separator)

strip

public static String strip(String s,
                           int n)

trimOneStartingNewline

public static String trimOneStartingNewline(String s)

trimOneTrailingNewline

public static String trimOneTrailingNewline(String s)

stripLastPathElement

public 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


getFileNameNoSuffix

public static String getFileNameNoSuffix(String f)

getFileName

public static String getFileName(String fullFileName)

getParent

public static String getParent(String name)

getPrefix

public static String getPrefix(String name)

replaceEscapes

public static String replaceEscapes(String s)

urlExists

public static boolean urlExists(URL url)

getLineCharPosition

public static Coordinate getLineCharPosition(String s,
                                             int index)
Given index into string, compute the line and char position in line


accessField

public static Object accessField(Field f,
                                 Object o,
                                 Object value)
                          throws IllegalAccessException
Throws:
IllegalAccessException

invokeMethod

public static Object invokeMethod(Method m,
                                  Object o,
                                  Object value)
                           throws IllegalAccessException,
                                  InvocationTargetException
Throws:
IllegalAccessException
InvocationTargetException

getMethod

public static Method getMethod(Class c,
                               String methodName)


Copyright © 2011. All Rights Reserved.