Package org.hybridlabs.source.beautifier

Examples of org.hybridlabs.source.beautifier.JavaImportBeautifierImpl.beautify()


      CharacterSequence sequence = new CharacterSequence(
          FileHelper.loadStringBuffer(sourceFile));
      String original = sequence.getString();

      try {
        beautifier.beautify(sequence);
        // Only overwrite the file if the beautifier changes it, or if a
        // different directory
        // Sometimes Jalopy throws an error and returns a zero length
        // file.
        if (sequence.length() > 1
View Full Code Here


    CharacterSequence sequence = new CharacterSequence(
        FileHelper.loadStringBuffer(sourceFile));

    try {
      beautifier.beautify(sequence);
      // Only overwrite the file if the beautifier changes it, or if a
      // different directory
      // Sometimes Jalopy throws an error and returns a zero length file.
      if (sequence.length() > 1) {
        File targetFile = null;
View Full Code Here

        JavaImportBeautifierImpl beautifier = new JavaImportBeautifierImpl();
        beautifier.setFormat(true);
        beautifier.setOrganizeImports(true);

        CharacterSequence sequence = new CharacterSequence(loadTestFile("Documentation_Sample1.java_input"));
        beautifier.beautify(sequence);

        CharacterSequence expectedOutput = new CharacterSequence(loadTestFile("Documentation_Sample1.java_output"));
        compare(expectedOutput, sequence);

    }
View Full Code Here

        String[] fileList = fileSet.getDirectoryScanner(getProject()).getIncludedFiles();

        for (int i = 0; i < fileList.length; i++) {
            File file = new File(fileSet.getDir(getProject()).getAbsolutePath() + "/" + fileList[i]);
            try {
                beautifier.beautify(file, debugMode ? new File(file.getAbsoluteFile()+"_debug") : null);
            } catch (FileNotFoundException e) {
                throw new BuildException(e.getMessage(), e);
            } catch (IOException e) {
                throw new BuildException(e.getMessage(), e);
            }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.