Package org.kite9.framework.model

Examples of org.kite9.framework.model.MethodHandle


  @Test
  public void test_1_14_AnnotationReference() throws Exception {
    Set<AnnotationHandle> refs = pm.getAnnotationReferences(convertName(Refs.Referenced.class));
    Method m = Refs.class.getMethod("referencer");
    MethodHandle mh = new MethodHandle(m);
    Reference ref = m.getAnnotation(Reference.class);
    AnnotationHandle expected = new AnnotationHandle(ref, mh, "refs");
    Assert.assertTrue(refs.contains(expected));
  }
View Full Code Here


 
  private MemberHandle createHandle(String owner, String name, String desc) {
    if (name.equals("<init>")) {
      return new ConstructorHandle(owner, desc);     
    } else {
      return new MethodHandle(owner, name, desc);
    }
  }
View Full Code Here

    final ClassLoader cl = getCurrentClassLoader();

    List<Tie> ties2 = new ArrayList<Tie>();
    for (Tie t : ties) {
        Method m = getRepresented(t);
      for (MemberHandle mh : model.getCalledBy(new MethodHandle(m))) {
          if (mh instanceof MethodHandle) {
        Method m2 = ((MethodHandle)mh).hydrate(cl);
        if ((f == null) || (f.accept(m2))) {
          ties2.add(new Tie(NounFactory.createNewSubjectNounPart(t), JavaRelationships.CALLED_BY, createNoun(m2)));
        }
View Full Code Here

  public ClassBuilder withCallingClasses(Filter<? super Class<?>> f) {
    final ClassLoader cl = getCurrentClassLoader();
    List<Tie> ties2 = new ArrayList<Tie>();
    for (Tie t : ties) {
        Method m = getRepresented(t);
      for (MemberHandle mh : model.getCalledBy(new MethodHandle(m))) {
          if (mh instanceof MethodHandle) {
        Method m2 = ((MethodHandle)mh).hydrate(cl);
        Class<?> c2 = m2.getDeclaringClass();
        if ((f == null) || (f.accept(c2))) {
          ties2.add(new Tie(NounFactory.createNewSubjectNounPart(t), JavaRelationships.CALLED_BY, createNoun(c2)));
View Full Code Here

  public MethodBuilder withCalledMethods(Filter<? super Method> f) {
    final ClassLoader cl = getCurrentClassLoader();
    List<Tie> ties2 = new ArrayList<Tie>();
    for (Tie t : ties) {
        Method m = getRepresented(t);
      for (MemberHandle mh : model.getCalls(new MethodHandle(m))) {
            if (mh instanceof MethodHandle) {
                Method m2 = ((MethodHandle)mh).hydrate(cl);
                if ((f == null) || (f.accept(m2))) {
                  ties2.add(new Tie(NounFactory.createNewSubjectNounPart(t), JavaRelationships.CALLS, createNoun(m2)));
                }
View Full Code Here

  public ClassBuilder withCalledClasses(Filter<? super Class<?>> f) {
    final ClassLoader cl = getCurrentClassLoader();
    List<Tie> ties2 = new ArrayList<Tie>();
    for (Tie t : ties) {
        Method m = getRepresented(t);
      for (MemberHandle mh : model.getCalls(new MethodHandle(m))) {
            if (mh instanceof MethodHandle) {
                Method m2 = ((MethodHandle)mh).hydrate(cl);
                Class<?> dc = ((MethodHandle)mh).hydrateClass(cl);
                if ((f == null) || (f.accept(dc))) {
                  ties2.add(new Tie(NounFactory.createNewSubjectNounPart(t), new MethodCallRelationship(m2), createNoun(dc)));
View Full Code Here

      Class<?> c = getRepresented(t);
      Set<Class<?>> todo = traverse ? superTraverse(c) : new LinkedHashSet<Class<?>>();
      todo.add(c);
      for (Class<?> class1 : todo) {
        for (Method m : class1.getDeclaredMethods()) {
          for (MemberHandle mh : model.getCalledBy(new MethodHandle(m))) {
            if (mh instanceof MethodHandle) {
              Class<?> dc = ((MethodHandle) mh).hydrateClass(cl);
              if ((f == null) || (f.accept(dc))) {
                ties2.add(new Tie(NounFactory.createNewSubjectNounPart(t), new MethodCallRelationship(m,
                    RelationshipType.PASSIVE), createNoun(dc)));
View Full Code Here

      Class<?> c = getRepresented(t);
      Set<Class<?>> todo = traverse ? superTraverse(c) : new LinkedHashSet<Class<?>>();
      todo.add(c);
      for (Class<?> class1 : todo) {
        for (Method m : class1.getDeclaredMethods()) {
          for (MemberHandle mh : model.getCalledBy(new MethodHandle(m))) {
            if (mh instanceof MethodHandle) {
              Method dc = ((MethodHandle) mh).hydrate(cl);
              if ((f == null) || (f.accept(dc))) {
                ties2.add(new Tie(NounFactory.createNewSubjectNounPart(t), JavaRelationships.CALLED_BY, createNoun(dc)));
              }
View Full Code Here

      Class<?> c = getRepresented(t);
      Set<Class<?>> todo = traverse ? superTraverse(c) : new LinkedHashSet<Class<?>>();
      todo.add(c);
      for (Class<?> class1 : todo) {
        for (Method m : class1.getDeclaredMethods()) {
          for (MemberHandle mh : model.getCalls(new MethodHandle(m))) {
            if (mh instanceof MethodHandle) {
              Method m2 = ((MethodHandle) mh).hydrate(cl);
              Class<?> dc = ((MethodHandle) mh).hydrateClass(cl);
              if ((f == null) || (f.accept(dc))) {
                ties2.add(new Tie(NounFactory.createNewSubjectNounPart(t), new MethodCallRelationship(m2),
View Full Code Here

      Class<?> c = getRepresented(t);
      Set<Class<?>> todo = traverse ? superTraverse(c) : new LinkedHashSet<Class<?>>();
      todo.add(c);
      for (Class<?> class1 : todo) {
        for (Method m : class1.getDeclaredMethods()) {
          for (MemberHandle mh : model.getCalls(new MethodHandle(m))) {
            if (mh instanceof MethodHandle) {
              Method m2 = ((MethodHandle) mh).hydrate(cl);
              if ((f == null) || (f.accept(m2))) {
                ties2.add(new Tie(NounFactory.createNewSubjectNounPart(t), JavaRelationships.CALLS, createNoun(m2)));
              }
View Full Code Here

TOP

Related Classes of org.kite9.framework.model.MethodHandle

Copyright © 2018 www.massapicom. 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.