Class JavaClassWriter

java.lang.Object
games.stendhal.tools.rpclassdumper.JavaClassWriter

public class JavaClassWriter extends Object
writes a class definition to a new java file
Author:
hendrik
  • Constructor Details

    • JavaClassWriter

      public JavaClassWriter(String outputFolder, String className) throws FileNotFoundException
      creates a new JavaClassWriter
      Parameters:
      outputFolder - the folder to write the java file to
      className - the name of the class
      Throws:
      FileNotFoundException - in case the folder does not exist, or the class name contains dangerous characters.
  • Method Details

    • close

      public void close()
      closes the written file.
    • writeClassDefinition

      public void writeClassDefinition(String parent)
      writes the class definition
      Parameters:
      parent - optional parent class
    • writeEndOfClass

      public void writeEndOfClass()
      writes the closing of the class definition
    • writeAttribute

      public void writeAttribute(String visibility, boolean staticFlag, String type, String name)
      writes an attribute
      Parameters:
      visibility - visibility of the attribute
      staticFlag - static?
      type - datatype
      name - name