org.brains2b.typewriter
Class TypeWriterHelper

java.lang.Object
  extended byorg.brains2b.typewriter.TypeWriterHelper

public class TypeWriterHelper
extends java.lang.Object

Helper library for TypeWriter

Version:
[version] [lastrevisiondate]
Author:
dennis@brains2b.nl

Constructor Summary
TypeWriterHelper()
           
 
Method Summary
static java.lang.String getClassName(java.lang.Class c)
          get the name without the package from the class
static java.lang.String getClassName(java.lang.String s)
          get the name without the package from the String representing a class
static java.lang.String getModifiers(int modifiers)
          get a String representation for the sum of modifiers as defined in java.lang.reflect.Modifier supports: private public protected final static
static java.lang.String makeString(java.lang.String value)
          make a String between quotes from the supplied String
static java.lang.String spaces(int length)
          create a String of length length filled with spaces There is a faster way to do this, by using a static char array to read from, but it is only slightly faster and consumes extra memory and more lines of code
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TypeWriterHelper

public TypeWriterHelper()
Method Detail

getClassName

public static final java.lang.String getClassName(java.lang.Class c)
get the name without the package from the class

Parameters:
c - Class, the class for which to retrieve the name
Returns:
String, the name only, returns null if class is null

getClassName

public static final java.lang.String getClassName(java.lang.String s)
get the name without the package from the String representing a class

Parameters:
s - String, the String representing a class for which to retrieve the name. If no package is supplied the return value is same as the value offered
Returns:
String, the name only, returns null if String is null, or String is empty

getModifiers

public static java.lang.String getModifiers(int modifiers)
get a String representation for the sum of modifiers as defined in java.lang.reflect.Modifier

Parameters:
modifiers - int, sum of Modifier values from java.lang.reflect.Modifier
Returns:
String, the valid Java representation of the modifiers

makeString

public static java.lang.String makeString(java.lang.String value)
make a String between quotes from the supplied String

Parameters:
value - String, the value to make a String for
Returns:
String, the value between quotes, will return null if the value is null or empty

spaces

public static final java.lang.String spaces(int length)
create a String of length length filled with spaces

There is a faster way to do this, by using a static char array to read from, but it is only slightly faster and consumes extra memory and more lines of code

Parameters:
length - int, the length of the String of spaces
Returns:
String, a String of spaces