test_class.file: flatworm-core/src/test/java/com/blackbear/flatworm/UtilTest.java
test_class.identifier: UtilTest
test_case.body: @Test
      public void testMultiplePadCharacters() {
          Map<String, ConversionOptionBO> options = new HashMap<>();
          options.put("pad-character", new ConversionOptionBO("pad-character", "0Oo"));
          assertEquals("f", Util.justify("foo", "both", options, 0));
          assertEquals("f", Util.justify("fooOO00", "both", options, 0));
          assertEquals("f", Util.justify("oofoo", "both", options, 0));
          assertEquals("f", Util.justify("oo00OOfooOO00", "both", options, 0));
          assertEquals("oof", Util.justify("oofoo", "left", options, 0));
          assertEquals("foo", Util.justify("oofoo", "right", options, 0));
      }
test_case.class_method_signature: UtilTest.testMultiplePadCharacters()
test_case.full_signature: @Test public void testMultiplePadCharacters()
test_case.identifier: testMultiplePadCharacters
test_case.invocations: put assertEquals justify assertEquals justify assertEquals justify assertEquals justify assertEquals justify assertEquals justify
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testMultiplePadCharacters()
focal_class.declarator: numbersOnly = Pattern.compile("[\\D]+")
focal_class.modifier: private static
focal_class.original_string: private static Pattern numbersOnly = Pattern.compile("[\\D]+");
focal_class.type: Pattern
focal_class.var_name: numbersOnly
focal_class.declarator: lettersOnly = Pattern.compile("[^A-Za-z]+")
focal_class.modifier: private static
focal_class.original_string: private static Pattern lettersOnly = Pattern.compile("[^A-Za-z]+");
focal_class.type: Pattern
focal_class.var_name: lettersOnly
focal_class.declarator: numbersOrLettersOnly = Pattern.compile("[^A-Za-z0-9]+")
focal_class.modifier: private static
focal_class.original_string: private static Pattern numbersOrLettersOnly = Pattern.compile("[^A-Za-z0-9]+");
focal_class.type: Pattern
focal_class.var_name: numbersOrLettersOnly
focal_class.file: flatworm-core/src/main/java/com/blackbear/flatworm/Util.java
focal_class.identifier: Util
focal_class.class_method_signature: Util.split(String str, char chrSplit, char chrQuote)
focal_class.full_signature: public static List<LineToken> split(String str, char chrSplit, char chrQuote)
focal_class.identifier: split
focal_class.modifiers: public static
focal_class.parameters: (String str, char chrSplit, char chrQuote)
focal_class.return: List<LineToken>
focal_class.signature: List<LineToken> split(String str, char chrSplit, char chrQuote)
focal_class.class_method_signature: Util.formatDate(Date date, String defaultDateFormat,
                                      Map<String, ConversionOptionBO> options)
focal_class.full_signature: public static String formatDate(Date date, String defaultDateFormat,
                                      Map<String, ConversionOptionBO> options)
focal_class.identifier: formatDate
focal_class.modifiers: public static
focal_class.parameters: (Date date, String defaultDateFormat,
                                      Map<String, ConversionOptionBO> options)
focal_class.return: String
focal_class.signature: String formatDate(Date date, String defaultDateFormat,
                                      Map<String, ConversionOptionBO> options)
focal_class.class_method_signature: Util.justify(String str, String value, Map<String, ConversionOptionBO> options,
                                   int length)
focal_class.full_signature: public static String justify(String str, String value, Map<String, ConversionOptionBO> options,
                                   int length)
focal_class.identifier: justify
focal_class.modifiers: public static
focal_class.parameters: (String str, String value, Map<String, ConversionOptionBO> options,
                                   int length)
focal_class.return: String
focal_class.signature: String justify(String str, String value, Map<String, ConversionOptionBO> options,
                                   int length)
focal_class.class_method_signature: Util.isPadChar(char c, String strPadChar)
focal_class.full_signature: private static boolean isPadChar(char c, String strPadChar)
focal_class.identifier: isPadChar
focal_class.modifiers: private static
focal_class.parameters: (char c, String strPadChar)
focal_class.return: boolean
focal_class.signature: boolean isPadChar(char c, String strPadChar)
focal_class.class_method_signature: Util.strip(String str, String value, Map<String, ConversionOptionBO> options)
focal_class.full_signature: public static String strip(String str, String value, Map<String, ConversionOptionBO> options)
focal_class.identifier: strip
focal_class.modifiers: public static
focal_class.parameters: (String str, String value, Map<String, ConversionOptionBO> options)
focal_class.return: String
focal_class.signature: String strip(String str, String value, Map<String, ConversionOptionBO> options)
focal_class.class_method_signature: Util.substring(String str, String value, Map<String, ConversionOptionBO> options)
focal_class.full_signature: public static String substring(String str, String value, Map<String, ConversionOptionBO> options)
focal_class.identifier: substring
focal_class.modifiers: public static
focal_class.parameters: (String str, String value, Map<String, ConversionOptionBO> options)
focal_class.return: String
focal_class.signature: String substring(String str, String value, Map<String, ConversionOptionBO> options)
focal_class.class_method_signature: Util.defaultValue(String str, String value, Map<String, ConversionOptionBO> options)
focal_class.full_signature: public static String defaultValue(String str, String value, Map<String, ConversionOptionBO> options)
focal_class.identifier: defaultValue
focal_class.modifiers: public static
focal_class.parameters: (String str, String value, Map<String, ConversionOptionBO> options)
focal_class.return: String
focal_class.signature: String defaultValue(String str, String value, Map<String, ConversionOptionBO> options)
focal_class.class_method_signature: Util.getValue(Map<String, ConversionOptionBO> options, String key)
focal_class.full_signature: public static String getValue(Map<String, ConversionOptionBO> options, String key)
focal_class.identifier: getValue
focal_class.modifiers: public static
focal_class.parameters: (Map<String, ConversionOptionBO> options, String key)
focal_class.return: String
focal_class.signature: String getValue(Map<String, ConversionOptionBO> options, String key)
focal_class.class_method_signature: Util.tryParseInt(String value)
focal_class.full_signature: public static Integer tryParseInt(String value)
focal_class.identifier: tryParseInt
focal_class.modifiers: public static
focal_class.parameters: (String value)
focal_class.return: Integer
focal_class.signature: Integer tryParseInt(String value)
focal_class.class_method_signature: Util.tryParseBoolean(String value)
focal_class.full_signature: public static Boolean tryParseBoolean(String value)
focal_class.identifier: tryParseBoolean
focal_class.modifiers: public static
focal_class.parameters: (String value)
focal_class.return: Boolean
focal_class.signature: Boolean tryParseBoolean(String value)
focal_class.class_method_signature: Util.tryParseBoolean(String value, boolean defaultValue)
focal_class.full_signature: public static Boolean tryParseBoolean(String value, boolean defaultValue)
focal_class.identifier: tryParseBoolean
focal_class.modifiers: public static
focal_class.parameters: (String value, boolean defaultValue)
focal_class.return: Boolean
focal_class.signature: Boolean tryParseBoolean(String value, boolean defaultValue)
focal_class.class_method_signature: Util.getActualFieldType(Field field)
focal_class.full_signature: public static Class<?> getActualFieldType(Field field)
focal_class.identifier: getActualFieldType
focal_class.modifiers: public static
focal_class.parameters: (Field field)
focal_class.return: Class<?>
focal_class.signature: Class<?> getActualFieldType(Field field)
focal_class.class_method_signature: Util.findRecordAnnotatedClasses(Collection<String> packageNames, Class<? extends Annotation> annotationClass)
focal_class.full_signature: public static List<Class<?>> findRecordAnnotatedClasses(Collection<String> packageNames, Class<? extends Annotation> annotationClass)
focal_class.identifier: findRecordAnnotatedClasses
focal_class.modifiers: public static
focal_class.parameters: (Collection<String> packageNames, Class<? extends Annotation> annotationClass)
focal_class.return: List<Class<?>>
focal_class.signature: List<Class<?>> findRecordAnnotatedClasses(Collection<String> packageNames, Class<? extends Annotation> annotationClass)
focal_class.class_method_signature: Util.findClassesInPackage(String packageName)
focal_class.full_signature: public static List<Class<?>> findClassesInPackage(String packageName)
focal_class.identifier: findClassesInPackage
focal_class.modifiers: public static
focal_class.parameters: (String packageName)
focal_class.return: List<Class<?>>
focal_class.signature: List<Class<?>> findClassesInPackage(String packageName)
focal_class.class_method_signature: Util.findRecordAnnotatedClasses(String packageName, Class<? extends Annotation> annotationClass)
focal_class.full_signature: public static List<Class<?>> findRecordAnnotatedClasses(String packageName, Class<? extends Annotation> annotationClass)
focal_class.identifier: findRecordAnnotatedClasses
focal_class.modifiers: public static
focal_class.parameters: (String packageName, Class<? extends Annotation> annotationClass)
focal_class.return: List<Class<?>>
focal_class.signature: List<Class<?>> findRecordAnnotatedClasses(String packageName, Class<? extends Annotation> annotationClass)
focal_class.class_method_signature: Util.hasAnnotation(Class<?> clazz, List<Class<? extends Annotation>> annotationClasses)
focal_class.full_signature: protected static boolean hasAnnotation(Class<?> clazz, List<Class<? extends Annotation>> annotationClasses)
focal_class.identifier: hasAnnotation
focal_class.modifiers: protected static
focal_class.parameters: (Class<?> clazz, List<Class<? extends Annotation>> annotationClasses)
focal_class.return: boolean
focal_class.signature: boolean hasAnnotation(Class<?> clazz, List<Class<? extends Annotation>> annotationClasses)
focal_class.class_method_signature: Util.hasAnnotatedField(Class<?> clazz, List<Class<? extends Annotation>> annotationClasses)
focal_class.full_signature: protected static boolean hasAnnotatedField(Class<?> clazz, List<Class<? extends Annotation>> annotationClasses)
focal_class.identifier: hasAnnotatedField
focal_class.modifiers: protected static
focal_class.parameters: (Class<?> clazz, List<Class<? extends Annotation>> annotationClasses)
focal_class.return: boolean
focal_class.signature: boolean hasAnnotatedField(Class<?> clazz, List<Class<? extends Annotation>> annotationClasses)
focal_class.class_method_signature: Util.findSubpackages(String packageName)
focal_class.full_signature: protected static List<File> findSubpackages(String packageName)
focal_class.identifier: findSubpackages
focal_class.modifiers: protected static
focal_class.parameters: (String packageName)
focal_class.return: List<File>
focal_class.signature: List<File> findSubpackages(String packageName)
focal_class.class_method_signature: Util.findRecordAnnotatedClasses(File directory, String packageName, List<Class<?>> classes, Predicate<Class<?>> predicate)
focal_class.full_signature: public static void findRecordAnnotatedClasses(File directory, String packageName, List<Class<?>> classes, Predicate<Class<?>> predicate)
focal_class.identifier: findRecordAnnotatedClasses
focal_class.modifiers: public static
focal_class.parameters: (File directory, String packageName, List<Class<?>> classes, Predicate<Class<?>> predicate)
focal_class.return: void
focal_class.signature: void findRecordAnnotatedClasses(File directory, String packageName, List<Class<?>> classes, Predicate<Class<?>> predicate)
focal_method.body: public static String justify(String str, String value, Map<String, ConversionOptionBO> options,
                                   int length) {
  
          if (value == null) {
              value = "both";
          }
  
          boolean justifyLeft = false;
          boolean justifyRight = false;
          if (value.equalsIgnoreCase("left")) {
              justifyLeft = true;
          }
          if (value.equalsIgnoreCase("right")) {
              justifyRight = true;
          }
          if (value.equalsIgnoreCase("both")) {
              justifyLeft = true;
              justifyRight = true;
          }
  
          String strPadChar = " ";
          String arg = getValue(options, "pad-character");
          if (arg != null) {
              strPadChar = arg;
          }
  
          // if length is 0, we are removing padding, otherwise, we are adding it
          if (0 == length) {
              // Remove left justification
              if (justifyLeft) {
                  int i;
                  for (i = str.length() - 1; i > -1 && isPadChar(str.charAt(i), strPadChar); i--)
                      ;
                  if (i != str.length() - 1) {
                      str = str.substring(0, i + 1);
                  }
              }
  
              // Remove right justification
              if (justifyRight) {
                  int i;
                  for (i = 0; i < str.length() && isPadChar(str.charAt(i), strPadChar); i++)
                      ;
                  if (i != 0) {
                      str = str.substring(i, str.length());
                  }
              }
          } else {
              // pad only with first character
              strPadChar = strPadChar.substring(0, 1);
  
              if (str.length() < length) {
                  // Figure out difference in length to create padding string
                  int lenDiff = length - str.length();
  
                  String padding = "";
                  for (int i = 0; i < lenDiff; i++)
                      padding = padding + strPadChar;
  
                  if (justifyLeft) {
                      str = str + padding;
                  }
  
                  if (justifyRight) {
                      str = padding + str;
                  }
              }
          }
  
          return str;
      }
focal_method.class_method_signature: Util.justify(String str, String value, Map<String, ConversionOptionBO> options,
                                   int length)
focal_method.full_signature: public static String justify(String str, String value, Map<String, ConversionOptionBO> options,
                                   int length)
focal_method.identifier: justify
focal_method.invocations: equalsIgnoreCase equalsIgnoreCase equalsIgnoreCase getValue length isPadChar charAt length substring length isPadChar charAt substring length substring length length
focal_method.modifiers: public static
focal_method.parameters: (String str, String value, Map<String, ConversionOptionBO> options,
                                   int length)
focal_method.return: String
focal_method.signature: String justify(String str, String value, Map<String, ConversionOptionBO> options,
                                   int length)