Class UimaDecompiler

java.lang.Object
org.apache.uima.migratev3.jcas.UimaDecompiler

public class UimaDecompiler extends Object
Decompiler - for testing - for locating customizations Operation: Make an instance, optionally setting - class loader to use (may pass byte array instead) - directory where to write output (may output to string instead) - class loader to use when resolving symbols during decompile call decompile - argument - class name (without .class or .java suffix, fully qualified) or - byte array - return value is a byte array output stream with UTF-8 encoded value decompileToFile - writes decompiled output to a xxx.java file in output directory Not thread safe
  • Constructor Details

    • UimaDecompiler

      public UimaDecompiler()
    • UimaDecompiler

      public UimaDecompiler(ClassLoader classLoader, File outputDirectory)
  • Method Details

    • decompile

      public ByteArrayOutputStream decompile(String className)
      decompile className, getting the compiled version from the classpath
      Parameters:
      className - the dotted name of the class
      Returns:
      the decompilation
    • decompileCommon

      public ByteArrayOutputStream decompileCommon(String className)
      Common part for decompiling to a ByteArrayOutputStream the decompiler settings are set up to get the compiled form by name
      Parameters:
      className - the class to decompile
      Returns:
      the decompilation
    • decompileToString

      public String decompileToString(String className)
      decompile className, getting the compiled version from the classpath
      Parameters:
      className - the dotted or slashified name of the class
      Returns:
      the decompilation
    • decompileToString

      public String decompileToString(String className, byte[] byteArray)
    • decompile

      public String decompile(byte[] b)
      Decompile from the file system, maybe in a Jar. This is a 2 pass operation, usually, to get the classname from the decompilation, and then redo the decompilation with that extra bit of configuration.
      Parameters:
      b - the byte array representing the compiled file
      Returns:
      the decompiled form as a string
    • decompileToOutputDirectory

      public boolean decompileToOutputDirectory(String className)
    • writeIfOk

      public boolean writeIfOk(ByteArrayOutputStream baos, String className)
    • decompiledFailed

      public boolean decompiledFailed(ByteArrayOutputStream baos)