use of com.jetbrains.python.psi.stubs.PropertyStubStorage in project intellij-community by JetBrains.
the class PyClassImpl method processStubProperties.
@Nullable
private Property processStubProperties(@Nullable String name, @Nullable Processor<Property> propertyProcessor) {
final PyClassStub stub = getStub();
if (stub != null) {
for (StubElement subStub : stub.getChildrenStubs()) {
if (subStub.getStubType() == PyElementTypes.TARGET_EXPRESSION) {
final PyTargetExpressionStub targetStub = (PyTargetExpressionStub) subStub;
PropertyStubStorage prop = targetStub.getCustomStub(PropertyStubStorage.class);
if (prop != null && (name == null || name.equals(targetStub.getName()))) {
Maybe<PyCallable> getter = fromPacked(prop.getGetter());
Maybe<PyCallable> setter = fromPacked(prop.getSetter());
Maybe<PyCallable> deleter = fromPacked(prop.getDeleter());
String doc = prop.getDoc();
if (getter != NONE || setter != NONE || deleter != NONE) {
final PropertyImpl property = new PropertyImpl(targetStub.getName(), getter, setter, deleter, doc, targetStub.getPsi());
if (propertyProcessor == null || propertyProcessor.process(property))
return property;
}
}
}
}
}
return null;
}
Aggregations