org.stringtemplate.v4.misc
Class Misc

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

public class Misc
extends java.lang.Object


Field Summary
static java.lang.String newline
           
 
Constructor Summary
Misc()
           
 
Method Summary
static java.lang.Object accessField(java.lang.reflect.Field f, java.lang.Object o, java.lang.Object value)
           
static java.lang.String getFileName(java.lang.String fullFileName)
           
static java.lang.String getFileNameNoSuffix(java.lang.String f)
           
static Coordinate getLineCharPosition(java.lang.String s, int index)
          Given index into string, compute the line and char position in line
static java.lang.reflect.Method getMethod(java.lang.Class c, java.lang.String methodName)
           
static java.lang.String getPrefix(java.lang.String name)
           
static java.lang.Object invokeMethod(java.lang.reflect.Method m, java.lang.Object o, java.lang.Object value)
           
static java.lang.String join(java.util.Iterator iter, java.lang.String separator)
           
static java.lang.String replaceEscapes(java.lang.String s)
           
static java.lang.String strip(java.lang.String s, int n)
           
static java.lang.String stripLastPathElement(java.lang.String f)
          Given, say, file:/tmp/test.jar!/org/foo/templates/main.stg convert to file:/tmp/test.jar!/org/foo/templates
static java.lang.String trimOneStartingNewline(java.lang.String s)
           
static java.lang.String trimOneTrailingNewline(java.lang.String s)
           
static boolean urlExists(java.net.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 java.lang.String newline
Constructor Detail

Misc

public Misc()
Method Detail

join

public static java.lang.String join(java.util.Iterator iter,
                                    java.lang.String separator)

strip

public static java.lang.String strip(java.lang.String s,
                                     int n)

trimOneStartingNewline

public static java.lang.String trimOneStartingNewline(java.lang.String s)

trimOneTrailingNewline

public static java.lang.String trimOneTrailingNewline(java.lang.String s)

stripLastPathElement

public static java.lang.String stripLastPathElement(java.lang.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 java.lang.String getFileNameNoSuffix(java.lang.String f)

getFileName

public static java.lang.String getFileName(java.lang.String fullFileName)

getPrefix

public static java.lang.String getPrefix(java.lang.String name)

replaceEscapes

public static java.lang.String replaceEscapes(java.lang.String s)

urlExists

public static boolean urlExists(java.net.URL url)

getLineCharPosition

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


accessField

public static java.lang.Object accessField(java.lang.reflect.Field f,
                                           java.lang.Object o,
                                           java.lang.Object value)
                                    throws java.lang.IllegalAccessException
Throws:
java.lang.IllegalAccessException

invokeMethod

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

getMethod

public static java.lang.reflect.Method getMethod(java.lang.Class c,
                                                 java.lang.String methodName)


Copyright © 2011. All Rights Reserved.