Package com.sun.mirror.declaration

Examples of com.sun.mirror.declaration.MethodDeclaration


    writer.println(") {");
    writer.println("\t\treturn ");

    boolean first = true;
    while ( methods.hasNext() ) {
      MethodDeclaration method = methods.next();
      if ( method.getAnnotation(Alternate.class) != null )
        continue;

      if ( !first )
        writer.println(" &");
      else
        first = false;

      optional = method.getAnnotation(Optional.class) != null;
      deprecated = method.getAnnotation(DeprecatedGL.class) != null;
      dependent = method.getAnnotation(Dependent.class);

      writer.print("\t\t\t(");
      if ( optional )
        writer.print('(');
      if ( deprecated )
        writer.print("forwardCompatible || ");
      if ( dependent != null ) {
        if ( dependent.value().indexOf(',') == -1 )
          writer.print("!supported_extensions.contains(\"" + dependent.value() + "\") || ");
        else {
          writer.print("!(false");
          for ( String extension : dependent.value().split(",") )
            writer.print(" || supported_extensions.contains(\"" + extension + "\")");
          writer.print(") || ");
        }
      }
      if ( deprecated || dependent != null )
        writer.print('(');
      writer.print(Utils.getFunctionAddressName(d, method) + " = ");
      PlatformDependent platform_dependent = method.getAnnotation(PlatformDependent.class);
      if ( platform_dependent != null ) {
        EnumSet<Platform> platform_set = EnumSet.copyOf(Arrays.asList(platform_dependent.value()));
        writer.print("GLContext.getPlatformSpecificFunctionAddress(\"");
        writer.print(Platform.ALL.getPrefix() + "\", ");
        writer.print("new String[]{");
        Iterator<Platform> platforms = platform_set.iterator();
        while ( platforms.hasNext() ) {
          writer.print("\"" + platforms.next().getOSPrefix() + "\"");
          if ( platforms.hasNext() )
            writer.print(", ");
        }
        writer.print("}, new String[]{");
        platforms = platform_set.iterator();
        while ( platforms.hasNext() ) {
          writer.print("\"" + platforms.next().getPrefix() + "\"");
          if ( platforms.hasNext() )
            writer.print(", ");
        }
        writer.print("}, ");
      } else if ( aliased ) {
        writer.print("GLContext.getFunctionAddress(new String[] {\"" + method.getSimpleName() + "\",\"" + method.getSimpleName() + alias_annotation.postfix() + "\"})) != 0");
      } else
        writer.print("GLContext.getFunctionAddress(");
      if ( !aliased )
        writer.print("\"" + method.getSimpleName() + "\")) != 0");
      if ( deprecated || dependent != null )
        writer.print(')');
      if ( optional )
        writer.print(" || true)");
    }
