Package net.bytebuddy.dynamic.scaffold
Interface InstrumentedType.WithFlexibleName
-
- All Superinterfaces:
AnnotationSource,ByteCodeElement,DeclaredByType,InstrumentedType,java.lang.Iterable<TypeDefinition>,ModifierReviewable,ModifierReviewable.ForTypeDefinition,ModifierReviewable.OfAbstraction,ModifierReviewable.OfByteCodeElement,ModifierReviewable.OfEnumeration,NamedElement,NamedElement.WithDescriptor,NamedElement.WithRuntimeName,TypeDefinition,TypeDescription,TypeVariableSource
- All Known Implementing Classes:
InstrumentedType.Default,InstrumentedType.Frozen
- Enclosing interface:
- InstrumentedType
public static interface InstrumentedType.WithFlexibleName extends InstrumentedType
Implementations represent anInstrumentedTypewith a flexible name.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.bytebuddy.description.annotation.AnnotationSource
AnnotationSource.Empty, AnnotationSource.Explicit
-
Nested classes/interfaces inherited from interface net.bytebuddy.description.ByteCodeElement
ByteCodeElement.Token<T extends ByteCodeElement.Token<T>>, ByteCodeElement.TypeDependant<T extends ByteCodeElement.TypeDependant<?,S>,S extends ByteCodeElement.Token<S>>
-
Nested classes/interfaces inherited from interface net.bytebuddy.dynamic.scaffold.InstrumentedType
InstrumentedType.Default, InstrumentedType.Factory, InstrumentedType.Frozen, InstrumentedType.Prepareable, InstrumentedType.WithFlexibleName
-
Nested classes/interfaces inherited from interface net.bytebuddy.description.ModifierReviewable
ModifierReviewable.ForFieldDescription, ModifierReviewable.ForMethodDescription, ModifierReviewable.ForParameterDescription, ModifierReviewable.ForTypeDefinition, ModifierReviewable.OfAbstraction, ModifierReviewable.OfByteCodeElement, ModifierReviewable.OfEnumeration
-
Nested classes/interfaces inherited from interface net.bytebuddy.description.NamedElement
NamedElement.WithDescriptor, NamedElement.WithGenericName, NamedElement.WithOptionalName, NamedElement.WithRuntimeName
-
Nested classes/interfaces inherited from interface net.bytebuddy.description.type.TypeDefinition
TypeDefinition.Sort, TypeDefinition.SuperClassIterator
-
Nested classes/interfaces inherited from interface net.bytebuddy.description.type.TypeDescription
TypeDescription.AbstractBase, TypeDescription.ArrayProjection, TypeDescription.ForLoadedType, TypeDescription.ForPackageDescription, TypeDescription.Generic, TypeDescription.Latent, TypeDescription.SuperTypeLoading
-
Nested classes/interfaces inherited from interface net.bytebuddy.description.TypeVariableSource
TypeVariableSource.Visitor<T>
-
-
Field Summary
-
Fields inherited from interface net.bytebuddy.description.ModifierReviewable
EMPTY_MASK
-
Fields inherited from interface net.bytebuddy.description.NamedElement
EMPTY_NAME, NO_NAME
-
Fields inherited from interface net.bytebuddy.description.NamedElement.WithDescriptor
NON_GENERIC_SIGNATURE
-
Fields inherited from interface net.bytebuddy.description.type.TypeDefinition
RAW_TYPES_PROPERTY
-
Fields inherited from interface net.bytebuddy.description.type.TypeDescription
ARRAY_INTERFACES, CLASS, OBJECT, STRING, THROWABLE, UNDEFINED, VOID
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description InstrumentedType.WithFlexibleNamewithAnnotations(java.util.List<? extends AnnotationDescription> annotationDescriptions)Creates a new instrumented type with the given annotations.InstrumentedType.WithFlexibleNamewithAnonymousClass(boolean anonymousClass)Creates a new instrumented type that indicates that it is defined as an anonymous class.InstrumentedType.WithFlexibleNamewithDeclaredTypes(TypeList declaredTypes)Creates a new instrumented type that indicates that it declared the supplied types.InstrumentedType.WithFlexibleNamewithDeclaringType(TypeDescription declaringType)Creates a new instrumented type that is declared by the supplied type..InstrumentedType.WithFlexibleNamewithEnclosingMethod(MethodDescription.InDefinedShape enclosingMethod)Creates a new instrumented type with the supplied enclosing method.InstrumentedType.WithFlexibleNamewithEnclosingType(TypeDescription enclosingType)Creates a new instrumented type with the supplied enclosing type.InstrumentedType.WithFlexibleNamewithField(FieldDescription.Token token)Creates a new instrumented type that includes a new field.InstrumentedType.WithFlexibleNamewithInitializer(ByteCodeAppender byteCodeAppender)Creates a new instrumented type that executes the given initializer in the instrumented type's type initializer.InstrumentedType.WithFlexibleNamewithInitializer(LoadedTypeInitializer loadedTypeInitializer)Creates a new instrumented type that includes the givenLoadedTypeInitializer.InstrumentedType.WithFlexibleNamewithInterfaces(TypeList.Generic interfaceTypes)Creates a new instrumented type with the given interfaces implemented.InstrumentedType.WithFlexibleNamewithLocalClass(boolean localClass)Creates a new instrumented type that indicates that is defined as a local class.InstrumentedType.WithFlexibleNamewithMethod(MethodDescription.Token token)Creates a new instrumented type that includes a new method or constructor.InstrumentedType.WithFlexibleNamewithModifiers(int modifiers)Creates a new instrumented type with changed modifiers.InstrumentedType.WithFlexibleNamewithName(java.lang.String name)Creates a new instrumented type with a changed name.InstrumentedType.WithFlexibleNamewithNestHost(TypeDescription nestHost)Creates a new instrumented type with the supplied nest host.InstrumentedType.WithFlexibleNamewithNestMembers(TypeList nestMembers)Creates a new instrumented types with the supplied nest members added to this instrumented type.InstrumentedType.WithFlexibleNamewithPermittedSubclasses(TypeList permittedSubclasses)Creates a new instrumented type that includes the supplied permitted subclasses.InstrumentedType.WithFlexibleNamewithRecord(boolean record)Creates a new instrumented type that indicates that it defined as a record type.InstrumentedType.WithFlexibleNamewithRecordComponent(RecordComponentDescription.Token token)Creates a new instrumented type that includes a new record component.InstrumentedType.WithFlexibleNamewithSealed(boolean sealed)Creates a new instrumented type that indicates that it defined as a sealed type.InstrumentedType.WithFlexibleNamewithTypeVariable(TypeVariableToken typeVariable)Creates a new instrumented type with the given type variable defined.InstrumentedType.WithFlexibleNamewithTypeVariables(ElementMatcher<? super TypeDescription.Generic> matcher, Transformer<TypeVariableToken> transformer)Applies a transformation onto all existing type variables of this instrumented type.-
Methods inherited from interface net.bytebuddy.description.annotation.AnnotationSource
getDeclaredAnnotations
-
Methods inherited from interface net.bytebuddy.description.ByteCodeElement
isAccessibleTo, isVisibleTo
-
Methods inherited from interface net.bytebuddy.dynamic.scaffold.InstrumentedType
getLoadedTypeInitializer, getTypeInitializer, validated
-
Methods inherited from interface net.bytebuddy.description.ModifierReviewable
getModifiers, getSyntheticState, isFinal, isSynthetic
-
Methods inherited from interface net.bytebuddy.description.ModifierReviewable.ForTypeDefinition
getTypeManifestation, isAnnotation, isInterface
-
Methods inherited from interface net.bytebuddy.description.ModifierReviewable.OfAbstraction
isAbstract
-
Methods inherited from interface net.bytebuddy.description.ModifierReviewable.OfByteCodeElement
getOwnership, getVisibility, isDeprecated, isPackagePrivate, isPrivate, isProtected, isPublic, isStatic
-
Methods inherited from interface net.bytebuddy.description.ModifierReviewable.OfEnumeration
getEnumerationState, isEnum
-
Methods inherited from interface net.bytebuddy.description.NamedElement
getActualName
-
Methods inherited from interface net.bytebuddy.description.NamedElement.WithDescriptor
getDescriptor, getGenericSignature
-
Methods inherited from interface net.bytebuddy.description.NamedElement.WithRuntimeName
getInternalName, getName
-
Methods inherited from interface net.bytebuddy.description.type.TypeDefinition
asErasure, asGenericType, getInterfaces, getSort, getStackSize, getSuperClass, getTypeName, isArray, isPrimitive, isRecord, represents
-
Methods inherited from interface net.bytebuddy.description.type.TypeDescription
asBoxed, asUnboxed, getActualModifiers, getCanonicalName, getComponentType, getDeclaredFields, getDeclaredMethods, getDeclaredTypes, getDeclaringType, getDefaultValue, getEnclosingMethod, getEnclosingType, getInheritedAnnotations, getInnerClassCount, getNestHost, getNestMembers, getPackage, getPermittedSubclasses, getRecordComponents, getSimpleName, isAnnotationReturnType, isAnnotationValue, isAnnotationValue, isAnonymousType, isAssignableFrom, isAssignableFrom, isAssignableTo, isAssignableTo, isCompileTimeConstant, isInHierarchyWith, isInHierarchyWith, isInnerClass, isInstance, isLocalType, isMemberType, isNestedClass, isNestHost, isNestMateOf, isNestMateOf, isPackageType, isPrimitiveWrapper, isSamePackage, isSealed
-
Methods inherited from interface net.bytebuddy.description.TypeVariableSource
accept, findVariable, getEnclosingSource, getTypeVariables, isGenerified, isInferrable
-
-
-
-
Method Detail
-
withField
InstrumentedType.WithFlexibleName withField(FieldDescription.Token token)
Creates a new instrumented type that includes a new field.- Specified by:
withFieldin interfaceInstrumentedType- Parameters:
token- A token that represents the field's shape.- Returns:
- A new instrumented type that is equal to this instrumented type but with the additional field.
-
withMethod
InstrumentedType.WithFlexibleName withMethod(MethodDescription.Token token)
Creates a new instrumented type that includes a new method or constructor.- Specified by:
withMethodin interfaceInstrumentedType- Parameters:
token- A token that represents the method's shape.- Returns:
- A new instrumented type that is equal to this instrumented type but with the additional method.
-
withRecordComponent
InstrumentedType.WithFlexibleName withRecordComponent(RecordComponentDescription.Token token)
Creates a new instrumented type that includes a new record component.- Specified by:
withRecordComponentin interfaceInstrumentedType- Parameters:
token- A token that represents the record component's shape.- Returns:
- A new instrumented type that is equal to this instrumented type but with the additional record component.
-
withModifiers
InstrumentedType.WithFlexibleName withModifiers(int modifiers)
Creates a new instrumented type with changed modifiers.- Specified by:
withModifiersin interfaceInstrumentedType- Parameters:
modifiers- The instrumented type's modifiers.- Returns:
- A new instrumented type that is equal to this instrumented type but with the given modifiers.
-
withInterfaces
InstrumentedType.WithFlexibleName withInterfaces(TypeList.Generic interfaceTypes)
Creates a new instrumented type with the given interfaces implemented.- Specified by:
withInterfacesin interfaceInstrumentedType- Parameters:
interfaceTypes- The interface types to implement.- Returns:
- A new instrumented type that is equal to this instrumented type but with the given interfaces implemented.
-
withNestHost
InstrumentedType.WithFlexibleName withNestHost(TypeDescription nestHost)
Creates a new instrumented type with the supplied nest host. An instrumented type can be its own nest host. Setting a nest host removes all nest members from the instrumented type.- Specified by:
withNestHostin interfaceInstrumentedType- Parameters:
nestHost- The nest host of the created instrumented type.- Returns:
- A new instrumented type with the supplied type as its nest host.
-
withNestMembers
InstrumentedType.WithFlexibleName withNestMembers(TypeList nestMembers)
Creates a new instrumented types with the supplied nest members added to this instrumented type. The instrumented type is defined as a nest host if this method is invoked. Any previous nest members are prepended to the supplied types.- Specified by:
withNestMembersin interfaceInstrumentedType- Parameters:
nestMembers- The nest members to add to the created instrumented type.- Returns:
- A new instrumented type that applies the supplied nest members.
-
withEnclosingType
InstrumentedType.WithFlexibleName withEnclosingType(TypeDescription enclosingType)
Creates a new instrumented type with the supplied enclosing type.- Specified by:
withEnclosingTypein interfaceInstrumentedType- Parameters:
enclosingType- The type to define as the created instrumented type's enclosing type.- Returns:
- A new instrumented type with the supplied type as its enclosing type.
-
withEnclosingMethod
InstrumentedType.WithFlexibleName withEnclosingMethod(MethodDescription.InDefinedShape enclosingMethod)
Creates a new instrumented type with the supplied enclosing method.- Specified by:
withEnclosingMethodin interfaceInstrumentedType- Parameters:
enclosingMethod- The method to define as the created instrumented type's enclosing method.- Returns:
- A new instrumented type with the supplied method as its enclosing method.
-
withDeclaringType
InstrumentedType.WithFlexibleName withDeclaringType(TypeDescription declaringType)
Creates a new instrumented type that is declared by the supplied type..- Specified by:
withDeclaringTypein interfaceInstrumentedType- Parameters:
declaringType- The type that declares the instrumented type.- Returns:
- A new instrumented type that is declared by the instrumented type.
-
withDeclaredTypes
InstrumentedType.WithFlexibleName withDeclaredTypes(TypeList declaredTypes)
Creates a new instrumented type that indicates that it declared the supplied types.- Specified by:
withDeclaredTypesin interfaceInstrumentedType- Parameters:
declaredTypes- The types to add to the created instrumented type as declared types.- Returns:
- A new instrumented type that indicates that it has declared the supplied types.
-
withPermittedSubclasses
InstrumentedType.WithFlexibleName withPermittedSubclasses(TypeList permittedSubclasses)
Creates a new instrumented type that includes the supplied permitted subclasses.- Specified by:
withPermittedSubclassesin interfaceInstrumentedType- Parameters:
permittedSubclasses- A list of permitted subclasses to include.- Returns:
- A new instrumented type that includes the supplied permitted subclasses.
-
withLocalClass
InstrumentedType.WithFlexibleName withLocalClass(boolean localClass)
Creates a new instrumented type that indicates that is defined as a local class. Setting this property resets the anonymous class property.- Specified by:
withLocalClassin interfaceInstrumentedType- Parameters:
localClass-trueif the instrumented type is supposed to be treated as a local class.- Returns:
- A new instrumented type that is treated as a local class.
-
withAnonymousClass
InstrumentedType.WithFlexibleName withAnonymousClass(boolean anonymousClass)
Creates a new instrumented type that indicates that it is defined as an anonymous class. Setting this property resets the local class property.- Specified by:
withAnonymousClassin interfaceInstrumentedType- Parameters:
anonymousClass-trueif the instrumented type is supposed to be treated as an anonymous class.- Returns:
- A new instrumented type that is treated as an anonymous class.
-
withRecord
InstrumentedType.WithFlexibleName withRecord(boolean record)
Creates a new instrumented type that indicates that it defined as a record type. Setting this property to false removes all record components.- Specified by:
withRecordin interfaceInstrumentedType- Parameters:
record-trueif the instrumented type is supposed to be a record.- Returns:
- A new instrumented type that is defined as a record.
-
withSealed
InstrumentedType.WithFlexibleName withSealed(boolean sealed)
Creates a new instrumented type that indicates that it defined as a sealed type.- Specified by:
withSealedin interfaceInstrumentedType- Parameters:
sealed-trueif the instrumented type is supposed to be sealed.- Returns:
- A new instrumented type that is defined as a sealed type if any permitted subclasses are set.
-
withTypeVariable
InstrumentedType.WithFlexibleName withTypeVariable(TypeVariableToken typeVariable)
Creates a new instrumented type with the given type variable defined.- Specified by:
withTypeVariablein interfaceInstrumentedType- Parameters:
typeVariable- The type variable to declare.- Returns:
- A new instrumented type that is equal to this instrumented type but with the given type variable declared.
-
withAnnotations
InstrumentedType.WithFlexibleName withAnnotations(java.util.List<? extends AnnotationDescription> annotationDescriptions)
Creates a new instrumented type with the given annotations.- Specified by:
withAnnotationsin interfaceInstrumentedType- Parameters:
annotationDescriptions- The annotations to add to the instrumented type.- Returns:
- A new instrumented type that is equal to this instrumented type but annotated with the given annotations
-
withInitializer
InstrumentedType.WithFlexibleName withInitializer(LoadedTypeInitializer loadedTypeInitializer)
Creates a new instrumented type that includes the givenLoadedTypeInitializer.- Specified by:
withInitializerin interfaceInstrumentedType- Parameters:
loadedTypeInitializer- The type initializer to include.- Returns:
- A new instrumented type that is equal to this instrumented type but with the additional type initializer.
-
withInitializer
InstrumentedType.WithFlexibleName withInitializer(ByteCodeAppender byteCodeAppender)
Creates a new instrumented type that executes the given initializer in the instrumented type's type initializer.- Specified by:
withInitializerin interfaceInstrumentedType- Parameters:
byteCodeAppender- The byte code to add to the type initializer.- Returns:
- A new instrumented type that is equal to this instrumented type but with the given stack manipulation attached to its type initializer.
-
withName
InstrumentedType.WithFlexibleName withName(java.lang.String name)
Creates a new instrumented type with a changed name.- Parameters:
name- The name of the instrumented type.- Returns:
- A new instrumented type that has the given name.
-
withTypeVariables
InstrumentedType.WithFlexibleName withTypeVariables(ElementMatcher<? super TypeDescription.Generic> matcher, Transformer<TypeVariableToken> transformer)
Applies a transformation onto all existing type variables of this instrumented type. A transformation is potentially unsafe and it is the responsibility of the supplier to return a valid type variable token from the transformer.- Parameters:
matcher- The matcher to decide what type variables to transform.transformer- The transformer to apply on all matched type variables.- Returns:
- A new instrumented type with all matched type variables transformed.
-
-