Class BytecodeRepresentation


  • public final class BytecodeRepresentation
    extends Object
    Intermediate representation of class files from bytecode.

    This class provides a unified interface for working with Java bytecode. It can read bytecode from various sources (files, byte arrays, input streams) and convert it to XMIR (EO XML representation) format with configurable detail levels.

    Since:
    0.1.0
    • Constructor Detail

      • BytecodeRepresentation

        public BytecodeRepresentation​(Path clazz)
        Constructor.
        Parameters:
        clazz - The path to the class file to read
      • BytecodeRepresentation

        public BytecodeRepresentation​(Bytecode bytecode)
        Constructor.
        Parameters:
        bytecode - The bytecode object containing raw bytes
      • BytecodeRepresentation

        public BytecodeRepresentation​(org.cactoos.Input input)
        Constructor.
        Parameters:
        input - The input source containing bytecode
    • Method Detail

      • name

        public String name()
        Read class name from bytecode.
        Returns:
        Fully qualified class name
      • toXmir

        public com.jcabi.xml.XML toXmir()
        Convert to EOlang XML representation (XMIR).
        Returns:
        XML representation of the bytecode
      • toEO

        public String toEO​(DisassembleParams params)
        Convert bytecode into XMIR format.
        Parameters:
        params - The disassemble params controlling the level of detail
        Returns:
        XMIR representation of the bytecode