Package org.openjdk.asmtools.jasm
Class SourceFileAttr
java.lang.Object
org.openjdk.asmtools.jasm.AttrData
org.openjdk.asmtools.jasm.SourceFileAttr
- All Implemented Interfaces:
ConstantPoolDataVisitor
,DataWriter
SourceFile_attribute {
u2 attribute_name_index;
u4 attribute_length;
u2 sourcefile_index;
}
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionSourceFileAttr
(ConstantPool pool, String sourceFileName) Constructs SourceFile Attribute without creating Constant Pool UTF8 SourceFileSourceFileAttr
(ConstantPool pool, ConstCell sourceFileNameCell) Constructs SourceFile Attribute without creating Constant Pool UTF8 SourceFile -
Method Summary
Modifier and TypeMethodDescriptionint
updateIfFound
(ConstantPool pool, Function<String, Boolean> rule) Finds CP UTF cell with string that applies to the rule.void
Methods inherited from class org.openjdk.asmtools.jasm.AttrData
classifyConstCell, getLength, visit
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.openjdk.asmtools.jasm.ConstantPoolDataVisitor
visitConstCell, visitData
-
Field Details
-
sourceFileName
-
sourceFileNameCell
-
-
Constructor Details
-
SourceFileAttr
Constructs SourceFile Attribute without creating Constant Pool UTF8 SourceFile- Parameters:
pool
- constant pool of parsed class datasourceFileName
- a name of a parsed file
-
SourceFileAttr
Constructs SourceFile Attribute without creating Constant Pool UTF8 SourceFile- Parameters:
pool
- constant pool of parsed class datasourceFileNameCell
- ConstantPool UTF8 cell
-
-
Method Details
-
updateIfFound
Finds CP UTF cell with string that applies to the rule. If such UTF8 string exists then replaces it with a new source file name otherwise creates a new UTF8 cell to fill out Source File Attribute -
attrLength
public int attrLength()- Overrides:
attrLength
in classAttrData
-
write
- Specified by:
write
in interfaceDataWriter
- Overrides:
write
in classAttrData
- Throws:
IOException
-