-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from win32kbase/master
Create a base dynamic class and make constant pool dynamic entries extend it
- Loading branch information
Showing
4 changed files
with
64 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
src/main/java/me/coley/cafedude/classfile/constant/ConstDynamic.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
package me.coley.cafedude.classfile.constant; | ||
|
||
/** | ||
* Base dynamic value pool entry. Points to a {@link CpNameType NameType} constant | ||
* and a bootstrap method index in the class's bootstrap-methods attribute. | ||
* | ||
* @author Matt Coley | ||
* @author Wolfie / win32kbase | ||
*/ | ||
public abstract class ConstDynamic extends ConstPoolEntry { | ||
private int bsmIndex; | ||
private int nameTypeIndex; | ||
|
||
/** | ||
* @param type | ||
* Dynamic pool entry type. | ||
* @param bsmIndex | ||
* Index in the class's bootstrap method attribute-table. | ||
* @param nameTypeIndex | ||
* Index of {@link CpNameType} in pool. | ||
*/ | ||
public ConstDynamic(int type, int bsmIndex, int nameTypeIndex) { | ||
super(type); | ||
this.bsmIndex = bsmIndex; | ||
this.nameTypeIndex = nameTypeIndex; | ||
} | ||
|
||
/** | ||
* @return Index in the class's bootstrap method attribute-table. | ||
*/ | ||
public int getBsmIndex() { | ||
return bsmIndex; | ||
} | ||
|
||
/** | ||
* @param bsmIndex | ||
* New index in the class's bootstrap method attribute-table. | ||
*/ | ||
public void setBsmIndex(int bsmIndex) { | ||
this.bsmIndex = bsmIndex; | ||
} | ||
|
||
/** | ||
* @return Index of {@link CpNameType} in pool. | ||
*/ | ||
public int getNameTypeIndex() { | ||
return nameTypeIndex; | ||
} | ||
|
||
/** | ||
* @param nameTypeIndex | ||
* New index of {@link CpNameType} in pool. | ||
*/ | ||
public void setNameTypeIndex(int nameTypeIndex) { | ||
this.nameTypeIndex = nameTypeIndex; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters