Search in sources :

Example 6 with Binding

use of com.microsoft.azure.toolkit.lib.legacy.function.bindings.Binding in project azure-tools-for-java by Microsoft.

the class FunctionUtils method parseAnnotations.

private static List<Binding> parseAnnotations(final Project project, JvmAnnotation[] annotations) throws AzureExecutionException {
    final List<Binding> bindings = new ArrayList<>();
    for (final JvmAnnotation annotation : annotations) {
        final Binding binding = getBinding(project, annotation);
        if (binding != null) {
            Log.debug("Adding binding: " + binding.toString());
            bindings.add(binding);
        }
    }
    return bindings;
}
Also used : Binding(com.microsoft.azure.toolkit.lib.legacy.function.bindings.Binding) JvmAnnotation(com.intellij.lang.jvm.JvmAnnotation) ArrayList(java.util.ArrayList)

Example 7 with Binding

use of com.microsoft.azure.toolkit.lib.legacy.function.bindings.Binding in project azure-tools-for-java by Microsoft.

the class FunctionUtils method createBinding.

private static Binding createBinding(final Project project, BindingEnum bindingEnum, PsiAnnotation annotation) throws AzureExecutionException {
    final Binding binding = new Binding(bindingEnum);
    AnnotationHelper.evaluateAnnotationProperties(project, annotation, REQUIRED_ATTRIBUTE_MAP.get(bindingEnum)).forEach((name, value) -> {
        binding.setAttribute(name, value);
    });
    return binding;
}
Also used : Binding(com.microsoft.azure.toolkit.lib.legacy.function.bindings.Binding)

Aggregations

Binding (com.microsoft.azure.toolkit.lib.legacy.function.bindings.Binding)7 ArrayList (java.util.ArrayList)4 JsonObject (com.google.gson.JsonObject)3 JvmAnnotation (com.intellij.lang.jvm.JvmAnnotation)2 PsiAnnotation (com.intellij.psi.PsiAnnotation)2 PsiJavaCodeReferenceElement (com.intellij.psi.PsiJavaCodeReferenceElement)2 FunctionConfiguration (com.microsoft.azure.toolkit.lib.legacy.function.configurations.FunctionConfiguration)2 HashMap (java.util.HashMap)2 LinkedHashMap (java.util.LinkedHashMap)2 AnnotationUtil (com.intellij.codeInsight.AnnotationUtil)1 MetaAnnotationUtil (com.intellij.codeInsight.MetaAnnotationUtil)1 JvmParameter (com.intellij.lang.jvm.JvmParameter)1 Module (com.intellij.openapi.module.Module)1 ModuleManager (com.intellij.openapi.module.ModuleManager)1 Project (com.intellij.openapi.project.Project)1 CompilerModuleExtension (com.intellij.openapi.roots.CompilerModuleExtension)1 OrderEnumerator (com.intellij.openapi.roots.OrderEnumerator)1 OrderRootType (com.intellij.openapi.roots.OrderRootType)1 Library (com.intellij.openapi.roots.libraries.Library)1 VirtualFile (com.intellij.openapi.vfs.VirtualFile)1