Class GeneratorExtensions


  • public final class GeneratorExtensions
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.util.List<java.lang.String> newConstantsFromStringList​(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 newStaticArrayVariable​(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
    • Method Detail

      • newConstantsFromStringList

        public static java.util.List<java.lang.String> newConstantsFromStringList​(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"); newConstantsFromStringList(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.
      • newStaticArrayVariable

        public static java.lang.String newStaticArrayVariable​(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"); newcreateStaticArrayVariable("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.