ClassWriter
. Exposes methods to encode and write javac entities
into the constant pool.
This is NOT part of any supported API. If you write code that depends on this, you do so at your own risk. This code and its internal interfaces are subject to change or deletion without notice.
Modifier and Type | Class and Description |
---|---|
pack-priv class | PoolWriter.
Signature Generation |
pack-priv class |
Modifier and Type | Field and Description |
---|---|
pack-priv Map | bootstrapMethods
The list of entries in the BootstrapMethods attribute. |
pack-priv LinkedHashSet | innerClasses
The inner classes to be written, as an ordered set (enclosing first). |
public static final int | MAX_ENTRIES
Max number of constant pool entries. |
public static final int | MAX_STRING_LENGTH
Max number of char in a string constant. |
private final Names | |
pack-priv final PoolWriter. | pool
Pool helper |
private static final int | |
pack-priv final PoolWriter. | signatureGen
Sole signature generator |
private final Types |
Access | Constructor and Description |
---|---|
public |
Modifier and Type | Method and Description |
---|---|
private Name | |
private Type | descriptorType(Symbol s)
Create a new Utf8 entry representing a descriptor for given (member) symbol. |
pack-priv void | |
private int | |
pack-priv int | |
pack-priv int | |
pack-priv int | |
pack-priv int | |
pack-priv int | |
pack-priv int | putDescriptor(Symbol s)
Puts a field or method descriptor into the constant pool and return its index. |
pack-priv int | putDynamic(PoolConstant.
Puts a dynamic reference into the constant pool and return its index. |
pack-priv int | |
pack-priv int | |
pack-priv int | |
pack-priv int | |
pack-priv int | |
pack-priv int | putSignature(Symbol s)
Puts a signature (see |
pack-priv void | |
pack-priv int | |
private Name | |
pack-priv void |
bootstrapMethods | back to summary |
---|---|
pack-priv Map<PoolConstant. The list of entries in the BootstrapMethods attribute. |
innerClasses | back to summary |
---|---|
pack-priv LinkedHashSet<Symbol. The inner classes to be written, as an ordered set (enclosing first). |
MAX_ENTRIES | back to summary |
---|---|
public static final int MAX_ENTRIES Max number of constant pool entries. |
MAX_STRING_LENGTH | back to summary |
---|---|
public static final int MAX_STRING_LENGTH Max number of char in a string constant. |
names | back to summary |
---|---|
private final Names names |
pool | back to summary |
---|---|
pack-priv final PoolWriter. Pool helper |
POOL_BUF_SIZE | back to summary |
---|---|
private static final int POOL_BUF_SIZE |
signatureGen | back to summary |
---|---|
pack-priv final PoolWriter. Sole signature generator |
types | back to summary |
---|---|
private final Types types |
PoolWriter | back to summary |
---|---|
public PoolWriter(Types types, Names names) |
classSig | back to summary |
---|---|
private Name classSig(Type t) |
descriptorType | back to summary |
---|---|
private Type descriptorType(Symbol s) Create a new Utf8 entry representing a descriptor for given (member) symbol. |
enterInner | back to summary |
---|---|
pack-priv void enterInner(Symbol. Enter an inner class into the `innerClasses' set. |
makeBootstrapEntry | back to summary |
---|---|
private int makeBootstrapEntry(PoolConstant. |
putClass | back to summary |
---|---|
pack-priv int putClass(Symbol. Puts a class symbol into the pool and return its index. |
putClass | back to summary |
---|---|
pack-priv int putClass(Type t) Puts a type into the pool and return its index. The type could be either a class, a type variable or an array type. |
putConstant | back to summary |
---|---|
pack-priv int putConstant(Object o) Puts a constant value into the pool and return its index. Supported values are int, float, long, double and String. |
putConstant | back to summary |
---|---|
pack-priv int putConstant(PoolConstant. Puts a constant into the pool and return its index. |
putDescriptor | back to summary |
---|---|
pack-priv int putDescriptor(Type t) Puts a field or method descriptor into the constant pool and return its index. |
putDescriptor | back to summary |
---|---|
pack-priv int putDescriptor(Symbol s) Puts a field or method descriptor into the constant pool and return its index. |
putDynamic | back to summary |
---|---|
pack-priv int putDynamic(PoolConstant. Puts a dynamic reference into the constant pool and return its index. |
putMember | back to summary |
---|---|
pack-priv int putMember(Symbol s) Puts a member reference into the constant pool. Valid members are either field or method symbols. |
putModule | back to summary |
---|---|
pack-priv int putModule(Symbol. Puts a module entry into the pool and returns its index. |
putName | back to summary |
---|---|
pack-priv int putName(Name name) |
putNameAndType | back to summary |
---|---|
pack-priv int putNameAndType(Symbol s) Puts a name and type pair into the pool and returns its index. |
putPackage | back to summary |
---|---|
pack-priv int putPackage(Symbol. Puts a package entry into the pool and returns its index. |
putSignature | back to summary |
---|---|
pack-priv int putSignature(Symbol s) Puts a signature (see |
reset | back to summary |
---|---|
pack-priv void reset() |
size | back to summary |
---|---|
pack-priv int size() |
typeSig | back to summary |
---|---|
private Name typeSig(Type type) Return signature of given type |
writePool | back to summary |
---|---|
pack-priv void writePool(OutputStream out) throws IOException, PoolOverflow Write pool contents into given byte buffer. |
Modifier and Type | Field and Description |
---|---|
pack-priv int | |
private final Map | keysToPos
Pool entries. |
pack-priv String | |
pack-priv final ByteBuffer | |
pack-priv ArrayDeque |
Access | Constructor and Description |
---|---|
pack-priv |
Modifier and Type | Method and Description |
---|---|
pack-priv void | |
pack-priv void | |
private <P extends PoolConstant> int |
currentIndex | back to summary |
---|---|
pack-priv int currentIndex |
keysToPos | back to summary |
---|---|
private final Map<Object, Integer> keysToPos Pool entries. |
overflowString | back to summary |
---|---|
pack-priv String overflowString |
poolbuf | back to summary |
---|---|
pack-priv final ByteBuffer poolbuf |
todo | back to summary |
---|---|
pack-priv ArrayDeque<PoolConstant> todo |
WriteablePoolHelper | back to summary |
---|---|
pack-priv WriteablePoolHelper() |
reset | back to summary |
---|---|
pack-priv void reset() |
writeConstant | back to summary |
---|---|
pack-priv void writeConstant(PoolConstant c) |
writeIfNeeded | back to summary |
---|---|
private <P extends PoolConstant> int writeIfNeeded(P p) |