private Object defaultReturnValueFor(Method method) {
   if (method.getReturnType() == method.getDeclaringClass()) {
     return this;
   } else {
     return DefaultValue.forClass(method.getReturnType());
   }
 }
  @Nonnull
  public List<KeyValueRule> getRulesNode(Node node) {
    Node from = selectValue(node);
    if (from == null && defaultValue != null) {
      from = defaultValue.getDefaultValue(node);
    }

    if (from != null) {
      for (ConditionalRule option : options) {
        if (option.matches(from)) {
          return option.getRules();
        }
      }
    }

    return Collections.emptyList();
  }
Example #3
0
 public static String getValue(final String value, final DefaultValue valueType) {
   return (value != null && !value.equals("")) ? value : valueType.getDefaultValue();
 }