Java Code Examples for javax.lang.model.element.TypeElement.getInterfaces()

The following are Jave code examples for showing how to use getInterfaces() of the javax.lang.model.element.TypeElement class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: openjdk-jdk10   File: HtmlDocletWriter.java   View Source Code Vote up 6 votes
/**
 * Add method information.
 *
 * @param method the method to be documented
 * @param dl the content tree to which the method information will be added
 */
private void addMethodInfo(ExecutableElement method, Content dl) {
    TypeElement enclosing = utils.getEnclosingTypeElement(method);
    List<? extends TypeMirror> intfacs = enclosing.getInterfaces();
    ExecutableElement overriddenMethod = utils.overriddenMethod(method);
    // Check whether there is any implementation or overridden info to be
    // printed. If no overridden or implementation info needs to be
    // printed, do not print this section.
    if ((!intfacs.isEmpty()
            && new ImplementedMethods(method, this.configuration).build().isEmpty() == false)
            || overriddenMethod != null) {
        MethodWriterImpl.addImplementsInfo(this, method, dl);
        if (overriddenMethod != null) {
            MethodWriterImpl.addOverridden(this,
                    utils.overriddenType(method),
                    overriddenMethod,
                    dl);
        }
    }
}
 
Example 2
Project: openjdk-jdk10   File: ClassTree.java   View Source Code Vote up 6 votes
/**
 * For the interface passed get the interfaces which it extends, and then
 * put this interface in the sub-interface set of those interfaces. Do it
 * recursively. If a interface doesn't have super-interface just attach
 * that interface in the set of all the baseInterfaces.
 *
 * @param typeElement Interface under consideration.
 */
private void processInterface(TypeElement typeElement) {
    List<? extends TypeMirror> intfacs = typeElement.getInterfaces();
    if (!intfacs.isEmpty()) {
        for (TypeMirror intfac : intfacs) {
            if (!add(subInterfaces, utils.asTypeElement(intfac), typeElement)) {
                return;
            } else {
                processInterface(utils.asTypeElement(intfac));   // Recurse
            }
        }
    } else {
        // we need to add all the interfaces who do not have
        // super-interfaces to baseInterfaces set to traverse them
        if (!baseInterfaces.contains(typeElement)) {
            baseInterfaces.add(typeElement);
        }
    }
}
 
Example 3
Project: incubator-netbeans   File: AbstractTestGenerator.java   View Source Code Vote up 6 votes
/**
 * Checks whether is given method declared by no-interface Bean or by interface annotated by
 * {@code @javax.ejb.Remote} or {@code @javax.ejb.Local}
 *
 * @param srcClass class for which are generated test cases
 * @param srcMethod method of interest
 * @return {@code true} if the bean is no-interface or method is declared by
 * respectively annotated interface, {@code false} otherwise
 */
private static boolean isMethodInContainerLookup(TypeElement srcClass, ExecutableElement srcMethod) {
    // check for no-interface LocalBean
    List<? extends AnnotationMirror> annotations = srcClass.getAnnotationMirrors();
    for (AnnotationMirror annotationMirror : annotations) {
        String annotation = ((TypeElement)annotationMirror.getAnnotationType().asElement()).getQualifiedName().toString();
        if (annotation.equals("javax.ejb.LocalBean"))   // NOI18N
            return true;
    }
    // check if the class has empty implements clause or given method is declared by @Remote, @Local interface
    List<? extends TypeMirror> interfaces = srcClass.getInterfaces();
    if (interfaces.isEmpty()
            || areAllowedInterfacesForLocalBean(interfaces)
            || getEjbInterfaceDeclaringMethod(srcMethod, interfaces) != null) {
        return true;
    }
    return false;
}
 
