Examples of AnnotationBinding


Examples of org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding

    return null;
  }

  public static void maybeSetExportedField(FieldDeclaration x, JField field) {
    if (x.annotations != null) {
      AnnotationBinding jsExport = JdtUtil.getAnnotation(x.binding, JSEXPORT_CLASS);
      if (jsExport != null) {
        String value = JdtUtil.getAnnotationParameterString(jsExport, "value");
        if (value == null) {
          value = ""; // JDT bug? returns null sometimes instead of "" for default value
        }
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding

  }

  public static void maybeSetJsinteropMethodProperties(AbstractMethodDeclaration x,
      JMethod method) {
    if (x.annotations != null) {
      AnnotationBinding jsExport = JdtUtil.getAnnotation(x.binding, JSEXPORT_CLASS);
      AnnotationBinding jsProperty = JdtUtil.getAnnotation(x.binding, JSPROPERTY_CLASS);
      if (jsExport != null) {
        String value = JdtUtil.getAnnotationParameterString(jsExport, "value");
        if (value == null) {
          // JDT bug? returns null instead of "" sometimes for default
          value = "";
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding

  }

  public static JInterfaceType.JsInteropType maybeGetJsInteropType(TypeDeclaration x,
       String jsPrototype, JInterfaceType.JsInteropType interopType) {
    if (x.annotations != null) {
      AnnotationBinding jsInterface = JdtUtil.getAnnotation(x.binding, JSTYPE_CLASS);
      if (jsInterface != null) {
        boolean isNative = JdtUtil.getAnnotationParameterBoolean(jsInterface, "isNative");
        interopType = jsPrototype != null ?
            (isNative ? JDeclaredType.JsInteropType.NATIVE_PROTOTYPE :
            JDeclaredType.JsInteropType.JS_PROTOTYPE) : JDeclaredType.JsInteropType.NO_PROTOTYPE;
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding

    return interopType;
  }

  public static String maybeGetJsTypePrototype(TypeDeclaration x, String jsPrototype) {
    if (x.annotations != null) {
      AnnotationBinding jsType = JdtUtil.getAnnotation(x.binding, JSTYPE_CLASS);
      if (jsType != null) {
        jsPrototype = JdtUtil.getAnnotationParameterString(jsType, "prototype");
      }
    }
    return jsPrototype;
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding

    }
  }

  public static boolean isClassWideJsExport(TypeDeclaration x) {
    if (x.annotations != null) {
      AnnotationBinding jsExport = JdtUtil.getAnnotation(x.binding, JSEXPORT_CLASS);
      if (jsExport != null) {
        return true;
      }
    }
    return false;
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding

    return false;
  }

  public static void maybeSetJsNamespace(JDeclaredType type, TypeDeclaration x) {
    if (x.annotations != null) {
      AnnotationBinding jsNamespace = JdtUtil.getAnnotation(x.binding, JSNAMESPACE_CLASS);
      if (jsNamespace != null) {
        type.setJsNamespace(JdtUtil.getAnnotationParameterString(jsNamespace, "value"));
      } else {
        if (type.getSuperClass() != null && x.enclosingType != null) {
          maybeSetJsNamespace(type.getSuperClass(), x.enclosingType);
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding

              processAnnotationPropertyValue(info, array[i]).get(0));
        }
        return toReturn;

      } else if (value instanceof AnnotationBinding) {
        AnnotationBinding annotationBinding = (AnnotationBinding) value;
        ReferenceBinding annotationType = annotationBinding.getAnnotationType();
        JInterfaceType type = (JInterfaceType) typeMap.tryGet(annotationType);
        JAnnotation toReturn;
        if (type != null) {
          toReturn = new JAnnotation(info, type);
        } else {
          JInterfaceType external = getOrCreateExternalType(info,
              annotationType.compoundName);
          toReturn = new JAnnotation(info, external);
        }

        // Load the properties for the annotation value
        processAnnotationProperties(info, toReturn,
            annotationBinding.getElementValuePairs());

        return Lists.<JAnnotationArgument> create(toReturn);
      } else if (value instanceof FieldBinding) {
        FieldBinding fieldBinding = (FieldBinding) value;
        assert fieldBinding.constant() != null : "Expecting constant-valued field";
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding

  private void reportBinding(Object key, ASTRequestor astRequestor, WorkingCopyOwner owner, CompilationUnitDeclaration unit) {
    BindingKeyResolver keyResolver = (BindingKeyResolver) key;
    Binding compilerBinding = keyResolver.getCompilerBinding();
    if (compilerBinding != null) {
      DefaultBindingResolver resolver = new DefaultBindingResolver(unit.scope, owner, this.bindingTables, false, this.fromJavaProject);
      AnnotationBinding annotationBinding = keyResolver.getAnnotationBinding();
      IBinding binding;
      if (annotationBinding != null) {
        binding = resolver.getAnnotationInstance(annotationBinding);
      } else {
        binding = resolver.getBinding(compilerBinding);
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding

  private void reportBinding(Object key, FileASTRequestor astRequestor, CompilationUnitDeclaration unit) {
    BindingKeyResolver keyResolver = (BindingKeyResolver) key;
    Binding compilerBinding = keyResolver.getCompilerBinding();
    if (compilerBinding != null) {
      DefaultBindingResolver resolver = new DefaultBindingResolver(unit.scope, null, this.bindingTables, false, this.fromJavaProject);
      AnnotationBinding annotationBinding = keyResolver.getAnnotationBinding();
      IBinding binding;
      if (annotationBinding != null) {
        binding = resolver.getAnnotationInstance(annotationBinding);
      } else {
        binding = resolver.getBinding(compilerBinding);
View Full Code Here

Examples of org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding

    typeMap.setMethod(b, method);
  }

  private void maybeAddMethodSpecialization(AbstractMethodDeclaration x,
      JMethod method) {
    AnnotationBinding specializeAnnotation = JdtUtil
        .getAnnotation(x.binding, SpecializeMethod.class.getName());
    if (specializeAnnotation != null) {
      TypeBinding[] params = JdtUtil
          .getAnnotationParameterTypeBindingArray(
              specializeAnnotation, "params");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.