public final class ConstantUtf8 extends Constant
Constant
to represent a reference to a UTF-8 encoded string.
The following system properties govern caching this class performs.
Here is a sample Maven invocation with caching disabled:
mvn test -Dbcel.statistics=true -Dbcel.maxcached.size=0 -Dbcel.maxcached=0
Here is a sample Maven invocation with caching enabled:
mvn test -Dbcel.statistics=true -Dbcel.maxcached.size=100000 -Dbcel.maxcached=5000000
Constant
Constructor and Description |
---|
ConstantUtf8(ConstantUtf8 constantUtf8)
Initializes from another object.
|
ConstantUtf8(String value) |
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.
|
static void |
clearCache()
Clears the cache.
|
void |
dump(DataOutputStream file)
Dumps String in Utf8 format to file stream.
|
String |
getBytes() |
static ConstantUtf8 |
getCachedInstance(String value)
Gets a new or cached instance of the given value.
|
static ConstantUtf8 |
getInstance(DataInput dataInput)
Gets a new or cached instance of the given value.
|
static ConstantUtf8 |
getInstance(String value)
Gets a new or cached instance of the given value.
|
void |
setBytes(String bytes)
Deprecated.
(since 6.0)
|
String |
toString() |
clone, copy, equals, getComparator, getTag, hashCode, readConstant, setComparator
public ConstantUtf8(ConstantUtf8 constantUtf8)
constantUtf8
- the value.public ConstantUtf8(String value)
value
- Datapublic static void clearCache()
public static ConstantUtf8 getCachedInstance(String value)
See ConstantUtf8
class Javadoc for details.
value
- the value.public static ConstantUtf8 getInstance(DataInput dataInput) throws IOException
See ConstantUtf8
class Javadoc for details.
dataInput
- the value.IOException
- if an I/O error occurs.public static ConstantUtf8 getInstance(String value)
See ConstantUtf8
class Javadoc for details.
value
- the value.public void accept(Visitor v)
public void dump(DataOutputStream file) throws IOException
dump
in class Constant
file
- Output file streamIOException
public String getBytes()
@Deprecated public void setBytes(String bytes)
bytes
- the raw bytes of this UTF-8Copyright © 2004–2019 The Apache Software Foundation. All rights reserved.