Example 4
Project: incubator-netbeans   File: AbstractTestGenerator.java   View Source Code Vote up 6 votes
/**
 * Checks whether is given method declared by no-interface Bean or by interface annotated by
 * {@literal @javax.ejb.Remote} or {@literal @javax.ejb.Local}
 *
 * @param srcClass class for which are generated test cases
 * @param srcMethod method of interest
 * @return {@literal true} if the bean is no-interface or method is declared by
 * respectively annotated interface, {@literal false} otherwise
 */
private static boolean isMethodInContainerLookup(TypeElement srcClass, ExecutableElement srcMethod) {
    // check for no-interface LocalBean
    List<? extends AnnotationMirror> annotations = srcClass.getAnnotationMirrors();
    for (AnnotationMirror annotationMirror : annotations) {
        String annotation = ((TypeElement)annotationMirror.getAnnotationType().asElement()).getQualifiedName().toString();
        if (annotation.equals("javax.ejb.LocalBean"))   // NOI18N
            return true;
    }
    // check if the class has empty implements clause or given method is declared by @Remote, @Local interface
    List<? extends TypeMirror> interfaces = srcClass.getInterfaces();
    if (interfaces.isEmpty()
            || areAllowedInterfacesForLocalBean(interfaces)
            || getEjbInterfaceDeclaringMethod(srcMethod, interfaces) != null) {
        return true;
    }
    return false;
}
 
Example 5
Project: data-mediator   File: OutInterfaceManager.java   View Source Code Vote up 6 votes
/**
 * get the super interface flags for parent
 * @param te the current type element
 * @param pp the log printer
 * @return the flags.
 */
public static int getSuperInterfaceFlagForParent(TypeElement te,
                                                 Elements mElements, Types types, ProcessorPrinter pp){
    final String tag = te.getSimpleName().toString();
    List<? extends TypeMirror> interfaces = te.getInterfaces();
    for(TypeMirror tm: interfaces) {
        // pp.note(TAG, "getSuperInteraceFlagForParent_" + tag, "TypeMirror : " + tm);
        FieldData.TypeCompat tc = new FieldData.TypeCompat(types, tm);
        tc.replaceIfNeed(mElements, pp);
        pp.note(TAG, "getSuperInteraceFlagForParent_" + tag, "TypeMirror : " + tm
                + " , hasAnnotationFields = " + tc.hasAnnotationFields());
        if(tc.hasAnnotationFields()){
            //we want.
            int sum = 0;
            final Set<Integer> flags = getSuperInterfaceFlags(tag,
                    tc.getElementAsType(), types, pp);
            for(Integer val : flags){
                sum += val;
            }
            return sum;
        }
    }
    return 0;
}
 
Example 6
Project: data-mediator   File: MultiModuleSuperFieldDelegate.java   View Source Code Vote up 6 votes
@Override
public Set<FieldData> getDependFields(TypeElement te) {
    Set<FieldData> list = new HashSet<>();

    List<? extends AnnotationMirror> mirrors = te.getAnnotationMirrors();
    AnnotationMirror expect = null;
    for(AnnotationMirror am : mirrors){
        DeclaredType type = am.getAnnotationType();
        if(type.toString().equals(Fields.class.getName())){
            expect = am;
            break;
        }
    }
    if(expect != null){
        ElementHelper.parseFields(elements, types, expect, list, pp);
    }
    //a depend b, b depend c ,,, etc.
    List<? extends TypeMirror> superInterfaces = te.getInterfaces();
    for(TypeMirror tm : superInterfaces){
        final TypeElement newTe = (TypeElement) ((DeclaredType) tm).asElement();
        list.addAll(getDependFields(newTe)); //recursion
    }
    return list;
}
 
