See: Description
Interface | Description |
---|---|
ByteBuddy.Definable<T> |
Any definable instance is either
ByteBuddy.Definable.Defined when a value is provided
or ByteBuddy.Definable.Undefined if a value is not provided. |
ByteBuddy.MethodInterceptable |
Implementations of this interface are capable of defining a method interception for a given set of methods.
|
NamingStrategy |
A naming strategy for finding a fully qualified name for a Java type.
|
NamingStrategy.SuffixingRandom.BaseNameResolver |
A base name resolver is responsible for resolving a name onto which the suffix is appended.
|
NamingStrategy.Unbound |
An unbound
NamingStrategy where the actual naming strategy is still to be determined
in dependency of whether a type is to be subclasses, redefined or rebased. |
NamingStrategy.UnnamedType |
An description of a type which is to be named.
|
Class | Description |
---|---|
ByteBuddy |
ByteBuddy instances are configurable factories for creating new Java types at a JVM's runtime. |
ByteBuddy.Definable.Defined<T> |
A representation of a defined
ByteBuddy.Definable for a given value. |
ByteBuddy.Definable.Undefined<T> |
A representation of an undefined
ByteBuddy.Definable . |
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.MethodAnnotationTarget |
A
ByteBuddy configuration with a selected set of methods for which annotations can
be defined. |
ByteBuddy.OptionalMethodInterception |
An optional method interception that allows to intercept a method selection only if this is needed.
|
ByteBuddy.Proxy |
A proxy implementation for extending Byte Buddy while allowing for enhancing a
ByteBuddy
configuration. |
ClassFileVersion |
A wrapper object for representing a validated class file version in the format that is specified by the
JVMS.
|
NamingStrategy.Fixed |
A naming strategy that applies a fixed name.
|
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.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 |
A base name resolver that simply returns a fixed value.
|
NamingStrategy.SuffixingRandom.BaseNameResolver.ForGivenType |
Uses a specific type's name as the resolved name.
|
NamingStrategy.Unbound.Default |
A default unbound
NamingStrategy where rebased or redefined classes keep
their original name and where subclasses are named using a NamingStrategy.SuffixingRandom
strategy. |
NamingStrategy.Unbound.Unified |
A unified unbound naming strategy which always applies a given naming strategy.
|
NamingStrategy.UnnamedType.Default |
An unnamed type which is to be named by a naming strategy.
|
Enum | Description |
---|---|
NamingStrategy.SuffixingRandom.BaseNameResolver.ForUnnamedType |
Uses the unnamed type's super type's name as the resolved name.
|
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 overriden to return Hello World!
.Copyright © 2014–2016. All rights reserved.