Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
pepite committed Mar 22, 2011
1 parent 7dc01de commit 325dfe3
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions framework/src/play/data/binding/Binder.java
Original file line number Diff line number Diff line change
Expand Up @@ -399,16 +399,7 @@ public static Object directBind(String name, Annotation[] annotations, String va
}
}

// custom types
for (Class<?> c : supportedTypes.keySet()) {
Logger.trace("directBind: value [" + value + "] c [" + c + "] Class [" + clazz + "]");
if (c.isAssignableFrom(clazz)) {
Logger.trace("directBind: isAssignableFrom is true");
return supportedTypes.get(c).bind(name, annotations, value, clazz, type);
}
}

// application custom types
// application custom types have higher priority
for (Class<TypeBinder<?>> c : Play.classloader.getAssignableClasses(TypeBinder.class)) {
if (c.isAnnotationPresent(Global.class)) {
Class<?> forType = (Class) ((ParameterizedType) c.getGenericInterfaces()[0]).getActualTypeArguments()[0];
Expand All @@ -418,6 +409,15 @@ public static Object directBind(String name, Annotation[] annotations, String va
}
}

// custom types
for (Class<?> c : supportedTypes.keySet()) {
Logger.trace("directBind: value [" + value + "] c [" + c + "] Class [" + clazz + "]");
if (c.isAssignableFrom(clazz)) {
Logger.trace("directBind: isAssignableFrom is true");
return supportedTypes.get(c).bind(name, annotations, value, clazz, type);
}
}

// raw String
if (clazz.equals(String.class)) {
return value;
Expand Down

0 comments on commit 325dfe3

Please sign in to comment.