Example 7
Project: OpenJSharp   File: TypeModeler.java   View Source Code Vote up 6 votes
public static TypeElement getDeclaringClassMethod(TypeElement theClass, String methodName, TypeMirror[] args) {

        TypeElement retClass = null;
        if (theClass.getKind().equals(ElementKind.CLASS)) {
            TypeMirror superClass = theClass.getSuperclass();
            if (!superClass.getKind().equals(TypeKind.NONE))
                retClass = getDeclaringClassMethod(superClass, methodName, args);
        }
        if (retClass == null) {
            for (TypeMirror interfaceType : theClass.getInterfaces()) {
                retClass = getDeclaringClassMethod(interfaceType, methodName, args);
            }
        }
        if (retClass == null) {
            Collection<? extends ExecutableElement> methods = ElementFilter.methodsIn(theClass.getEnclosedElements());
            for (ExecutableElement method : methods) {
                if (method.getSimpleName().toString().equals(methodName)) {
                    retClass = theClass;
                    break;
                }
            }
        }
        return retClass;
    }
 
Example 8
Project: data-mediator   File: OutInterfaceManager.java   View Source Code Vote up 6 votes
/**
 * get the focus/attention interface ,like Parcelable, IReset and etc..
 * @param te the type element of current visit
 *           which is annotated by {@literal @}{@linkplain com.heaven7.java.data.mediator.Fields}.
 * @param types the type util
 * @return the all interfaces proxy need.
 */
private static List<? extends TypeMirror> getAttentionInterfaces(TypeElement te, Types types,
                                                                 List<String> existInterfaces, ProcessorPrinter pp) {

    pp.note(TAG, "getAttentionInterfaces", "start >>> te : " + te);
    final List<TypeMirror> list = new ArrayList<>();

    List<? extends TypeMirror> interfaces = te.getInterfaces();
    for(TypeMirror tm: interfaces){
        pp.note(TAG, "getAttentionInterfaces", "TypeMirror : " + tm);
        FieldData.TypeCompat tc = new FieldData.TypeCompat(types, tm);
        TypeElement newTe = tc.getElementAsType();
        String interfaceName = newTe.getQualifiedName().toString();
        if(sFillerMap.get(interfaceName) != null){
            if(!existInterfaces.contains(interfaceName)) {
                list.add(tm);
                existInterfaces.add(interfaceName);
            }
        }else{
            list.addAll(getAttentionInterfaces(newTe, types, existInterfaces, pp));
        }
    }
    pp.note(TAG, "getAttentionInterfaces", "end >>> te : " + te);
    return list;
}
 
Example 9
Project: openjdk-jdk10   File: WebServiceVisitor.java   View Source Code Vote up 6 votes
protected boolean classImplementsSei(TypeElement classElement, TypeElement interfaceElement) {
    for (TypeMirror interfaceType : classElement.getInterfaces()) {
        if (((DeclaredType) interfaceType).asElement().equals(interfaceElement))
            return true;
    }
    List<ExecutableElement> classMethods = getClassMethods(classElement);
    boolean implementsMethod;
    for (ExecutableElement interfaceMethod : ElementFilter.methodsIn(interfaceElement.getEnclosedElements())) {
        implementsMethod = false;
        for (ExecutableElement classMethod : classMethods) {
            if (sameMethod(interfaceMethod, classMethod)) {
                implementsMethod = true;
                classMethods.remove(classMethod);
                break;
            }
        }
        if (!implementsMethod) {
            builder.processError(WebserviceapMessages.WEBSERVICEAP_METHOD_NOT_IMPLEMENTED(interfaceElement.getSimpleName(), classElement.getSimpleName(), interfaceMethod), interfaceMethod);
            return false;
        }
    }
    return true;
}
 
Example 10
Project: inspector   File: InspectorFactoryProcessor.java   View Source Code Vote up 6 votes
private boolean searchInterfacesAncestry(TypeMirror rootIface, TypeMirror target) {
  TypeElement rootIfaceElement = (TypeElement) typeUtils.asElement(rootIface);
  // check if it implements valid interfaces
  for (TypeMirror iface : rootIfaceElement.getInterfaces()) {
    TypeElement ifaceElement = (TypeElement) typeUtils.asElement(rootIface);
    while (iface.getKind() != TypeKind.NONE) {
      if (typeUtils.isSameType(iface, target)) {
        return true;
      }
      // go up
      if (searchInterfacesAncestry(iface, target)) {
        return true;
      }
      // then move on
      iface = ifaceElement.getSuperclass();
    }
  }
  return false;
}
 
