本文整理匯總了Java中org.objectweb.asm.Type.equals方法的典型用法代碼示例。如果您正苦於以下問題:Java Type.equals方法的具體用法?Java Type.equals怎麽用?Java Type.equals使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.objectweb.asm.Type
的用法示例。
在下文中一共展示了Type.equals方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: isSubTypeOf
import org.objectweb.asm.Type; //導入方法依賴的package包/類
@Override
protected boolean isSubTypeOf(final BasicValue value,
final BasicValue expected) {
Type expectedType = expected.getType();
Type type = value.getType();
switch (expectedType.getSort()) {
case Type.INT:
case Type.FLOAT:
case Type.LONG:
case Type.DOUBLE:
return type.equals(expectedType);
case Type.ARRAY:
case Type.OBJECT:
if ("Lnull;".equals(type.getDescriptor())) {
return true;
} else if (type.getSort() == Type.OBJECT
|| type.getSort() == Type.ARRAY) {
return isAssignableFrom(expectedType, type);
} else {
return false;
}
default:
throw new Error("Internal error");
}
}
示例2: getSuperClass
import org.objectweb.asm.Type; //導入方法依賴的package包/類
protected Type getSuperClass(final Type t) {
if (currentClass != null && t.equals(currentClass)) {
return currentSuperClass;
}
Class<?> c = getClass(t).getSuperclass();
return c == null ? null : Type.getType(c);
}
示例3: unbox
import org.objectweb.asm.Type; //導入方法依賴的package包/類
/**
* Generates unboxing bytecode for the passed type. An {@link Object} is expected to be on the
* stack when these bytecodes are inserted.
*
* ASM takes a short cut when dealing with short/byte types and convert them into int rather
* than short/byte types. This is not an issue on the jvm nor Android's ART but it is an issue
* on Dalvik.
*
* @param mv the {@link GeneratorAdapter} generating a method implementation.
* @param type the expected un-boxed type.
*/
public static void unbox(GeneratorAdapter mv, Type type) {
if (type.equals(Type.SHORT_TYPE)) {
mv.checkCast(NUMBER_TYPE);
mv.invokeVirtual(NUMBER_TYPE, SHORT_VALUE);
} else if (type.equals(Type.BYTE_TYPE)) {
mv.checkCast(NUMBER_TYPE);
mv.invokeVirtual(NUMBER_TYPE, BYTE_VALUE);
} else {
mv.unbox(type);
}
}
示例4: unbox
import org.objectweb.asm.Type; //導入方法依賴的package包/類
public static AbstractInsnNode unbox(Class clazz, Type requiredType) {
if (requiredType.equals(Type.LONG_TYPE)) {
return BoxedPrimitivesMethods.longValue(clazz);
} else if (requiredType.equals(Type.INT_TYPE)) {
return BoxedPrimitivesMethods.intValue(clazz);
} else if (requiredType.equals(Type.DOUBLE_TYPE)) {
return BoxedPrimitivesMethods.doubleValue(clazz);
} else {
throw new UnsupportedOperationException("Unsupported primitive type: " + requiredType);
}
}
示例5: isInterface
import org.objectweb.asm.Type; //導入方法依賴的package包/類
protected boolean isInterface(final Type t) {
if (currentClass != null && t.equals(currentClass)) {
return isInterface;
}
return getClass(t).isInterface();
}
示例6: isObj
import org.objectweb.asm.Type; //導入方法依賴的package包/類
@Contract("null -> fail")
private static boolean isObj(Type type) {
return type.equals(MethodGenerator.OBJECT);
}
示例7: checkCast
import org.objectweb.asm.Type; //導入方法依賴的package包/類
/**
* Generates the instruction to check that the top stack value is of the
* given type.
*
* @param type
* a class or interface type.
*/
public void checkCast(final Type type) {
if (!type.equals(OBJECT_TYPE)) {
typeInsn(Opcodes.CHECKCAST, type);
}
}