ImportHandler added

git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@594 379699f6-c40d-0410-875b-85095c16579e
stable
jochen 26 years ago
parent 1bc6e91a59
commit fad685bf51
  1. 23
      jode/jode/decompiler/TabbedPrintWriter.java

@ -20,6 +20,7 @@
package jode.decompiler;
import java.io.*;
import jode.Decompiler;
import jode.type.Type;
public class TabbedPrintWriter {
boolean atbol;
@ -27,19 +28,30 @@ public class TabbedPrintWriter {
int currentIndent = 0;
String indentStr = "";
PrintWriter pw;
ImportHandler imports;
public TabbedPrintWriter (OutputStream os) {
public TabbedPrintWriter (OutputStream os, ImportHandler imports) {
pw = new PrintWriter(os, true);
this.imports = imports;
this.indentsize = (Decompiler.outputStyle & Decompiler.TAB_SIZE_MASK);
atbol = true;
}
public TabbedPrintWriter (Writer os) {
public TabbedPrintWriter (Writer os, ImportHandler imports) {
pw = new PrintWriter(os, true);
this.imports = imports;
this.indentsize = (Decompiler.outputStyle & Decompiler.TAB_SIZE_MASK);
atbol = true;
}
public TabbedPrintWriter (OutputStream os) {
this(os, null);
}
public TabbedPrintWriter (Writer os) {
this(os, null);
}
/**
* Convert the numeric indentation to a string.
*/
@ -101,6 +113,13 @@ public class TabbedPrintWriter {
atbol = false;
}
public void printType(Type type) {
if (imports != null)
print(imports.getTypeString(type));
else
print(type.toString());
}
/**
* Print a opening brace with the current indentation style.
* Called at the end of the line of the instance that opens the

Loading…
Cancel
Save