public class DefaultRestMethodGenerator extends java.lang.Object implements IRestMethodGenerator
Constructor and Description |
---|
DefaultRestMethodGenerator() |
Modifier and Type | Method and Description |
---|---|
protected static void |
addMethodWrapper(MethodWrapper mw,
java.util.Set<MethodWrapper> methods)
A a method wrapper.
|
protected static void |
addPath(java.lang.String path,
java.util.Set<java.lang.String> paths)
Add a path to the set of paths.
|
java.util.List<RestMethodInfo> |
generateRestMethodInfos(jadex.bridge.service.IService service,
java.lang.ClassLoader classloader,
java.lang.Class<?> baseclass,
java.util.Map<java.lang.String,java.lang.Object> mapprops)
Generate the rest method infos.
|
protected static java.lang.String |
getPathName(java.lang.String path,
java.util.Set<java.lang.String> paths)
Get a path name based on a start name.
|
java.lang.Class<?> |
guessRestType(java.lang.reflect.Method method)
Guess the http type (GET, POST, PUT, DELETE, ...) of a method.
|
boolean |
hasStringConvertableParameters(java.lang.reflect.Method method,
java.lang.Class<?> rettype,
java.lang.Class<?>[] paramtypes)
Test if a method has parameters that are all convertible from string.
|
static boolean |
isStringConvertableType(java.lang.Class<?> type)
Test if a class is convertible from string.
|
public java.util.List<RestMethodInfo> generateRestMethodInfos(jadex.bridge.service.IService service, java.lang.ClassLoader classloader, java.lang.Class<?> baseclass, java.util.Map<java.lang.String,java.lang.Object> mapprops) throws java.lang.Exception
generateRestMethodInfos
in interface IRestMethodGenerator
service
- The Jadex service.classloader
- The classloader.baseclass
- The (abstract or concrete) baseclass or interface.mapprops
- Additional mapping properties.java.lang.Exception
public java.lang.Class<?> guessRestType(java.lang.reflect.Method method)
method
- The method.protected static void addMethodWrapper(MethodWrapper mw, java.util.Set<MethodWrapper> methods)
mw
- The method mapper.methods
- The set of method wrapper.protected static java.lang.String getPathName(java.lang.String path, java.util.Set<java.lang.String> paths)
path
- The path name.paths
- The already taken paths.protected static void addPath(java.lang.String path, java.util.Set<java.lang.String> paths)
path
- The path.paths
- The paths.public boolean hasStringConvertableParameters(java.lang.reflect.Method method, java.lang.Class<?> rettype, java.lang.Class<?>[] paramtypes)
method
- The method.rettype
- The return types (possibly unwrapped from future type).paramtypes
- The parameter types.public static boolean isStringConvertableType(java.lang.Class<?> type)