protected StringValueResolverValueLoaderBase(StringValueResolverValueLoaderBase parent, Class<?> runtimeType, StringValueResolver resolver, Object defVal) { this.injector = parent.injector; this.resolverManager = parent.resolverManager; this.requireRuntimeType = false; this.paramKey = parent.paramKey; this.param = parent.param; this.defVal = defVal; this.stringValueResolver = resolver; this.defSpec = parent.defSpec; this.paramSpec = BeanSpec.of(runtimeType, this.injector); }
private ArrayProvider(Class elementType, Genie genie) { this.elementType = elementType; this.listSpec = BeanSpec.of(ArrayList.class, null, genie); this.genie = genie; }
protected StringValueResolverValueLoaderBase(StringValueResolverValueLoaderBase parent, Class<?> runtimeType, StringValueResolver resolver, Object defVal) { this.injector = parent.injector; this.resolverManager = parent.resolverManager; this.requireRuntimeType = false; this.paramKey = parent.paramKey; this.param = parent.param; this.defVal = defVal; this.stringValueResolver = resolver; this.defSpec = parent.defSpec; this.paramSpec = BeanSpec.of(runtimeType, this.injector); }
private BeanSpec beanSpecOf(Field field, Type genericType) { return of(field, genericType, injector); // int len = typeArgs.size(); // for (int i = 0; i < len; ++i) { // if (genericType.equals(typeArgs.get(i))) { // return of(field, typeImpls.get(i), injector()); // } // } // return of(field, injector); }
private BeanSpec beanSpecOf(Class type) { BeanSpec spec = beanSpecLookup.get(type); if (null == spec) { spec = BeanSpec.of(type, this); beanSpecLookup.putIfAbsent(type, spec); } return spec; }
private BeanSpec beanSpecOf(Class type) { BeanSpec spec = beanSpecLookup.get(type); if (null == spec) { spec = BeanSpec.of(type, this); beanSpecLookup.putIfAbsent(type, spec); } return spec; }
BeanSpec beanSpec(Genie genie) { BeanSpec spec = BeanSpec.of(type, annotations.toArray(new Annotation[annotations.size()]), name, genie); if (scope != null) { spec.scope(scope); } return spec; }
BeanSpec beanSpec(Genie genie) { BeanSpec spec = BeanSpec.of(type, annotations.toArray(new Annotation[annotations.size()]), name, genie); if (scope != null) { spec.scope(scope); } return spec; }
public static BeanSpec of(Field field, Injector injector, Map<String, Class> typeParamLookup) { Annotation[] annotations = field.getDeclaredAnnotations(); Type fieldType = field.getGenericType(); if (fieldType instanceof TypeVariable) { fieldType = field.getType(); } return BeanSpec.of(fieldType, annotations, field.getName(), injector, field.getModifiers(), typeParamLookup).setField(field); }
BeanSpec returnType(App app) { return BeanSpec.of(method.getGenericReturnType(), null, app.injector()); }
public static <T> T load(String path, Class<T> type, Object hint, boolean ignoreResourceNotFound) { return __load(path, BeanSpec.of(type, injector), hint, ignoreResourceNotFound); }
public BeanSpec parent() { Class<?> rawType = rawType(); Type type = rawType.getGenericSuperclass(); type = null == type ? rawType.getSuperclass() : type; return null == type ? null : BeanSpec.of(type, injector()); }
public static Spec spec(Method action) { Type type = Method.class; Annotation[] annotations = action.getDeclaredAnnotations(); return spec(BeanSpec.of(type, annotations, Act.injector())); }
public static Spec spec(Method action) { Type type = Method.class; Annotation[] annotations = action.getDeclaredAnnotations(); return spec(BeanSpec.of(type, annotations, Act.injector())); }
public static Spec spec(Method action) { Type type = Method.class; Annotation[] annotations = action.getDeclaredAnnotations(); return spec(BeanSpec.of(type, annotations, Act.injector())); }
private BeanSpec valueSpec() { List<Type> typeParams = targetSpec.typeParams(); E.illegalArgumentIf(typeParams.size() != 2); return BeanSpec.of(typeParams.get(1), targetSpec.injector()); } }
private Object generateSampleData_(Class<?> modelType) { BeanSpec spec = BeanSpec.of(modelType, Act.injector()); return Endpoint.generateSampleData(spec, C.<String, Class>Map(), new HashSet<Type>(), new ArrayList<String>(), null, false); }
public static <T> T load(String path, TypeReference<T> typeReference, boolean ignoreResourceNotFound) { BeanSpec spec = BeanSpec.of(typeReference.getType(), injector); return load(path, spec, ignoreResourceNotFound); }
public static <T> T load(String path, TypeReference<T> typeReference, Object hint, boolean ignoreResourceNotFound) { BeanSpec spec = BeanSpec.of(typeReference.getType(), injector); return __load(path, spec, hint, ignoreResourceNotFound); }
private void exploreTypes() { Map<String, Class> typeParamLookup = Generics.buildTypeParamImplLookup(getClass()); List<Type> types = Generics.typeParamImplementations(getClass(), SimpleRestfulServiceBase.class); int sz = types.size(); if (sz < 3) { throw new IllegalArgumentException("Cannot determine DAO type"); } Type daoType = types.get(2); BeanSpec spec = BeanSpec.of(daoType, Act.injector(), typeParamLookup); DaoLoader loader = Act.getInstance(DaoLoader.class); dao = $.cast(loader.load(spec)); }