Add toString methods for visibilities from java
This commit is contained in:
+15
@@ -50,6 +50,11 @@ public class JavaDescriptorResolver implements DependencyClassByQualifiedNameRes
|
||||
if (visibility == Visibilities.PRIVATE) return 1;
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "public/*package*/";
|
||||
}
|
||||
};
|
||||
|
||||
public static final Visibility PROTECTED_STATIC_VISIBILITY = new Visibility("protected_static", false) {
|
||||
@@ -79,6 +84,11 @@ public class JavaDescriptorResolver implements DependencyClassByQualifiedNameRes
|
||||
}
|
||||
return isVisible(what, fromClass.getContainingDeclaration());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "protected/*protected static*/";
|
||||
}
|
||||
};
|
||||
|
||||
public static final Visibility PROTECTED_AND_PACKAGE = new Visibility("protected_and_package", false) {
|
||||
@@ -107,6 +117,11 @@ public class JavaDescriptorResolver implements DependencyClassByQualifiedNameRes
|
||||
if (visibility == Visibilities.PRIVATE) return 1;
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "protected/*protected and package*/";
|
||||
}
|
||||
};
|
||||
|
||||
private JavaPropertyResolver propertiesResolver;
|
||||
|
||||
@@ -311,19 +311,7 @@ public class DescriptorRendererImpl implements DescriptorRenderer {
|
||||
|
||||
private void renderVisibility(@NotNull Visibility visibility, @NotNull StringBuilder builder) {
|
||||
if (!modifiers) return;
|
||||
if ("package".equals(visibility.toString())) {
|
||||
builder.append("public/*package*/ ");
|
||||
}
|
||||
else if ("protected_static".equals(visibility.toString())) {
|
||||
builder.append("protected/*protected static*/ ");
|
||||
}
|
||||
else if ("protected_and_package".equals(visibility.toString())) {
|
||||
builder.append("protected/*protected and package*/ ");
|
||||
}
|
||||
|
||||
else{
|
||||
builder.append(renderKeyword(visibility.toString())).append(" ");
|
||||
}
|
||||
builder.append(renderKeyword(visibility.toString())).append(" ");
|
||||
}
|
||||
|
||||
private void renderModality(@NotNull Modality modality, @NotNull StringBuilder builder) {
|
||||
|
||||
Reference in New Issue
Block a user