Example 11
Project: immu   File: ImmuObjectElement.java   View Source Code Vote up 5 votes
/**
 * Returns a list of all of the super properties of this element in order starting from the most super type.
 * @param env the environment, must not be null
 * @return the properties, must not be null
 */
public List<ImmuProperty> superProperties(ProcessingEnvironment env) {
  final TypeElement typeElement = (TypeElement) element;

  final List<? extends TypeMirror> interfaces = typeElement.getInterfaces();

  final List<ImmuProperty> properties = new LinkedList<>();

  for (TypeMirror typeMirror : interfaces) {
    properties.addAll(superProperties(env, typeMirror));
  }

  return properties;
}
 
Example 12
Project: GitHub   File: ViewStateClassGenerator.java   View Source Code Vote up 5 votes
private List<Method> iterateInterfaces(int level, TypeElement parentElement, String parentDefaultStrategy, Map<String, String> parentTypes, List<Method> rootMethods, List<Method> superinterfacesMethods) {
	for (TypeMirror typeMirror : parentElement.getInterfaces()) {
		final TypeElement anInterface = (TypeElement) ((DeclaredType) typeMirror).asElement();

		final List<? extends TypeMirror> typeArguments = ((DeclaredType) typeMirror).getTypeArguments();
		final List<? extends TypeParameterElement> typeParameters = anInterface.getTypeParameters();

		if (typeArguments.size() > typeParameters.size()) {
			throw new IllegalArgumentException("Code generation for interface " + anInterface.getSimpleName() + " failed. Simplify your generics.");
		}

		Map<String, String> types = new HashMap<>();
		for (int i = 0; i < typeArguments.size(); i++) {
			types.put(typeParameters.get(i).toString(), typeArguments.get(i).toString());
		}

		Map<String, String> totalInterfaceTypes = new HashMap<>(typeParameters.size());
		for (int i = 0; i < typeArguments.size(); i++) {
			totalInterfaceTypes.put(typeParameters.get(i).toString(), fillGenerics(parentTypes, typeArguments.get(i)));
		}
		for (int i = typeArguments.size(); i < typeParameters.size(); i++) {
			if (typeParameters.get(i).getBounds().size() != 1) {
				throw new IllegalArgumentException("Code generation for interface " + anInterface.getSimpleName() + " failed. Simplify your generics.");
			}

			totalInterfaceTypes.put(typeParameters.get(i).toString(), typeParameters.get(i).getBounds().get(0).toString());
		}

		String defaultStrategy = parentDefaultStrategy != null ? parentDefaultStrategy : getStateStrategyType(anInterface);

		getMethods(totalInterfaceTypes, anInterface, defaultStrategy, rootMethods, superinterfacesMethods);

		iterateInterfaces(level + 1, anInterface, defaultStrategy, types, rootMethods, superinterfacesMethods);
	}

	return superinterfacesMethods;
}
 
Example 13
Project: openjdk-jdk10   File: TypeModeler.java   View Source Code Vote up 5 votes
public static boolean isRemote(/*@NotNull*/ TypeElement typeElement) {
    for (TypeMirror superType : typeElement.getInterfaces()) {
        TypeElement name = (TypeElement) ((DeclaredType) superType).asElement();
        if (name.getQualifiedName().contentEquals(REMOTE)) {
            return true;
        }
        isRemote(name);
    }
    return false;
}
 
