byte-buddy-1.8.21.jar
登录
|
net.bytebuddy:byte-buddy:1.8.21
META-INF
net
bytebuddy
pool
package-info.java
asm
matcher
implementation
auxiliary
package-info.java
bytecode
Multiplication.java
package-info.java
StackSize.java
Duplication.java
constant
ByteCodeAppender.java
Removal.java
Throw.java
TypeCreation.java
collection
Addition.java
member
StackManipulation.java
assign
reference
package-info.java
InstanceCheck.java
TypeCasting.java
primitive
Assigner.java
Implementation.java
InvokeDynamic.java
LoadedTypeInitializer.java
MethodDelegation.java
DefaultMethodCall.java
bind
FixedValue.java
StubMethod.java
InvocationHandlerAdapter.java
MethodAccessorFactory.java
attribute
FieldAccessor.java
MethodCall.java
ExceptionMethod.java
EqualsMethod.java
HashCodeMethod.java
ToStringMethod.java
SuperMethodCall.java
utility
dynamic
ByteBuddy.java
build
NamingStrategy.java
ClassFileVersion.java
TypeCache.java
description
agent
jar
TypeCasting.java
清空
类结构
package net.bytebuddy.implementation.bytecode.assign; import net.bytebuddy.build.
HashCodeAndEqualsPlugin
; import net.bytebuddy.description.type.
TypeDefinition
; import net.bytebuddy.description.type.
TypeDescription
; import net.bytebuddy.implementation.
Implementation
; import net.bytebuddy.implementation.bytecode.
StackManipulation
; import net.bytebuddy.implementation.bytecode.
StackSize
; import net.bytebuddy.jar.asm.
MethodVisitor
; import net.bytebuddy.jar.asm.
Opcodes
; /** * A stack manipulation for a type down casting. Such castings are not implicit but must be performed explicitly. */ @
HashCodeAndEqualsPlugin
.
Enhance
public class
TypeCasting
implements
StackManipulation
{ /** * The type description to which a value should be casted. */ private final
TypeDescription
typeDescription
; /** * Creates a new type casting. * * @param typeDescription The type description to which a value should be casted. */ protected
TypeCasting
(
TypeDescription
typeDescription
) { this.
typeDescription
=
typeDescription
; } /** * Creates a casting to the given, non-primitive type. * * @param typeDefinition The type to which a value should be casted. * @return A stack manipulation that represents the casting. */ public static
StackManipulation
to
(
TypeDefinition
typeDefinition
) { if (
typeDefinition
.
isPrimitive
()) { throw new
IllegalArgumentException
("Cannot cast to primitive type: " +
typeDefinition
); } return new
TypeCasting
(
typeDefinition
.
asErasure
()); } @
Override
public boolean
isValid
() { return true; } @
Override
public
Size
apply
(
MethodVisitor
methodVisitor
,
Implementation
.
Context
implementationContext
) {
methodVisitor
.
visitTypeInsn
(
Opcodes
.
CHECKCAST
,
typeDescription
.
getInternalName
()); return
StackSize
.
ZERO
.
toIncreasingSize
(); } }
查找资源
Jre/Lib
输入类名或文件名
类结构窗口