Search in sources :

Example 1 with GeneratedPackageElement

use of com.google.devtools.j2objc.types.GeneratedPackageElement in project j2objc by google.

the class BindingConverter method unwrapGeneratedElement.

private static IBinding unwrapGeneratedElement(GeneratedElement element) {
    IBinding binding = generatedBindingCache.get(element);
    if (binding != null) {
        return binding;
    }
    if (element instanceof GeneratedVariableElement) {
        binding = new GeneratedVariableBinding((GeneratedVariableElement) element);
        generatedBindingCache.put(element, binding);
        return binding;
    }
    if (element instanceof GeneratedExecutableElement) {
        binding = new GeneratedMethodBinding((GeneratedExecutableElement) element);
        generatedBindingCache.put(element, binding);
        return binding;
    }
    if (element instanceof GeneratedTypeElement) {
        throw new AssertionError("not supported");
    }
    if (element instanceof GeneratedPackageElement) {
        binding = new GeneratedPackageBinding(((GeneratedPackageElement) element).getName());
        generatedBindingCache.put(element, binding);
        return binding;
    }
    throw new AssertionError("unknown generated element kind");
}
Also used : GeneratedExecutableElement(com.google.devtools.j2objc.types.GeneratedExecutableElement) GeneratedPackageElement(com.google.devtools.j2objc.types.GeneratedPackageElement) GeneratedTypeElement(com.google.devtools.j2objc.types.GeneratedTypeElement) GeneratedVariableElement(com.google.devtools.j2objc.types.GeneratedVariableElement) IBinding(org.eclipse.jdt.core.dom.IBinding)

Aggregations

GeneratedExecutableElement (com.google.devtools.j2objc.types.GeneratedExecutableElement)1 GeneratedPackageElement (com.google.devtools.j2objc.types.GeneratedPackageElement)1 GeneratedTypeElement (com.google.devtools.j2objc.types.GeneratedTypeElement)1 GeneratedVariableElement (com.google.devtools.j2objc.types.GeneratedVariableElement)1 IBinding (org.eclipse.jdt.core.dom.IBinding)1