Example 14
Project: boohee_v5.6   File: ButterKnifeProcessor.java   View Source Code Vote up 5 votes
private boolean isSubtypeOfType(TypeMirror typeMirror, String otherType) {
    if (otherType.equals(typeMirror.toString())) {
        return true;
    }
    if (!(typeMirror instanceof DeclaredType)) {
        return false;
    }
    DeclaredType declaredType = (DeclaredType) typeMirror;
    List<? extends TypeMirror> typeArguments = declaredType.getTypeArguments();
    if (typeArguments.size() > 0) {
        StringBuilder typeString = new StringBuilder(declaredType.asElement().toString());
        typeString.append('<');
        for (int i = 0; i < typeArguments.size(); i++) {
            if (i > 0) {
                typeString.append(',');
            }
            typeString.append('?');
        }
        typeString.append('>');
        if (typeString.toString().equals(otherType)) {
            return true;
        }
    }
    Element element = declaredType.asElement();
    if (!(element instanceof TypeElement)) {
        return false;
    }
    TypeElement typeElement = (TypeElement) element;
    if (isSubtypeOfType(typeElement.getSuperclass(), otherType)) {
        return true;
    }
    for (TypeMirror interfaceType : typeElement.getInterfaces()) {
        if (isSubtypeOfType(interfaceType, otherType)) {
            return true;
        }
    }
    return false;
}
 
Example 15
Project: incubator-netbeans   File: APIIsSelfContainedTest.java   View Source Code Vote up 5 votes
private void verifySelfContainedAPI(TypeElement tel) {
    if (!shouldCheck(tel.getModifiers()))
        return; //do not check non-public things
    
    verifyAPIClass(tel.getSuperclass(), tel);
    
    for (TypeMirror intf : tel.getInterfaces()) {
        verifyAPIClass(intf, tel);
    }
    
    for (Element e : tel.getEnclosedElements()) {
        verifySelfContainedAPI(e, tel);
    }
}
 
Example 16
Project: prefpin   File: PrefPinProcessor.java   View Source Code Vote up 5 votes
private boolean isSubtypeOfType(TypeMirror typeMirror, String otherType) {
  if (isTypeEqual(typeMirror, otherType)) {
    return true;
  }
  if (typeMirror.getKind() != TypeKind.DECLARED) {
    return false;
  }
  DeclaredType declaredType = (DeclaredType) typeMirror;
  List<? extends TypeMirror> typeArguments = declaredType.getTypeArguments();
  if (typeArguments.size() > 0) {
    StringBuilder typeString = new StringBuilder(declaredType.asElement().toString());
    typeString.append('<');
    for (int i = 0; i < typeArguments.size(); i++) {
      if (i > 0) {
        typeString.append(',');
      }
      typeString.append('?');
    }
    typeString.append('>');
    if (typeString.toString().equals(otherType)) {
      return true;
    }
  }
  Element element = declaredType.asElement();
  if (!(element instanceof TypeElement)) {
    return false;
  }
  TypeElement typeElement = (TypeElement) element;
  TypeMirror superType = typeElement.getSuperclass();
  if (isSubtypeOfType(superType, otherType)) {
    return true;
  }
  for (TypeMirror interfaceType : typeElement.getInterfaces()) {
    if (isSubtypeOfType(interfaceType, otherType)) {
      return true;
    }
  }
  return false;
}
 
Example 17
Project: butterknife-parent   File: ButterKnifeProcessor.java   View Source Code Vote up 5 votes
static boolean isSubtypeOfType(TypeMirror typeMirror, String otherType) {
  if (isTypeEqual(typeMirror, otherType)) {
    return true;
  }
  if (typeMirror.getKind() != TypeKind.DECLARED) {
    return false;
  }
  DeclaredType declaredType = (DeclaredType) typeMirror;
  List<? extends TypeMirror> typeArguments = declaredType.getTypeArguments();
  if (typeArguments.size() > 0) {
    StringBuilder typeString = new StringBuilder(declaredType.asElement().toString());
    typeString.append('<');
    for (int i = 0; i < typeArguments.size(); i++) {
      if (i > 0) {
        typeString.append(',');
      }
      typeString.append('?');
    }
    typeString.append('>');
    if (typeString.toString().equals(otherType)) {
      return true;
    }
  }
  Element element = declaredType.asElement();
  if (!(element instanceof TypeElement)) {
    return false;
  }
  TypeElement typeElement = (TypeElement) element;
  TypeMirror superType = typeElement.getSuperclass();
  if (isSubtypeOfType(superType, otherType)) {
    return true;
  }
  for (TypeMirror interfaceType : typeElement.getInterfaces()) {
    if (isSubtypeOfType(interfaceType, otherType)) {
      return true;
    }
  }
  return false;
}
 
