Package org.objectweb.asm.test
Class ClassFile.Builder
- java.lang.Object
-
- org.objectweb.asm.test.ClassFile.AbstractBuilder<java.lang.Object>
-
- org.objectweb.asm.test.ClassFile.Builder
-
- All Implemented Interfaces:
java.lang.Comparable<ClassFile.Builder>
,ClassFile.ClassContext
,ClassFile.MethodContext
- Enclosing class:
- ClassFile
private static class ClassFile.Builder extends ClassFile.AbstractBuilder<java.lang.Object> implements java.lang.Comparable<ClassFile.Builder>
AnClassFile.AbstractBuilder
with concrete methods to add children.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
name
The name of this builder, for sorting inClassFile.SortedBuilder
.-
Fields inherited from class org.objectweb.asm.test.ClassFile.AbstractBuilder
children
-
-
Constructor Summary
Constructors Constructor Description Builder(java.lang.String name, ClassFile.AbstractBuilder<?> parent)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) <T> T
add(java.lang.String name, T value)
Appends name and value to children and returns value.(package private) void
addCpInfo(java.lang.String name, int cpIndex)
Appends name and the CpInfo corresponding to cpIndex to children.(package private) void
addInsn(int insnIndex, int opcode, java.lang.Object... arguments)
Appends the given arguments to children.(package private) int
addInsnIndex(java.lang.String name, int bytecodeOffset)
Appends name and the instruction index corresponding to bytecodeOffset to children, and returns bytecodeOffset.(package private) ClassFile.SortedBuilder
addSortedBuilder()
Appends a newClassFile.SortedBuilder
to children and returns it.int
compareTo(ClassFile.Builder builder)
boolean
equals(java.lang.Object other)
int
hashCode()
(package private) void
sortByContent()
Use the content of this builder, instead of its name, to sort it in a SortedBuilder.-
Methods inherited from class org.objectweb.asm.test.ClassFile.AbstractBuilder
build, getCpInfo, getCpInfo, getInsnIndex, putCpInfo, putInsnIndex
-
-
-
-
Field Detail
-
name
private java.lang.String name
The name of this builder, for sorting inClassFile.SortedBuilder
.
-
-
Constructor Detail
-
Builder
Builder(java.lang.String name, ClassFile.AbstractBuilder<?> parent)
-
-
Method Detail
-
add
<T> T add(java.lang.String name, T value)
Appends name and value to children and returns value.- Type Parameters:
T
- a value type.- Parameters:
name
- a name.value
- a value.- Returns:
- value
-
addInsnIndex
int addInsnIndex(java.lang.String name, int bytecodeOffset)
Appends name and the instruction index corresponding to bytecodeOffset to children, and returns bytecodeOffset.- Parameters:
name
- a name.bytecodeOffset
- the offset of a bytecode instruction.- Returns:
- bytecodeOffset.
-
addInsn
void addInsn(int insnIndex, int opcode, java.lang.Object... arguments)
Appends the given arguments to children.- Parameters:
insnIndex
- the index of a bytecode instruction.opcode
- a bytecode instruction opcode.arguments
- the bytecode instruction arguments.
-
addCpInfo
void addCpInfo(java.lang.String name, int cpIndex)
Appends name and the CpInfo corresponding to cpIndex to children.- Parameters:
name
- a name.cpIndex
- a constant pool item index.
-
addSortedBuilder
ClassFile.SortedBuilder addSortedBuilder()
Appends a newClassFile.SortedBuilder
to children and returns it.- Returns:
- a new
ClassFile.SortedBuilder
.
-
sortByContent
void sortByContent()
Use the content of this builder, instead of its name, to sort it in a SortedBuilder.
-
compareTo
public int compareTo(ClassFile.Builder builder)
- Specified by:
compareTo
in interfacejava.lang.Comparable<ClassFile.Builder>
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-