Class ImportOrderer

java.lang.Object
com.palantir.javaformat.java.ImportOrderer

public final class ImportOrderer extends Object
Orders imports in Java source code.
  • Method Details

    • reorderImports

      public static String reorderImports(String text, com.palantir.javaformat.java.JavaFormatterOptions.Style style) throws com.palantir.javaformat.java.FormatterException
      Reorder the inputs in text, a complete Java program. On success, another complete Java program is returned, which is the same as the original except the imports are in order.
      Throws:
      com.palantir.javaformat.java.FormatterException - if the input could not be parsed.
    • reorderImports

      @Deprecated public static String reorderImports(String text) throws com.palantir.javaformat.java.FormatterException
      Deprecated.
      Reorder the inputs in text, a complete Java program, in Google style. On success, another complete Java program is returned, which is the same as the original except the imports are in order.
      Throws:
      com.palantir.javaformat.java.FormatterException - if the input could not be parsed.