Exemplo n.º 1
0
  public Map defaultArguments() {
    Map defaults = new LinkedHashMap();
    Collection values = defaultArguments.values();

    Iterator iter = values.iterator();
    while (iter.hasNext()) {
      ArgumentImpl argument = (ArgumentImpl) iter.next();
      defaults.put(argument.name(), argument.clone());
    }
    return defaults;
  }
Exemplo n.º 2
0
  private boolean hasTypeDiscriminatorFieldOrMethod(final Class<?> persistentType) {
    Collection<?> hits =
        eachField(
            persistentType,
            new Predicate<Field>() {
              public boolean apply(Field input) {
                return hasAnnotation(input, TypeDiscriminator.class);
              }
            });
    if (!hits.isEmpty()) {
      return true;
    }

    hits =
        eachMethod(
            persistentType,
            new Predicate<Method>() {
              public boolean apply(Method input) {
                return hasAnnotation(input, TypeDiscriminator.class);
              }
            });
    return !hits.isEmpty();
  }