ppt4j 1.0
 
Loading...
Searching...
No Matches
ppt4j.feature.bytecode.BytecodeExtractor Class Reference
Inheritance diagram for ppt4j.feature.bytecode.BytecodeExtractor:
ppt4j.feature.Extractor

Public Member Functions

 BytecodeExtractor ( @NonNull InputStream inputStream) throws IOException
 
 BytecodeExtractor (@NonNull String classFile) throws IOException
 
 BytecodeExtractor (@NonNull ClassReader classReader)
 
void parse ()
 
void putInnerClass (@NonNull BytecodeExtractor ex)
 
BytecodeExtractor getInnerClass (@NonNull String className)
 
Features.SourceType getSourceType ()
 
void print ()
 
- Public Member Functions inherited from ppt4j.feature.Extractor
default void print (int line)
 
Map< Integer, FeaturesgetFeaturesMap ()
 
String getClassName ()
 

Static Public Member Functions

static BytecodeExtractor nil ()
 

Constructor & Destructor Documentation

◆ BytecodeExtractor() [1/3]

ppt4j.feature.bytecode.BytecodeExtractor.BytecodeExtractor ( @NonNull InputStream inputStream) throws IOException

◆ BytecodeExtractor() [2/3]

ppt4j.feature.bytecode.BytecodeExtractor.BytecodeExtractor ( @NonNull String classFile) throws IOException

◆ BytecodeExtractor() [3/3]

ppt4j.feature.bytecode.BytecodeExtractor.BytecodeExtractor ( @NonNull ClassReader classReader)

Member Function Documentation

◆ getInnerClass()

BytecodeExtractor ppt4j.feature.bytecode.BytecodeExtractor.getInnerClass ( @NonNull String className)

Retrieves the BytecodeExtractor for the specified inner class by its class name.

Parameters
classNamethe name of the inner class to retrieve
Returns
the BytecodeExtractor for the specified inner class, or null if not found

◆ getSourceType()

Features.SourceType ppt4j.feature.bytecode.BytecodeExtractor.getSourceType ( )

This method returns the source type of the features, which is determined to be bytecode.

Returns
The source type of the features, which is bytecode.

Implements ppt4j.feature.Extractor.

◆ nil()

static BytecodeExtractor ppt4j.feature.bytecode.BytecodeExtractor.nil ( )
static

This method creates and returns a new instance of BytecodeExtractor object with default values.

Returns
a new instance of BytecodeExtractor object

◆ parse()

void ppt4j.feature.bytecode.BytecodeExtractor.parse ( )

Parses the methods of the class by analyzing their bytecode instructions. Skips native or abstract methods, methods without line number info, and <clinit> methods. Performs ArgTypeAnalysis, LoopAnalysis, and clustering of instructions for each method. Generates features for each instruction and removes RETURN instructions if present in <clinit> method. Sets isParsed flag to true after parsing is complete.

Implements ppt4j.feature.Extractor.

◆ print()

void ppt4j.feature.bytecode.BytecodeExtractor.print ( )

Prints the features map and recursively prints the inner classes of the extractor. If the root is null, it prints "nil extractor".

Implements ppt4j.feature.Extractor.

◆ putInnerClass()

void ppt4j.feature.bytecode.BytecodeExtractor.putInnerClass ( @NonNull BytecodeExtractor ex)

This method takes a BytecodeExtractor object, parses it, and then stores it in a map called innerClasses with the class name as the key.

Parameters
exthe BytecodeExtractor object to be stored in the innerClasses map

The documentation for this class was generated from the following file: