Search in sources :

Example 1 with MethodParamExtension

use of ru.vyarus.guice.persist.orient.repository.core.spi.parameter.MethodParamExtension in project guice-persist-orient by xvik.

the class ParamsService method processParameter.

@SuppressWarnings("unchecked")
private void processParameter(final ProcessingContext context, final Class<? extends RepositoryMethodDescriptor> descriptorType, final int pos, final Class<?> type, final Annotation... annotations) {
    final Annotation ext = ExtUtils.findParameterExtension(annotations);
    if (ext != null) {
        final Class<? extends MethodParamExtension> extension = ext.annotationType().getAnnotation(MethodParam.class).value();
        ExtCompatibilityUtils.checkParamExtensionCompatibility(descriptorType, extension);
        if (!context.extensionMap.containsKey(extension)) {
            final MethodParamExtension instance = injector.getInstance(extension);
            context.extensionMap.put(extension, instance);
        }
        context.extParams.put(extension, new ParamInfo(ext, pos, type));
    } else {
        context.ordinal.add(new ParamInfo(pos, type));
    }
}
Also used : MethodParamExtension(ru.vyarus.guice.persist.orient.repository.core.spi.parameter.MethodParamExtension) MethodParam(ru.vyarus.guice.persist.orient.repository.core.spi.parameter.MethodParam) Annotation(java.lang.annotation.Annotation) ParamInfo(ru.vyarus.guice.persist.orient.repository.core.spi.parameter.ParamInfo)

Aggregations

Annotation (java.lang.annotation.Annotation)1 MethodParam (ru.vyarus.guice.persist.orient.repository.core.spi.parameter.MethodParam)1 MethodParamExtension (ru.vyarus.guice.persist.orient.repository.core.spi.parameter.MethodParamExtension)1 ParamInfo (ru.vyarus.guice.persist.orient.repository.core.spi.parameter.ParamInfo)1