Example 18
Project: GitHub   File: JsonFieldProcessor.java   View Source Code Vote up 4 votes
private boolean ensureTypeConverterClassValid(TypeMirror typeConverterClassMirror, Elements elements, Types types) {
    TypeElement typeConverterElement = elements.getTypeElement(typeConverterClassMirror.toString());

    if (typeConverterElement != null) {
        boolean isTypeConverterType = false;
        TypeElement element = typeConverterElement;

        while (!isTypeConverterType && element != null) {
            for (TypeMirror iface : element.getInterfaces()) {
                if (types.erasure(iface).toString().equals(TypeConverter.class.getCanonicalName())) {
                    isTypeConverterType = true;
                }
            }

            TypeMirror superClassMirror = element.getSuperclass();
            if (superClassMirror != null) {
                superClassMirror = types.erasure(superClassMirror);

                element = elements.getTypeElement(superClassMirror.toString());
            } else {
                element = null;
            }
        }

        if (!isTypeConverterType) {
            error(element, "TypeConverter elements must implement the TypeConverter interface or extend from one of the convenience helpers (ie StringBasedTypeConverter or DateTypeConverter).");
            return false;
        }

        boolean constructorIsDeclared = false;
        boolean hasAccessibleConstructor = false;
        List<? extends Element> enclosedElements = typeConverterElement.getEnclosedElements();
        for (Element enclosedElement : enclosedElements) {
            ElementKind enclosedElementKind = enclosedElement.getKind();
            if (enclosedElementKind == ElementKind.CONSTRUCTOR) {
                constructorIsDeclared = true;
                if (!enclosedElement.getModifiers().contains(Modifier.PRIVATE)) {
                    ExecutableElement executableElement = (ExecutableElement)enclosedElement;

                    if (executableElement.getParameters().size() == 0) {
                        hasAccessibleConstructor = true;
                    }
                }
            }
        }

        if (constructorIsDeclared && !hasAccessibleConstructor) {
            error(element, "TypeConverter classes must have a non-private zero argument constructor.");
            return false;
        }
    }

    return true;
}
 
Example 19
Project: incubator-netbeans   File: ElementJavadoc.java   View Source Code Vote up 4 votes
private StringBuilder getClassHeader(TypeElement cdoc) {
    StringBuilder sb = new StringBuilder();
    sb.append("<pre>"); //NOI18N
    cdoc.getAnnotationMirrors().forEach((annotationDesc) -> {
        appendAnnotation(sb, annotationDesc, true);
    });
    for (Modifier modifier : cdoc.getModifiers()) {
        switch(cdoc.getKind()) {
            case ENUM:
                if (modifier == Modifier.FINAL)
                    continue;
                break;
            case INTERFACE:
            case ANNOTATION_TYPE:
                if (modifier == Modifier.ABSTRACT)
                    continue;
                break;                     
        }
        sb.append(modifier).append(' '); //NOI18N
    }
    switch (cdoc.getKind()) {
        case ANNOTATION_TYPE:
            sb.append("@interface "); //NOI18N
            break;
        case ENUM:
            sb.append("enum "); //NOI18N
            break;
        case INTERFACE:
            sb.append("interface "); //NOI18N
            break;
        default:
            sb.append("class "); //NOI18N            
    }
    sb.append("<b>").append(cdoc.getSimpleName()); //NOI18N
    List<? extends TypeParameterElement> typeParams = cdoc.getTypeParameters();
    if (!typeParams.isEmpty()) {
        sb.append("&lt;"); //NOI18N
        for (Iterator<? extends TypeParameterElement> it = typeParams.iterator(); it.hasNext();) {
            TypeParameterElement typeParam = it.next();
            appendType(sb, typeParam.asType(), false, true, false);
            if (it.hasNext())
                sb.append(","); //NOI18N
        }
        sb.append("&gt;"); //NOI18N
    }
    sb.append("</b>"); //NOi18N
    if (cdoc.getKind() != ElementKind.ANNOTATION_TYPE) {
        TypeMirror supercls = cdoc.getSuperclass();
        if (supercls != null && supercls.getKind() != TypeKind.NONE) {
            sb.append("<br>extends "); //NOI18N
            appendType(sb, supercls, false, false, false);            
        }
        List<? extends TypeMirror> ifaces = cdoc.getInterfaces();
        if (!ifaces.isEmpty()) {
            sb.append(cdoc.getKind().isInterface() ? "<br>extends " : "<br>implements "); //NOI18N
            for (Iterator<? extends TypeMirror> it = ifaces.iterator(); it.hasNext();) {
                TypeMirror iface = it.next();
                appendType(sb, iface, false, false, false);
                if (it.hasNext())
                    sb.append(", "); //NOI18N
            }            
        }
    }
    sb.append("</pre>"); //NOI18N
    return sb;
}
 
