documentation is now generated during build time and swagger is not needed for runtime anymore

This commit is contained in:
Athou
2013-08-01 13:35:04 +02:00
parent 0ff1d58dfb
commit 8926f9784d
29 changed files with 128 additions and 430 deletions

View File

@@ -1,58 +0,0 @@
package com.commafeed.frontend.utils;
import org.apache.wicket.model.PropertyModel;
import ch.lambdaj.Lambda;
import ch.lambdaj.function.argument.Argument;
import ch.lambdaj.function.argument.ArgumentsFactory;
/**
* Utility class to generate PropertyModels in a type-safe way
*
*/
public class ModelFactory {
public static <T> String invokedProperty(T proxiedValue) {
Argument<T> a = ArgumentsFactory.actualArgument(proxiedValue);
return a.getInkvokedPropertyName();
}
public static <T> PropertyModel<T> model(Object value, T proxiedValue) {
String invokedPN = invokedProperty(proxiedValue);
PropertyModel<T> m = new PropertyModel<T>(value, invokedPN);
return m;
}
@SuppressWarnings("unchecked")
public static <T> T proxy(T t) {
Object object = Lambda.on(t.getClass());
return (T) object;
}
public static <T> T proxy(Class<T> clazz) {
return Lambda.on(clazz);
}
/**
* shortcuts to ModelFactory
*
*/
public static class MF {
public static <T> String i(T proxiedValue) {
return ModelFactory.invokedProperty(proxiedValue);
}
public static <T> PropertyModel<T> m(Object value, T proxiedValue) {
return ModelFactory.model(value, proxiedValue);
}
public static <T> T p(T t) {
return ModelFactory.proxy(t);
}
public static <T> T p(Class<T> clazz) {
return ModelFactory.proxy(clazz);
}
}
}