use of org.jf.smalidea.psi.stub.SmaliFieldStub in project smali by JesusFreke.
the class SmaliField method getName.
@Nullable
@Override
public String getName() {
SmaliFieldStub stub = getStub();
if (stub != null) {
return stub.getName();
}
SmaliMemberName smaliMemberName = findChildByClass(SmaliMemberName.class);
if (smaliMemberName == null || smaliMemberName.getText().isEmpty()) {
return null;
}
return smaliMemberName.getText();
}
use of org.jf.smalidea.psi.stub.SmaliFieldStub 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;
}
}
use of org.jf.smalidea.psi.stub.SmaliFieldStub in project smali by JesusFreke.
the class SmaliField method getType.
@NotNull
@Override
public PsiType getType() {
SmaliFieldStub stub = getStub();
if (stub != null) {
return NameUtils.resolveSmaliToPsiType(this, stub.getSmaliTypeName());
}
PsiTypeElement typeElement = getTypeElement();
if (typeElement == null) {
// If we don't have a type (i.e. syntax error), use Object as a safe-ish fallback
PsiElementFactory factory = JavaPsiFacade.getInstance(getProject()).getElementFactory();
return factory.createTypeFromText("java.lang.Object", this);
}
return getTypeElement().getType();
}
Aggregations