Example 20
Project: incubator-netbeans   File: GeneratorUtilities.java   View Source Code Vote up 4 votes
private Map<String, Object> createBindings(TypeElement clazz, ExecutableElement element) {
    CodeStyle cs = DiffContext.getCodeStyle(copy);       
    Map<String, Object> bindings = new HashMap<>();
    if (clazz != null) {
        bindings.put(CLASS_NAME, clazz.getQualifiedName().toString());
        bindings.put(SIMPLE_CLASS_NAME, clazz.getSimpleName().toString());
    }
    if (element != null) {
        bindings.put(METHOD_NAME, element.getSimpleName().toString());
        bindings.put(METHOD_RETURN_TYPE, element.getReturnType().toString()); //NOI18N
        Object value;
        switch(element.getReturnType().getKind()) {
            case BOOLEAN:
                value = "false"; //NOI18N
                break;
            case BYTE:
            case CHAR:
            case DOUBLE:
            case FLOAT:
            case INT:
            case LONG:
            case SHORT:
                value = 0;
                break;
            default:
                value = "null"; //NOI18N
        }
        bindings.put(DEFAULT_RETURN_TYPE_VALUE, value);
    }
    if (clazz != null && element != null) {
        StringBuilder sb = new StringBuilder();
        if (element.isDefault() && element.getEnclosingElement().getKind().isInterface()) {
            Types types = copy.getTypes();
            Context ctx = ((JavacTaskImpl) copy.impl.getJavacTask()).getContext();
            com.sun.tools.javac.code.Types typesImpl = com.sun.tools.javac.code.Types.instance(ctx);
            TypeMirror enclType = typesImpl.asSuper((Type)clazz.asType(), ((Type)element.getEnclosingElement().asType()).tsym);
            if (!types.isSubtype(clazz.getSuperclass(), enclType)) {
                TypeMirror selected = enclType;
                for (TypeMirror iface : clazz.getInterfaces()) {
                    if (types.isSubtype(iface, selected) &&
                        !types.isSameType(iface, enclType)) {
                        selected = iface;
                        break;
                    }
                }
                sb.append(((DeclaredType)selected).asElement().getSimpleName()).append('.');
            }
        }
        sb.append("super.").append(element.getSimpleName()).append('('); //NOI18N
        for (Iterator<? extends VariableElement> it = element.getParameters().iterator(); it.hasNext();) {
            VariableElement ve = it.next();
            sb.append(addParamPrefixSuffix(removeParamPrefixSuffix(ve, cs), cs));
            if (it.hasNext())
                sb.append(","); //NOI18N
        }
        sb.append(')'); //NOI18N
        bindings.put(SUPER_METHOD_CALL, sb);
    }
    return bindings;
}