public final class ConstantPackage extends Constant implements ConstantObject
Constant
and represents a reference to a package.
Note: Early access Java 9 support- currently subject to change
Constant
Constructor and Description |
---|
ConstantPackage(ConstantPackage c)
Initialize from another object.
|
ConstantPackage(int name_index) |
Modifier and Type | Method and Description |
---|---|
void |
accept(Visitor v)
Called by objects that are traversing the nodes of the tree implicitely
defined by the contents of a Java class.
|
void |
dump(DataOutputStream file)
Dump constant package to file stream in binary format.
|
String |
getBytes(ConstantPool cp) |
Object |
getConstantValue(ConstantPool cp) |
int |
getNameIndex() |
void |
setNameIndex(int name_index) |
String |
toString() |
clone, copy, equals, getComparator, getTag, hashCode, readConstant, setComparator
public ConstantPackage(ConstantPackage c)
public ConstantPackage(int name_index)
name_index
- Name index in constant pool. Should refer to a
ConstantUtf8.public void accept(Visitor v)
public final void dump(DataOutputStream file) throws IOException
dump
in class Constant
file
- Output file streamIOException
public final int getNameIndex()
public final void setNameIndex(int name_index)
name_index
- the name index in the constant pool of this Constant Packagepublic Object getConstantValue(ConstantPool cp)
getConstantValue
in interface ConstantObject
public String getBytes(ConstantPool cp)
Copyright © 2004–2022 The Apache Software Foundation. All rights reserved.