static boolean sessionScoped(BeanSpec spec) { return spec.hasAnnotation(SessionScoped.class) || spec.hasAnnotation(org.osgl.inject.annotation.SessionScoped.class); }
private boolean checkRequired(BeanSpec spec) { return (spec.hasAnnotation(NotNull.class) || spec.hasAnnotation(NotBlank.class) || spec.hasAnnotation(NotEmpty.class)); }
private boolean checkRequired(BeanSpec spec) { return (spec.hasAnnotation(NotNull.class) || spec.hasAnnotation(NotBlank.class) || spec.hasAnnotation(NotEmpty.class)); }
static boolean sessionScoped(BeanSpec spec) { return spec.hasAnnotation(SessionScoped.class) || spec.hasAnnotation(org.osgl.inject.annotation.SessionScoped.class); }
private static ScopeCacheSupport scopeCacheSupport(BeanSpec spec) { if (spec.hasAnnotation(RequestScoped.class) || spec.hasAnnotation(org.osgl.inject.annotation.RequestScoped.class)) { return RequestScope.INSTANCE; } else if (sessionScoped(spec)) { return SessionScope.INSTANCE; } else if (spec.hasAnnotation(Dependent.class) || spec.hasAnnotation(New.class)) { return DependentScope.INSTANCE; } // Default to Request Scope return RequestScope.INSTANCE; }
private static ScopeCacheSupport scopeCacheSupport(BeanSpec spec) { if (spec.hasAnnotation(RequestScoped.class) || spec.hasAnnotation(org.osgl.inject.annotation.RequestScoped.class)) { return RequestScope.INSTANCE; } else if (sessionScoped(spec)) { return SessionScope.INSTANCE; } else if (spec.hasAnnotation(Dependent.class) || spec.hasAnnotation(New.class)) { return DependentScope.INSTANCE; } // Default to Request Scope return RequestScope.INSTANCE; }
return true; if (beanSpec.hasAnnotation(Inject.class)) { return true; if (beanSpec.hasAnnotation(tag)) { return true; return beanSpec.hasAnnotation(Singleton.class);
return true; if (beanSpec.hasAnnotation(Inject.class)) { return true; if (beanSpec.hasAnnotation(tag)) { return true; return beanSpec.hasAnnotation(Singleton.class);
String interpret(BeanSpec beanSpec) { if (beanSpec.hasAnnotation(DbBind.class)) { return "String";
String interpret(BeanSpec beanSpec) { if (beanSpec.hasAnnotation(DbBind.class)) { return "String";
private JsonDtoPatch(String name, BeanSpec spec) { this.name = S.requireNotBlank(name); this.loader = valueLoaderOf(spec); if (null == loader) { for (BeanSpec fieldSpec : spec.nonStaticFields()) { Class fieldType = fieldSpec.rawType(); if (fieldSpec.isTransient() || fieldSpec.hasAnnotation(Transient.class)) { continue; } if (Collection.class.isAssignableFrom(fieldType) || Map.class.isAssignableFrom(fieldType)) { continue; } String fieldName = fieldSpec.name(); JsonDtoPatch child = new JsonDtoPatch(fieldName, fieldSpec); if (!child.isEmpty()) { fieldsPatches.add(child); } } } }
private JsonDtoPatch(String name, BeanSpec spec) { this.name = S.requireNotBlank(name); this.loader = valueLoaderOf(spec); if (null == loader) { for (BeanSpec fieldSpec : spec.nonStaticFields()) { Class fieldType = fieldSpec.rawType(); if (fieldSpec.isTransient() || fieldSpec.hasAnnotation(Transient.class)) { continue; } if (Collection.class.isAssignableFrom(fieldType) || Map.class.isAssignableFrom(fieldType)) { continue; } String fieldName = fieldSpec.name(); JsonDtoPatch child = new JsonDtoPatch(fieldName, fieldSpec); if (!child.isEmpty()) { fieldsPatches.add(child); } } } }
notNull = spec.hasAnnotation(NotNull.class); findOne = !(Iterable.class.isAssignableFrom(rawType)); dao = app.dbServiceManager().dao(findOne ? rawType : (Class) spec.typeParams().get(0));
notNull = spec.hasAnnotation(NotNull.class); findOne = !(Iterable.class.isAssignableFrom(rawType)); dao = app.dbServiceManager().dao(findOne ? rawType : (Class) spec.typeParams().get(0));
public boolean isProvided(BeanSpec beanSpec) { Class rawType = beanSpec.rawType(); boolean provided = (ActProviders.isProvided(rawType) || null != beanSpec.getAnnotation(Inject.class) || null != beanSpec.getAnnotation(Provided.class) || null != beanSpec.getAnnotation(Context.class) || null != beanSpec.getAnnotation(Singleton.class) || beanSpec.isInstanceOf(SingletonBase.class) || subjectToInject(beanSpec) ); return provided && (!($.isSimpleType(rawType) && !beanSpec.hasAnnotation())); }
if (null != namedProvider && spec.hasAnnotation(Named.class)) { final String name = spec.name(); return new Provider<Object>() {
public boolean isProvided(BeanSpec beanSpec) { Class rawType = beanSpec.rawType(); boolean provided = (ActProviders.isProvided(rawType) || null != beanSpec.getAnnotation(Inject.class) || null != beanSpec.getAnnotation(Provided.class) || null != beanSpec.getAnnotation(Context.class) || null != beanSpec.getAnnotation(Singleton.class) || beanSpec.isInstanceOf(SingletonBase.class) || subjectToInject(beanSpec) ); return provided && (!($.isSimpleType(rawType) && !beanSpec.hasAnnotation())); }
private ParamValueLoader findLoader( String bindName, BeanSpec spec ) { if (provided(spec, injector)) { return ProvidedValueLoader.get(spec, injector); } if (spec.hasAnnotation(NoBind.class)) { return null; } if (null == bindName) { bindName = bindName(spec.allAnnotations(), spec.name()); } ParamValueLoader loader = findContextSpecificLoader(bindName, spec); if (null == loader) { return null; } return decorate(loader, spec, supportJsonDecorator(), false); }
private ParamValueLoader findLoader( String bindName, BeanSpec spec ) { if (provided(spec, injector)) { return ProvidedValueLoader.get(spec, injector); } if (spec.hasAnnotation(NoBind.class)) { return null; } if (null == bindName) { bindName = bindName(spec.allAnnotations(), spec.name()); } ParamValueLoader loader = findContextSpecificLoader(bindName, spec); if (null == loader) { return null; } return decorate(loader, spec, supportJsonDecorator(), false); }
if (spec.hasAnnotation(PartialPath.class)) { return new PartialPathLoader(bindName);