Search in sources :

Example 31 with Type

use of com.acgist.snail.pojo.bean.M3u8.Type in project tomee by apache.

the class DynamicSubclass method visitConstructor.

private static MethodVisitor visitConstructor(final ClassWriter cw, final String proxyClassFileName, final String classFileName, final Constructor<?> constructor) {
    final String descriptor = Type.getConstructorDescriptor(constructor);
    final String[] exceptions = new String[constructor.getExceptionTypes().length];
    for (int i = 0; i < exceptions.length; i++) {
        exceptions[i] = Type.getInternalName(constructor.getExceptionTypes()[i]);
    }
    final MethodVisitor mv = cw.visitMethod(ACC_PUBLIC, "<init>", descriptor, null, exceptions);
    mv.visitCode();
    mv.visitVarInsn(ALOAD, 0);
    int index = 1;
    for (final Type type : Type.getArgumentTypes(descriptor)) {
        mv.visitVarInsn(type.getOpcode(ILOAD), index);
        index += size(type);
    }
    mv.visitMethodInsn(INVOKESPECIAL, classFileName, "<init>", descriptor, false);
    mv.visitVarInsn(ALOAD, 0);
    mv.visitVarInsn(ALOAD, 0);
    mv.visitFieldInsn(PUTFIELD, proxyClassFileName, "this$handler", "Ljava/lang/reflect/InvocationHandler;");
    mv.visitInsn(RETURN);
    mv.visitMaxs(2, 1);
    return mv;
}
Also used : Type(org.apache.xbean.asm9.Type) MethodVisitor(org.apache.xbean.asm9.MethodVisitor)

Example 32 with Type

use of com.acgist.snail.pojo.bean.M3u8.Type in project tomee by apache.

the class DependencyVisitor method addMethodDesc.

private void addMethodDesc(final String desc) {
    addType(Type.getReturnType(desc));
    final Type[] types = Type.getArgumentTypes(desc);
    for (Type type : types) {
        addType(type);
    }
}
Also used : Type(org.apache.xbean.asm9.Type)

Example 33 with Type

use of com.acgist.snail.pojo.bean.M3u8.Type in project tomee by apache.

the class CmrField method createSignature.

private static String createSignature(final Type type, final Type... genericTypes) {
    final StringBuilder builder = new StringBuilder();
    builder.append("L").append(type.getInternalName());
    if (genericTypes.length > 0) {
        builder.append("<");
        for (final Type genericType : genericTypes) {
            builder.append(genericType.getDescriptor());
        }
        builder.append(">");
    }
    builder.append(";");
    return builder.toString();
}
Also used : Type(org.apache.xbean.asm9.Type)

Example 34 with Type

use of com.acgist.snail.pojo.bean.M3u8.Type in project java-spanner-jdbc by googleapis.

the class PgNumericPreparedStatementTest method assertRequestWithScalar.

private void assertRequestWithScalar(String value) {
    final ExecuteSqlRequest request = mockSpanner.getRequestsOfType(ExecuteSqlRequest.class).get(0);
    final String actualSql = request.getSql();
    final Struct actualParams = request.getParams();
    final Map<String, Type> actualParamTypes = request.getParamTypesMap();
    final Value parameterValue = protoValueFromString(value);
    final Struct expectedParams = Struct.newBuilder().putFields("p1", parameterValue).build();
    final ImmutableMap<String, Type> expectedTypes = ImmutableMap.of("p1", Type.newBuilder().setCode(TypeCode.NUMERIC).setTypeAnnotation(TypeAnnotationCode.PG_NUMERIC).build());
    assertEquals(REWRITTEN_QUERY, actualSql);
    assertEquals(expectedParams, actualParams);
    assertEquals(expectedTypes, actualParamTypes);
}
Also used : Type(com.google.spanner.v1.Type) ExecuteSqlRequest(com.google.spanner.v1.ExecuteSqlRequest) NullValue(com.google.protobuf.NullValue) Value(com.google.protobuf.Value) ListValue(com.google.protobuf.ListValue) Struct(com.google.protobuf.Struct)

Example 35 with Type

use of com.acgist.snail.pojo.bean.M3u8.Type in project java-spanner-jdbc by googleapis.

the class PgNumericPreparedStatementTest method assertRequestWithArray.

private void assertRequestWithArray(Iterable<String> value) {
    final ExecuteSqlRequest request = mockSpanner.getRequestsOfType(ExecuteSqlRequest.class).get(0);
    final String actualSql = request.getSql();
    final Struct actualParams = request.getParams();
    final Map<String, Type> actualParamTypes = request.getParamTypesMap();
    Value parameterValue;
    if (value != null) {
        final ListValue.Builder builder = ListValue.newBuilder();
        value.forEach(v -> builder.addValues(protoValueFromString(v)));
        parameterValue = Value.newBuilder().setListValue(builder.build()).build();
    } else {
        parameterValue = Value.newBuilder().setNullValue(NullValue.NULL_VALUE).build();
    }
    final Struct expectedParams = Struct.newBuilder().putFields("p1", parameterValue).build();
    final ImmutableMap<String, Type> expectedTypes = ImmutableMap.of("p1", Type.newBuilder().setCode(TypeCode.ARRAY).setArrayElementType(Type.newBuilder().setCode(TypeCode.NUMERIC).setTypeAnnotation(TypeAnnotationCode.PG_NUMERIC)).build());
    assertEquals(REWRITTEN_QUERY, actualSql);
    assertEquals(expectedParams, actualParams);
    assertEquals(expectedTypes, actualParamTypes);
}
Also used : Type(com.google.spanner.v1.Type) ExecuteSqlRequest(com.google.spanner.v1.ExecuteSqlRequest) ListValue(com.google.protobuf.ListValue) NullValue(com.google.protobuf.NullValue) Value(com.google.protobuf.Value) ListValue(com.google.protobuf.ListValue) Struct(com.google.protobuf.Struct)

Aggregations

Type (com.google.api.expr.v1alpha1.Type)30 Test (org.junit.Test)16 Type (edu.stanford.CVC4.Type)14 Type (com.google.spanner.v1.Type)12 ArrayType (edu.stanford.CVC4.ArrayType)11 BitVectorType (edu.stanford.CVC4.BitVectorType)11 Expr (edu.stanford.CVC4.Expr)11 MapType (com.google.api.expr.v1alpha1.Type.MapType)10 Type (org.apache.xbean.asm9.Type)10 ByteString (com.google.protobuf.ByteString)9 CVC4.vectorExpr (edu.stanford.CVC4.vectorExpr)9 ArrayList (java.util.ArrayList)9 CheckedExpr (com.google.api.expr.v1alpha1.CheckedExpr)8 FieldType (org.projectnessie.cel.common.types.ref.FieldType)8 FormulaType (org.sosy_lab.java_smt.api.FormulaType)8 ListValue (com.google.protobuf.ListValue)7 ExecuteSqlRequest (com.google.spanner.v1.ExecuteSqlRequest)7 CheckerEnv.dynElementType (org.projectnessie.cel.checker.CheckerEnv.dynElementType)7 CheckerEnv.getObjectWellKnownType (org.projectnessie.cel.checker.CheckerEnv.getObjectWellKnownType)7 CheckerEnv.isObjectWellKnownType (org.projectnessie.cel.checker.CheckerEnv.isObjectWellKnownType)7