Examples of asType()


Examples of com.thoughtworks.qdox.model.JavaClass.asType()

            JavaClass innerClass = createDynamicJavaClass("ReadOnly" + getDestinationClassname(metadata), getDestinationPackage(metadata), null, getMetadataProvider());
            innerClass.setModifiers(new String[]{"final","private"});
            retVal.addClass(innerClass);

            method = new JavaMethod(innerClass.asType(), "getReadOnly"+getDestinationClassname(metadata));
            method.setModifiers(new String[]{"public"});
            retVal.addMethod(method);

            method = new JavaMethod(new Type("java.util.Collection"), "wrapCollection");
            method.setModifiers(new String[]{"private", "static"});
View Full Code Here

Examples of com.thoughtworks.qdox.model.JavaClass.asType()

    if (aParameterNameConstantField != null) {
      JavaField field = clazz.getFieldByName(aParameterNameConstantField);
      if (field == null) {
        throw new IllegalArgumentException("Parameter name constant ["
                + aParameterNameConstantField + "] in class ["
                + clazz.asType().getFullyQualifiedName() + "]");
      }
      javadoc = field.getComment();
    }

    // CASE 2: JavaDoc is located on the parameter field itself
View Full Code Here

Examples of com.thoughtworks.qdox.model.JavaClass.asType()

    // CASE 2: JavaDoc is located on the parameter field itself
    if (javadoc == null) {
      JavaField field = clazz.getFieldByName(aParameterField);
      if (field == null) {
        throw new IllegalArgumentException("No parameter field [" + aParameterField
                + "] in class [" + clazz.asType().getFullyQualifiedName() + "]");
      }
      javadoc = field.getComment();
    }

    return postProcessJavaDoc(javadoc);
View Full Code Here

Examples of java.lang.invoke.MethodHandle.asType()

    MethodHandle test = entry.receiverClass == null ? NIL_TEST_METHOD_HANDLE
         : MethodHandles.insertArguments(
        TYPE_TEST_METHOD_HANDLE, 1, entry.receiverClass);
    Class[] tail = ArrayExtensions.tail(type.parameterArray());
    test = MethodHandles.dropArguments(test, 1, tail);
    test = test.asType(MethodType.methodType(Boolean.TYPE,
        type.parameterArray()));
    MethodHandle guard1 = MethodHandles.guardWithTest(test,
        entry.methodHandle, fallback);
    return guard1;
  }
View Full Code Here

Examples of java.lang.invoke.MethodHandle.asType()

  public static CallSite constructorBootstrap(Lookup lookup, String selector,
      MethodType type, String referenceString) throws Throwable {
    Reference reference = Reference.factory.value_(referenceString);
    Constructor constructor = ImageBootstrapper.systemMapping.classMappingAtReference_(reference).identityClass().getConstructor();
    MethodHandle constructorHandle = lookup.unreflectConstructor(constructor);
    return new ConstantCallSite(constructorHandle.asType(type));
  }

  public static CallSite superBootstrap(Lookup lookup, String selector,
      MethodType type, String lookupStart) throws Throwable {
    SuperCallSite site = SuperCallSite.newInstance(type, lookupStart,
View Full Code Here

Examples of java.lang.invoke.MethodHandle.asType()

      } catch (NoSuchMethodException | IllegalAccessException e) {

        throw new RuntimeException(e);
      }
    }
    return methodHandle.asType(type);
  }

  @Override
  protected void addTargetToCache(Object receiver) {
    Class receiverClass = receiver.getClass();
View Full Code Here

Examples of java.lang.invoke.MethodHandle.asType()

          type.parameterCount()).insertParameterTypes(0,
          BaseCallSite.class);
      final MethodHandle fallbackHandle = MethodHandles.insertArguments(
          MethodHandles.lookup().findStatic(BaseCallSite.class,
              "invocationFallback", fallbackType), 0, this);
      return fallbackHandle.asType(type);
    } catch (NoSuchMethodException | IllegalAccessException e) {
      throw new RuntimeException(e);
    }
  }
View Full Code Here

Examples of java.lang.invoke.MethodHandle.asType()

  protected MethodHandle findFieldAccess(Class receiverClass) {
    MethodHandle access = findAccessOrNil(receiverClass);
    if (access == null)
      throw new RuntimeException("Access not found");
    return access.asType(type);
  }

  protected MethodHandle findAccessOrNil(Class receiverClass) {
    // Try to find the highest defined access
    MethodHandle found = null;
View Full Code Here

Examples of java.lang.invoke.MethodHandle.asType()

        MethodHandle handle;

        handle = lookup.findStatic(Bootstrap.class, operation, type.insertParameterTypes(0, VariableSite.class));

        handle = handle.bindTo(site);
        site.setTarget(handle.asType(site.type()));

        return site;
    }

    public static CallSite searchConst(Lookup lookup, String name, MethodType type) {
View Full Code Here

Examples of java.lang.invoke.MethodHandle.asType()

        @Override
        public FunctionBinding bindFunction(long bindingId, String name, ByteCodeNode getSessionByteCode, List<ByteCodeNode> arguments)
        {
            MethodHandle methodHandle = inMethod.bindTo(constantValues);
            methodHandle = methodHandle.asType(MethodType.methodType(boolean.class, valueType));
            return new FunctionBinding(bindingId, name, new ConstantCallSite(methodHandle), arguments, false);
        }

        public static boolean in(ImmutableSet<?> set, Object value)
        {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.