org.apache.uima.cas.impl

## Class UimaDecompiler

- java.lang.Object
- - org.apache.uima.cas.impl.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 Summary

    Constructors
    Constructor and Description
    `UimaDecompiler()`
    `UimaDecompiler(ClassLoader classLoader, File outputDirectory)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `decompile(byte[] b)` Decompile from the file system, maybe in a Jar.
    `ByteArrayOutputStream` | `decompile(String className)` decompile className, getting the compiled version from the classpath
    `ByteArrayOutputStream` | `decompileCommon(String className)` Common part for decompiling to a ByteArrayOutputStream the decompiler settings are set up to get the compiled form by name
    `boolean` | `decompiledFailed(ByteArrayOutputStream baos)`
    `boolean` | `decompileToOutputDirectory(String className)`
    `String` | `decompileToString(String className)` decompile className, getting the compiled version from the classpath
    `String` | `decompileToString(String className, byte[] byteArray)`
    `boolean` | `writeIfOk(ByteArrayOutputStream baos, String className)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### UimaDecompiler

          public UimaDecompiler()

    - #### UimaDecompiler

          public UimaDecompiler(ClassLoader classLoader,
                                File outputDirectory)

  - ### Method Detail

    - #### 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)

Copyright © 2006–2022 The Apache Software Foundation. All rights reserved.