예제 #1
0
  public JavaMetadataBean(JavaType annotation, Map<String, ? extends Object> attributes) {
    this.setAnnotation(annotation);
    this.setValues(Power.map(attributes));

    this.setCode(New.code(JavaMetadata.class));
    this.setExtraCode(New.code());
  }
  public PowerList<JavaType> getThrownTypes() {
    PowerList<JavaType> adapters = Power.list();

    for (TypeMirror typeMirror : executable.getThrownTypes()) {
      adapters.add(getTypeAdapter(typeMirror));
    }

    return adapters;
  }
예제 #3
0
  @SuppressWarnings("unchecked")
  protected <S extends AbstractJavaStructure> PowerList<S> findTypeParts(
      JavaType type, PowerList<S> typeParts) {
    PowerList<S> ss = Power.list();

    for (AbstractJavaStructure typePart : typeParts) {
      String typeName = typePart.getType().getCanonicalName();
      Pattern p = Pattern.compile("^.*\\b(" + typeName + ")\\b.*$");

      Matcher m = p.matcher(type.getCanonicalName());
      while (m.find()) {
        ss.add((S) typePart);
      }
    }

    return ss;
  }