See: Description
Interface | Description |
---|---|
ClassFileVersion.VersionLocator |
A locator for the executing VM's Java version.
|
NamingStrategy |
A naming strategy for determining a fully qualified name for a dynamically created Java type.
|
NamingStrategy.Suffixing.BaseNameResolver |
A base name resolver is responsible for resolving a name onto which the suffix is appended.
|
NamingStrategy.SuffixingRandom.BaseNameResolver | Deprecated |
Class | Description |
---|---|
ByteBuddy |
Instances of this class serve as a focus point for configuration of the library's behavior and as an entry point
to any form of code generation using the library.
|
ByteBuddy.EnumerationImplementation |
An implementation fo the
values method of an enumeration type. |
ByteBuddy.EnumerationImplementation.InitializationAppender |
A byte code appender for the type initializer of any enumeration type.
|
ByteBuddy.EnumerationImplementation.ValuesMethodAppender |
A byte code appender for the
values method of any enumeration type. |
ByteBuddy.RecordConstructorStrategy.Appender |
A byte code appender for accessors and the record constructor.
|
ClassFileVersion |
A wrapper object for representing a validated class file version in the format that is specified by the
JVMS.
|
ClassFileVersion.VersionLocator.Resolved |
A version locator for a resolved class file version.
|
ClassFileVersion.VersionLocator.Unresolved |
An unresolved version locator.
|
NamingStrategy.AbstractBase |
An abstract base implementation where the names of redefined and rebased types are retained.
|
NamingStrategy.PrefixingRandom |
A naming strategy that creates a name by prefixing a given class and its package with another package and
by appending a random number to the class's simple name.
|
NamingStrategy.Suffixing |
A naming strategy that appends a given suffix to a name, without a randomized element.
|
NamingStrategy.Suffixing.BaseNameResolver.ForFixedValue |
A base name resolver that simply returns a fixed value.
|
NamingStrategy.Suffixing.BaseNameResolver.ForGivenType |
Uses a specific type's name as the resolved name.
|
NamingStrategy.Suffixing.BaseNameResolver.WithCallerSuffix |
A base name resolver that adds the name of the class that is invoking
ByteBuddy . |
NamingStrategy.SuffixingRandom |
A naming strategy that creates a name by concatenating:
The super classes package and name
A given suffix string
A random number
Between all these elements, a
$ sign is included into the name to improve readability. |
NamingStrategy.SuffixingRandom.BaseNameResolver.ForFixedValue | Deprecated |
NamingStrategy.SuffixingRandom.BaseNameResolver.ForGivenType | Deprecated |
TypeCache<T> |
A cache for storing types without strongly referencing any class loader or type.
|
TypeCache.LookupKey |
A key used for looking up a previously inserted class loader cache.
|
TypeCache.SimpleKey |
A simple key based on a collection of types where no type is strongly referenced.
|
TypeCache.StorageKey |
A key used for storing a class loader cache reference.
|
TypeCache.WithInlineExpunction<S> |
An implementation of a
TypeCache where obsolete references are cleared upon any call. |
Enum | Description |
---|---|
ByteBuddy.RecordConstructorStrategy |
A constructor strategy for implementing a Java record.
|
ByteBuddy.RecordObjectMethod |
Implements the object methods of the Java record type.
|
ClassFileVersion.VersionLocator.Resolver |
A resolver for the current VM's class file version.
|
NamingStrategy.Suffixing.BaseNameResolver.ForUnnamedType |
Uses the unnamed type's super type's name as the resolved name.
|
NamingStrategy.SuffixingRandom.BaseNameResolver.ForUnnamedType | Deprecated |
TypeCache.Sort |
Determines the storage format for a cached type.
|
ByteBuddy
class serves as an entry point. The following example
Class<?> dynamicType = new ByteBuddy() .subclass(Object.class) .implement(Serializable.class) .intercept(named("toString"), FixedValue.value("Hello World!")) .make() .load(getClass().getClassLoader(), ClassLoadingStrategy.Default.WRAPPER) .getLoaded(); dynamicType.newInstance().toString; // returns "Hello World!"creates a subclass of the
Object
class which implements the Serializable
interface. The Object.toString()
method is overridden to return Hello World!
.Copyright © 2014–2024. All rights reserved.