Package com.tonic.analysis.xref
Class Xref.Builder
- java.lang.Object
-
- com.tonic.analysis.xref.Xref.Builder
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Xrefbuild()Xref.BuilderbytecodeOffset(int offset)Sets the bytecode offset of the referencing instruction.Xref.BuilderinstructionIndex(int index)Sets the index of the referencing instruction within the method.Xref.BuilderlineNumber(int lineNumber)Sets the source line the reference was attributed to.Xref.BuildersourceClass(String sourceClass)Sets the class the reference occurs in.Xref.BuildersourceMethod(String name, String desc)Sets the method the reference occurs in.Xref.BuildertargetClass(String targetClass)Sets the referenced class.Xref.BuildertargetField(String owner, String name, String desc)Sets the target class and member from a field reference.Xref.BuildertargetMember(String name, String desc)Sets the referenced member, leaving the target class untouched.Xref.BuildertargetMethod(String owner, String name, String desc)Sets the target class and member from a method reference.Xref.Buildertype(XrefType type)Sets the kind of reference; defaults to METHOD_CALL.
-
-
-
Method Detail
-
sourceClass
public Xref.Builder sourceClass(String sourceClass)
Sets the class the reference occurs in.- Parameters:
sourceClass- the referencing class- Returns:
- this builder
-
sourceMethod
public Xref.Builder sourceMethod(String name, String desc)
Sets the method the reference occurs in.- Parameters:
name- the method namedesc- the method descriptor- Returns:
- this builder
-
lineNumber
public Xref.Builder lineNumber(int lineNumber)
Sets the source line the reference was attributed to.- Parameters:
lineNumber- the line number, or -1 if unknown- Returns:
- this builder
-
instructionIndex
public Xref.Builder instructionIndex(int index)
Sets the index of the referencing instruction within the method.- Parameters:
index- the instruction index, or -1 if unknown- Returns:
- this builder
-
bytecodeOffset
public Xref.Builder bytecodeOffset(int offset)
Sets the bytecode offset of the referencing instruction.- Parameters:
offset- the offset, or -1 if unknown- Returns:
- this builder
-
targetClass
public Xref.Builder targetClass(String targetClass)
Sets the referenced class.- Parameters:
targetClass- the class being referenced- Returns:
- this builder
-
targetMember
public Xref.Builder targetMember(String name, String desc)
Sets the referenced member, leaving the target class untouched.- Parameters:
name- the member namedesc- the member descriptor- Returns:
- this builder
-
targetMethod
public Xref.Builder targetMethod(String owner, String name, String desc)
Sets the target class and member from a method reference.- Parameters:
owner- the declaring classname- the method namedesc- the method descriptor- Returns:
- this builder
-
targetField
public Xref.Builder targetField(String owner, String name, String desc)
Sets the target class and member from a field reference.- Parameters:
owner- the declaring classname- the field namedesc- the field descriptor- Returns:
- this builder
-
type
public Xref.Builder type(XrefType type)
Sets the kind of reference; defaults to METHOD_CALL.- Parameters:
type- the reference kind- Returns:
- this builder
-
build
public Xref build()
- Returns:
- an immutable cross-reference holding the accumulated values
-
-