类 ImportOrderer

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

public final class ImportOrderer extends Object
Orders imports in Java source code.
  • 方法详细资料

    • 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.
      抛出:
      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
      已过时。
      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.
      抛出:
      com.palantir.javaformat.java.FormatterException - if the input could not be parsed.