View Full Code Here


    writer.println("\tprivate static boolean " + getExtensionSupportedName(d.getSimpleName()) + "() {");
    writer.println("\t\treturn ");

    boolean first = true;
    while ( methods.hasNext() ) {
      MethodDeclaration method = methods.next();
      if ( method.getAnnotation(Alternate.class) != null )
        continue;

      if ( !first )
        writer.println(" &");
      else
        first = false;

      final boolean optional = method.getAnnotation(Optional.class) != null;

      writer.print("\t\t\t");
      if ( optional )
        writer.print('(');
      writer.print(Utils.getFunctionAddressName(d, method) + " != 0");
View Full Code Here

    // find attributes to be skipped
    for (Declaration declaration : loxiaSkipDeclarations) {
      // types will be ignored when hierarchy is scanned
      if (declaration instanceof MethodDeclaration) {
        MethodDeclaration methodDeclaration = (MethodDeclaration) declaration;
        String typeName = methodDeclaration.getDeclaringType().getQualifiedName();
        String methodName = methodDeclaration.getSimpleName();
        String name = String.valueOf(Character.toLowerCase(methodName.charAt(3))) + methodName.substring(4);
        Tag tag = tags.get(typeName);
        if (tag != null) {
          // if it is on an abstract class, there is not tag for it at
          // this point
          tags.get(typeName).addSkipAttribute(name);
        }
      }
    }

    // find Tags Attributes
    for (Declaration declaration : loxiaAttributesDeclarations) {
      // type
      MethodDeclaration methodDeclaration = (MethodDeclaration) declaration;
      String typeName = methodDeclaration.getDeclaringType().getQualifiedName();
      Map<String, Object> values = getValues(methodDeclaration, loxiaTagAttributeDeclaration);
      // create Attribute and apply values found
      TagAttribute attribute = new TagAttribute();
      String name = (String) values.get("name");
      if (name == null || name.length() == 0) {
        // get name from method
        String methodName = methodDeclaration.getSimpleName();
        name = String.valueOf(Character.toLowerCase(methodName.charAt(3))) + methodName.substring(4);
      }
      values.put("name", name);
      populateTagAttributes(attribute, values);
      // add to map
View Full Code Here

    writer.println(") {");
    writer.println("\t\treturn ");

    boolean first = true;
    while ( methods.hasNext() ) {
      MethodDeclaration method = methods.next();
      if ( method.getAnnotation(Alternate.class) != null )
        continue;

      if ( !first )
        writer.println(" &");
      else
        first = false;

      optional = method.getAnnotation(Optional.class) != null;
      deprecated = method.getAnnotation(DeprecatedGL.class) != null;
      dependent = method.getAnnotation(Dependent.class);

      writer.print("\t\t\t(");
      if ( optional )
        writer.print('(');
      if ( deprecated )
        writer.print("forwardCompatible || ");
      if ( dependent != null ) {
        if ( dependent.value().indexOf(',') == -1 )
          writer.print("!supported_extensions.contains(\"" + dependent.value() + "\") || ");
        else {
          writer.print("!(false");
          for ( String extension : dependent.value().split(",") )
            writer.print(" || supported_extensions.contains(\"" + extension + "\")");
          writer.print(") || ");
        }
      }
      if ( deprecated || dependent != null )
        writer.print('(');
      writer.print(Utils.getFunctionAddressName(d, method) + " = ");
      PlatformDependent platform_dependent = method.getAnnotation(PlatformDependent.class);
      if ( platform_dependent != null ) {
        EnumSet<Platform> platform_set = EnumSet.copyOf(Arrays.asList(platform_dependent.value()));
        writer.print("GLContext.getPlatformSpecificFunctionAddress(\"");
        writer.print(Platform.ALL.getPrefix() + "\", ");
        writer.print("new String[]{");
        Iterator<Platform> platforms = platform_set.iterator();
        while ( platforms.hasNext() ) {
          writer.print("\"" + platforms.next().getOSPrefix() + "\"");
          if ( platforms.hasNext() )
            writer.print(", ");
        }
        writer.print("}, new String[]{");
        platforms = platform_set.iterator();
        while ( platforms.hasNext() ) {
          writer.print("\"" + platforms.next().getPrefix() + "\"");
          if ( platforms.hasNext() )
            writer.print(", ");
        }
        writer.print("}, ");
      } else if ( aliased ) {
        writer.print("GLContext.getFunctionAddress(new String[] {\"" + method.getSimpleName() + "\",\"" + method.getSimpleName() + alias_annotation.postfix() + "\"})) != 0");
      } else
        writer.print("GLContext.getFunctionAddress(");
      if ( !aliased )
        writer.print("\"" + method.getSimpleName() + "\")) != 0");
      if ( deprecated || dependent != null )
        writer.print(')');
      if ( optional )
        writer.print(" || true)");
    }
View Full Code Here

    writer.println(") {");
    writer.println("\t\treturn ");

    boolean first = true;
    while ( methods.hasNext() ) {
      MethodDeclaration method = methods.next();
      if ( method.getAnnotation(Alternate.class) != null )
        continue;

      if ( !first )
        writer.println(" &");
      else
        first = false;

      optional = method.getAnnotation(Optional.class) != null;
      dependent = method.getAnnotation(Dependent.class);

      writer.print("\t\t\t(");
      if ( optional )
        writer.print('(');
      if ( dependent != null ) {
        if ( dependent.value().indexOf(',') == -1 )
          writer.print("!supported_extensions.contains(\"" + dependent.value() + "\") || ");
        else {
          writer.print("!(false");
          for ( String extension : dependent.value().split(",") )
            writer.print(" || supported_extensions.contains(\"" + extension + "\")");
          writer.print(") || ");
        }
      }
      if ( dependent != null )
        writer.print('(');
      writer.print(Utils.getFunctionAddressName(d, method) + " = ");
      PlatformDependent platform_dependent = method.getAnnotation(PlatformDependent.class);
      if ( platform_dependent != null ) {
        EnumSet<Platform> platform_set = EnumSet.copyOf(Arrays.asList(platform_dependent.value()));
        writer.print("GLContext.getPlatformSpecificFunctionAddress(\"");
        writer.print(Platform.ALL.getPrefix() + "\", ");
        writer.print("new String[]{");
        Iterator<Platform> platforms = platform_set.iterator();
        while ( platforms.hasNext() ) {
          writer.print("\"" + platforms.next().getOSPrefix() + "\"");
          if ( platforms.hasNext() )
            writer.print(", ");
        }
        writer.print("}, new String[]{");
        platforms = platform_set.iterator();
        while ( platforms.hasNext() ) {
          writer.print("\"" + platforms.next().getPrefix() + "\"");
          if ( platforms.hasNext() )
            writer.print(", ");
        }
        writer.print("}, ");
      } else if ( aliased ) {
        writer.print("GLContext.getFunctionAddress(new String[] {\"" + method.getSimpleName() + "\",\"" + method.getSimpleName() + alias_annotation.postfix() + "\"})) != 0");
      } else
        writer.print("GLContext.getFunctionAddress(");
      if ( !aliased )
        writer.print("\"" + method.getSimpleName() + "\")) != 0");
      if ( dependent != null )
        writer.print(')');
      if ( optional )
        writer.print(" || true)");
    }
View Full Code Here

     */
    protected void handleMethod(AttributeMetaDesc attributeMetaDesc,
            ClassDeclaration classDeclaration,
            FieldDeclaration fieldDeclaration,
            List<MethodDeclaration> methodDeclarations) {
        MethodDeclaration readMethodDeclaration = null;
        MethodDeclaration wirteMethodDeclaration = null;
        for (MethodDeclaration m : methodDeclarations) {
            if (isReadMethod(m, attributeMetaDesc, fieldDeclaration)) {
                readMethodDeclaration = m;
                attributeMetaDesc.setReadMethodName(m.getSimpleName());
                if (attributeMetaDesc.getWriteMethodName() != null) {
View Full Code Here

        }

        List<MethodDeclaration> overriderMethodDeclarations =
            new LinkedList<MethodDeclaration>();
        for (Iterator<MethodDeclaration> it = results.iterator(); it.hasNext();) {
            MethodDeclaration overriden = it.next();
            for (MethodDeclaration overrider : overriderMethodDeclarations) {
                if (env.getDeclarationUtils().overrides(overrider, overriden)) {
                    it.remove();
                }
            }
View Full Code Here

     */
    protected void handleMethod(AttributeMetaDesc attributeMetaDesc,
            ClassDeclaration classDeclaration,
            FieldDeclaration fieldDeclaration,
            List<MethodDeclaration> methodDeclarations) {
        MethodDeclaration readMethodDeclaration = null;
        MethodDeclaration wirteMethodDeclaration = null;
        for (MethodDeclaration m : methodDeclarations) {
            if (isReadMethod(m, attributeMetaDesc, fieldDeclaration)) {
                readMethodDeclaration = m;
                attributeMetaDesc.setReadMethodName(m.getSimpleName());
                if (attributeMetaDesc.getWriteMethodName() != null) {
View Full Code Here

     */
    protected void handleMethod(AttributeMetaDesc attributeMetaDesc,
            ClassDeclaration classDeclaration,
            FieldDeclaration fieldDeclaration,
            List<MethodDeclaration> methodDeclarations) {
        MethodDeclaration readMethodDeclaration = null;
        MethodDeclaration wirteMethodDeclaration = null;
        for (MethodDeclaration m : methodDeclarations) {
            if (isReadMethod(m, attributeMetaDesc, fieldDeclaration)) {
                readMethodDeclaration = m;
                attributeMetaDesc.setReadMethodName(m.getSimpleName());
                if (attributeMetaDesc.getWriteMethodName() != null) {
View Full Code Here

        }

        List<MethodDeclaration> overriderMethodDeclarations =
            new LinkedList<MethodDeclaration>();
        for (Iterator<MethodDeclaration> it = results.iterator(); it.hasNext();) {
            MethodDeclaration overriden = it.next();
            for (MethodDeclaration overrider : overriderMethodDeclarations) {
                if (env.getDeclarationUtils().overrides(overrider, overriden)) {
                    it.remove();
                }
            }
View Full Code Here

TOP

Related Classes of com.sun.mirror.declaration.MethodDeclaration

Copyright © 2018 www.massapicom. 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.