net.sourceforge.jaulp.file
Class GeneratorUtils

java.lang.Object
  extended by net.sourceforge.jaulp.file.GeneratorUtils

public class GeneratorUtils
extends java.lang.Object

The Class GeneratorUtils.


Constructor Summary
GeneratorUtils()
           
 
Method Summary
static java.util.List<java.lang.String> createConstantsFromStringList(java.util.List<java.lang.String> data, java.lang.String prefix, java.lang.String suffix, boolean withQuotation)
          Creates a String list with the String constants from the given String list.
static java.lang.String createStaticArrayVariable(java.lang.String arrayName, java.util.List<java.lang.String> data)
          Creates a String for a constant Stringarray to be inserted in java-file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GeneratorUtils

public GeneratorUtils()
Method Detail

createStaticArrayVariable

public static java.lang.String createStaticArrayVariable(java.lang.String arrayName,
                                                         java.util.List<java.lang.String> data)
Creates a String for a constant Stringarray to be inserted in java-file. For instance: List data = new ArrayList(); data.add("foo"); data.add("bar"); createStaticArrayVariable("test", data); Resultstring:"public static final String [] TEST = { "foo", "bar"};"

Parameters:
arrayName - The name from the array.
data - The data what to insert in the generated array.
Returns:
The result.

createConstantsFromStringList

public static java.util.List<java.lang.String> createConstantsFromStringList(java.util.List<java.lang.String> data,
                                                                             java.lang.String prefix,
                                                                             java.lang.String suffix,
                                                                             boolean withQuotation)
Creates a String list with the String constants from the given String list. For instance: List data = new ArrayList(); data.add("foo"); data.add("bar"); createConstantsFromStringList(data, false); Result from list:["public static final String FOO = "foo";", "public static final String BAR = "bar";"]

Parameters:
data - The data from what to create the contant strings.
prefix - If the constant name needs a prefix.
suffix - If the constant name needs a suffix.
withQuotation - If the strings in the list have already quotation marks then true.
Returns:
A list with constants strings.


Copyright © 2010. All Rights Reserved.