reduced method visibility
[javainspect.git] / src / main / java / eu / svjatoslav / inspector / java / structure / MethodDescriptor.java
index 8eca361..173ddc3 100755 (executable)
@@ -15,20 +15,17 @@ import java.lang.reflect.Type;
 import java.util.ArrayList;
 import java.util.List;
 
+/**
+ * This class corresponds to single method within a java class.
+ */
 public class MethodDescriptor implements GraphElement,
                Comparable<MethodDescriptor> {
 
-       /**
-        * This class corresponds to single method within a java class.
-        */
-
-       public String methodName;
-       public ClassDescriptor returnType;
+       private final String methodName;
+       private ClassDescriptor returnType;
        private final ClassDescriptor parentClass;
-
-       List<ClassDescriptor> argumentTypes = new ArrayList<ClassDescriptor>();
-
-       boolean isInherited;
+       private final List<ClassDescriptor> argumentTypes = new ArrayList<ClassDescriptor>();
+       private boolean isInherited;
 
        public MethodDescriptor(final ClassDescriptor parent,
                        final String methodName) {
@@ -39,7 +36,7 @@ public class MethodDescriptor implements GraphElement,
        public void analyze(final Method method) {
 
                if (!method.getDeclaringClass().getName()
-                               .equals(parentClass.classFullyQualifiedName))
+                               .equals(parentClass.getFullyQualifiedName()))
                        isInherited = true;
 
                returnType = parentClass.getClassGraph().getOrCreateClassDescriptor(
@@ -125,11 +122,11 @@ public class MethodDescriptor implements GraphElement,
                return parentClass.getGraphId() + ":" + methodName;
        }
 
-       public String getMethodLabel() {
+       private String getMethodLabel() {
                return methodName;
        }
 
-       public int getOutsideVisibleReferencesCount() {
+       protected int getOutsideVisibleReferencesCount() {
                int result = 0;
 
                if (returnType.isVisible())
@@ -167,7 +164,7 @@ public class MethodDescriptor implements GraphElement,
                        final FieldDescriptor field = parentClass
                                        .getFieldIgnoreCase(methodName.substring(2));
                        if (field != null)
-                               if ("boolean".equals(field.getType().classFullyQualifiedName))
+                               if ("boolean".equals(field.getType().getFullyQualifiedName()))
                                        return false;
                }