if (annotatedMember.isAnnotationPresent(OAuthApplication.class)) {
if (annotatedMember instanceof AnnotatedField) {
final OAuthApplication app = annotatedMember.getAnnotation(OAuthApplication.class);
OAuthAppSettingsBuilder builderOAuthApp = null;
Class<? extends OAuthAppSettingsBuilder> builderClass = app.builder();
if (builderClass == OAuthAppSettingsBuilder.class) {
log.info("You didn't provide a Concrete OAuthAppSettingsBuilder class using the default " +
"PropertyOAuthAppSettingsBuilder class");
builderClass = PropertyOAuthAppSettingsBuilder.class;
}
try {
builderOAuthApp = builderClass.newInstance();
} catch (Exception e) {
pp.addDefinitionError(new AgoravaException("Unable to create Settings Builder with class " +
builderClass, e));
}
builderOAuthApp.qualifier(qual)
.params(app.params());
pp.setProducer(new OAuthAppSettingsProducerWithBuilder(builderOAuthApp, qual));
} else
pp.addDefinitionError(new AgoravaException("@OAuthApplication are only supported on Field. Agorava cannot " +