Search in sources :

Example 1 with SmaliTypeElement

use of org.jf.smalidea.psi.impl.SmaliTypeElement in project smali by JesusFreke.

the class SmaliFieldElementType method createStub.

@Override
public SmaliFieldStub createStub(@NotNull SmaliField psi, StubElement parentStub) {
    try {
        String fieldSmaliTypeName;
        SmaliTypeElement typeElement = psi.getTypeElement();
        if (typeElement != null) {
            fieldSmaliTypeName = typeElement.getSmaliName();
        } else {
            fieldSmaliTypeName = "Ljava/lang/Object;";
        }
        return new SmaliFieldStub(parentStub, psi.getName(), fieldSmaliTypeName);
    } catch (IndexNotReadyException ex) {
        System.out.println(psi.getName());
        throw ex;
    }
}
Also used : SmaliFieldStub(org.jf.smalidea.psi.stub.SmaliFieldStub) SmaliTypeElement(org.jf.smalidea.psi.impl.SmaliTypeElement) IndexNotReadyException(com.intellij.openapi.project.IndexNotReadyException)

Example 2 with SmaliTypeElement

use of org.jf.smalidea.psi.impl.SmaliTypeElement in project smali by JesusFreke.

the class SmaliMethodPrototypeElementType method createStub.

@Override
public SmaliMethodPrototypeStub createStub(@NotNull SmaliMethodPrototype psi, StubElement parentStub) {
    SmaliTypeElement returnType = psi.getReturnTypeElement();
    String returnSmaliTypeName = null;
    if (returnType != null) {
        returnSmaliTypeName = returnType.getSmaliName();
    }
    return new SmaliMethodPrototypeStub(parentStub, returnSmaliTypeName);
}
Also used : SmaliTypeElement(org.jf.smalidea.psi.impl.SmaliTypeElement) SmaliMethodPrototypeStub(org.jf.smalidea.psi.stub.SmaliMethodPrototypeStub)

Aggregations

SmaliTypeElement (org.jf.smalidea.psi.impl.SmaliTypeElement)2 IndexNotReadyException (com.intellij.openapi.project.IndexNotReadyException)1 SmaliFieldStub (org.jf.smalidea.psi.stub.SmaliFieldStub)1 SmaliMethodPrototypeStub (org.jf.smalidea.psi.stub.SmaliMethodPrototypeStub)1