/** * Constructor. * * @param c The interface class annotated with a {@link RemoteResource @RemoteResource} annotation (optional). */ public RemoteResourceMeta(Class<?> c) { String path = ""; for (RemoteResource r : getAnnotationsParentFirst(RemoteResource.class, c)) if (! r.path().isEmpty()) path = trimSlashes(r.path()); Map<Method,RemoteMethodMeta> methods = new LinkedHashMap<>(); for (Method m : c.getMethods()) if (isPublic(m)) methods.put(m, new RemoteMethodMeta(path, m, false, "GET")); this.methods = unmodifiableMap(methods); this.path = path; }
/** * Constructor. * * @param c The interface class annotated with a {@link RemoteResource @RemoteResource} annotation (optional). */ public RemoteResourceMeta(Class<?> c) { String path = ""; for (RemoteResource r : getAnnotationsParentFirst(RemoteResource.class, c)) if (! r.path().isEmpty()) path = trimSlashes(r.path()); Map<Method,RemoteMethodMeta> methods = new LinkedHashMap<>(); for (Method m : c.getMethods()) if (isPublic(m)) methods.put(m, new RemoteMethodMeta(path, m, false, "GET")); this.methods = unmodifiableMap(methods); this.path = path; }
/** * Constructor. * * @param c The interface class annotated with a {@link RemoteResource @RemoteResource} annotation (optional). */ public RemoteResourceMeta(Class<?> c) { String path = ""; for (RemoteResource r : getAnnotationsParentFirst(RemoteResource.class, c)) if (! r.path().isEmpty()) path = trimSlashes(r.path()); Map<Method,RemoteMethodMeta> methods = new LinkedHashMap<>(); for (Method m : c.getMethods()) if (isPublic(m)) methods.put(m, new RemoteMethodMeta(path, m, false, "GET")); this.methods = unmodifiableMap(methods); this.path = path; }
HttpPartSchemaBuilder apply(Class<? extends Annotation> c, java.lang.reflect.Type t) { if (t instanceof Class<?>) { Class<?> tc = (Class<?>)t; for (Annotation a : ClassUtils.getAnnotationsParentFirst(c, tc)) apply(a); } else if (Value.isType(t)) { apply(c, Value.getParameterType(t)); } return this; }
HttpPartSchemaBuilder apply(Class<? extends Annotation> c, java.lang.reflect.Type t) { if (t instanceof Class<?>) { Class<?> tc = (Class<?>)t; for (Annotation a : ClassUtils.getAnnotationsParentFirst(c, tc)) apply(a); } else if (Value.isType(t)) { apply(c, Value.getParameterType(t)); } return this; }
HttpPartSchemaBuilder apply(Class<? extends Annotation> c, java.lang.reflect.Type t) { if (t instanceof Class<?>) { Class<?> tc = (Class<?>)t; for (Annotation a : ClassUtils.getAnnotationsParentFirst(c, tc)) apply(a); } else if (Value.isType(t)) { apply(c, Value.getParameterType(t)); } return this; }
Builder(RestContext context) { for (RestResource r : getAnnotationsParentFirst(RestResource.class, context.getResource().getClass())) { if (! r.siteName().isEmpty()) siteName = r.siteName(); if (r.title().length > 0) title = joinnl(r.title()); if (r.description().length > 0) description = joinnl(r.description()); } } }
Builder(RestContext context) { for (RestResource r : getAnnotationsParentFirst(RestResource.class, context.getResource().getClass())) { if (! r.siteName().isEmpty()) siteName = r.siteName(); if (r.title().length > 0) title = joinnl(r.title()); if (r.description().length > 0) description = joinnl(r.description()); } } }
Builder(RestContext context) { for (RestResource r : getAnnotationsParentFirst(RestResource.class, context.getResource().getClass())) { if (! r.siteName().isEmpty()) siteName = r.siteName(); if (r.title().length > 0) title = joinnl(r.title()); if (r.description().length > 0) description = joinnl(r.description()); } } }
/** * Create metadata from specified method return. * * @param m The method annotated with {@link Response}. * @param ps * Configuration information used to instantiate part serializers and part parsers. * <br>Can be <jk>null</jk>. * @return Metadata about the class, or <jk>null</jk> if class not annotated with {@link Response}. */ public static ResponseBeanMeta create(Method m, PropertyStore ps) { if (! hasAnnotation(Response.class, m)) return null; Builder b = new Builder(ps); Type t = m.getGenericReturnType(); if (Value.isType(t)) b.apply(Value.getParameterType(t)); else b.apply(t); for (Response r : getAnnotationsParentFirst(Response.class, m)) b.apply(r); return b.build(); }
/** * Create metadata from specified method parameter. * * @param m The method containing the parameter annotated with {@link Response}. * @param i The parameter index. * @param ps * Configuration information used to instantiate part serializers and part parsers. * <br>Can be <jk>null</jk>. * @return Metadata about the class, or <jk>null</jk> if class not annotated with {@link Response}. */ public static ResponseBeanMeta create(Method m, int i, PropertyStore ps) { if (! hasAnnotation(Response.class, m, i)) return null; Builder b = new Builder(ps); Type t = m.getGenericParameterTypes()[i]; if (Value.isType(t)) b.apply(Value.getParameterType(t)); else b.apply(t); for (Response r : getAnnotationsParentFirst(Response.class, m, i)) b.apply(r); return b.build(); }
/** * Create metadata from specified method return. * * @param m The method annotated with {@link Response}. * @param ps * Configuration information used to instantiate part serializers and part parsers. * <br>Can be <jk>null</jk>. * @return Metadata about the class, or <jk>null</jk> if class not annotated with {@link Response}. */ public static ResponseBeanMeta create(Method m, PropertyStore ps) { if (! hasAnnotation(Response.class, m)) return null; Builder b = new Builder(ps); Type t = m.getGenericReturnType(); if (Value.isType(t)) b.apply(Value.getParameterType(t)); else b.apply(t); for (Response r : getAnnotationsParentFirst(Response.class, m)) b.apply(r); return b.build(); }
/** * Create metadata from specified method return. * * @param m The method annotated with {@link Response}. * @param ps * Configuration information used to instantiate part serializers and part parsers. * <br>Can be <jk>null</jk>. * @return Metadata about the class, or <jk>null</jk> if class not annotated with {@link Response}. */ public static ResponseBeanMeta create(Method m, PropertyStore ps) { if (! hasAnnotation(Response.class, m)) return null; Builder b = new Builder(ps); Type t = m.getGenericReturnType(); if (Value.isType(t)) b.apply(Value.getParameterType(t)); else b.apply(t); for (Response r : getAnnotationsParentFirst(Response.class, m)) b.apply(r); return b.build(); }
/** * Create metadata from specified method parameter. * * @param m The method containing the parameter annotated with {@link Response}. * @param i The parameter index. * @param ps * Configuration information used to instantiate part serializers and part parsers. * <br>Can be <jk>null</jk>. * @return Metadata about the class, or <jk>null</jk> if class not annotated with {@link Response}. */ public static ResponseBeanMeta create(Method m, int i, PropertyStore ps) { if (! hasAnnotation(Response.class, m, i)) return null; Builder b = new Builder(ps); Type t = m.getGenericParameterTypes()[i]; if (Value.isType(t)) b.apply(Value.getParameterType(t)); else b.apply(t); for (Response r : getAnnotationsParentFirst(Response.class, m, i)) b.apply(r); return b.build(); }
static RequestBeanPropertyMeta.Builder create(HttpPartType partType, Class<? extends Annotation> c, Method m) { HttpPartSchemaBuilder sb = HttpPartSchema.create().name(getPropertyName(m)); for (Annotation a : getAnnotationsParentFirst(c, m)) sb.apply(a); return new Builder().partType(partType).schema(sb.build()).getter(m); }
static RequestBeanPropertyMeta.Builder create(HttpPartType partType, Class<? extends Annotation> c, Method m) { HttpPartSchemaBuilder sb = HttpPartSchema.create().name(getPropertyName(m)); for (Annotation a : getAnnotationsParentFirst(c, m)) sb.apply(a); return new Builder().partType(partType).schema(sb.build()).getter(m); }
static RequestBeanPropertyMeta.Builder create(HttpPartType partType, Class<? extends Annotation> c, Method m) { HttpPartSchemaBuilder sb = HttpPartSchema.create().name(getPropertyName(m)); for (Annotation a : getAnnotationsParentFirst(c, m)) sb.apply(a); return new Builder().partType(partType).schema(sb.build()).getter(m); }
/** * Create metadata from specified class. * * @param t The class annotated with {@link Response}. * @param ps * Configuration information used to instantiate part serializers and part parsers. * <br>Can be <jk>null</jk>. * @return Metadata about the class, or <jk>null</jk> if class not annotated with {@link Response}. */ public static ResponseBeanMeta create(Type t, PropertyStore ps) { if (! hasAnnotation(Response.class, t)) return null; Builder b = new Builder(ps); if (Value.isType(t)) b.apply(Value.getParameterType(t)); else b.apply(t); for (Response r : getAnnotationsParentFirst(Response.class, t)) b.apply(r); return b.build(); }
/** * Create metadata from specified class. * * @param t The class annotated with {@link Response}. * @param ps * Configuration information used to instantiate part serializers and part parsers. * <br>Can be <jk>null</jk>. * @return Metadata about the class, or <jk>null</jk> if class not annotated with {@link Response}. */ public static ResponseBeanMeta create(Type t, PropertyStore ps) { if (! hasAnnotation(Response.class, t)) return null; Builder b = new Builder(ps); if (Value.isType(t)) b.apply(Value.getParameterType(t)); else b.apply(t); for (Response r : getAnnotationsParentFirst(Response.class, t)) b.apply(r); return b.build(); }
/** * Create metadata from specified class. * * @param t The class annotated with {@link Response}. * @param ps * Configuration information used to instantiate part serializers and part parsers. * <br>Can be <jk>null</jk>. * @return Metadata about the class, or <jk>null</jk> if class not annotated with {@link Response}. */ public static ResponseBeanMeta create(Type t, PropertyStore ps) { if (! hasAnnotation(Response.class, t)) return null; Builder b = new Builder(ps); if (Value.isType(t)) b.apply(Value.getParameterType(t)); else b.apply(t); for (Response r : getAnnotationsParentFirst(Response.class, t)) b.apply(r); return b.build(); }