projects
/
javainspect.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
updated copyright notice
[javainspect.git]
/
src
/
main
/
java
/
eu
/
svjatoslav
/
inspector
/
java
/
structure
/
MethodDescriptor.java
diff --git
a/src/main/java/eu/svjatoslav/inspector/java/structure/MethodDescriptor.java
b/src/main/java/eu/svjatoslav/inspector/java/structure/MethodDescriptor.java
old mode 100644
(file)
new mode 100755
(executable)
index
89a492e
..
2e5d61f
--- a/
src/main/java/eu/svjatoslav/inspector/java/structure/MethodDescriptor.java
+++ b/
src/main/java/eu/svjatoslav/inspector/java/structure/MethodDescriptor.java
@@
-1,10
+1,10
@@
/*
* JavaInspect - Utility to visualize java software
/*
* JavaInspect - Utility to visualize java software
- * Copyright (C) 2013, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
+ * Copyright (C) 2013
-2015
, Svjatoslav Agejenko, svjatoslav@svjatoslav.eu
*
* This program is free software; you can redistribute it and/or
*
* This program is free software; you can redistribute it and/or
- * modify it under the terms of version
2 of the GNU
General Public License
- * as published by the Free Software Foundation.
+ * modify it under the terms of version
3 of the GNU Lesser
General Public License
+ *
or later
as published by the Free Software Foundation.
*/
package eu.svjatoslav.inspector.java.structure;
*/
package eu.svjatoslav.inspector.java.structure;
@@
-22,7
+22,7
@@
public class MethodDescriptor implements GraphElement,
* This class corresponds to single method within a java class.
*/
* This class corresponds to single method within a java class.
*/
- public String
n
ame;
+ public String
methodN
ame;
public ClassDescriptor returnType;
private final ClassDescriptor parentClass;
public ClassDescriptor returnType;
private final ClassDescriptor parentClass;
@@
-33,10
+33,10
@@
public class MethodDescriptor implements GraphElement,
parentClass = parent;
parentClass = parent;
-
n
ame = method.getName();
+
methodN
ame = method.getName();
if (!method.getDeclaringClass().getName()
if (!method.getDeclaringClass().getName()
- .equals(parent.
f
ullyQualifiedName))
+ .equals(parent.
classF
ullyQualifiedName))
// do not index inherited methods
return;
// do not index inherited methods
return;
@@
-62,7
+62,7
@@
public class MethodDescriptor implements GraphElement,
@Override
public int compareTo(final MethodDescriptor o) {
@Override
public int compareTo(final MethodDescriptor o) {
- final int nameComparisonResult =
name.compareTo(o.n
ame);
+ final int nameComparisonResult =
methodName.compareTo(o.methodN
ame);
if (nameComparisonResult != 0)
return nameComparisonResult;
if (nameComparisonResult != 0)
return nameComparisonResult;
@@
-82,7
+82,7
@@
public class MethodDescriptor implements GraphElement,
if (classDescriptor.isVisible())
if (classDescriptor.areReferencesShown())
result.append(" " + getGraphId() + " -> "
if (classDescriptor.isVisible())
if (classDescriptor.areReferencesShown())
result.append(" " + getGraphId() + " -> "
- + classDescriptor.getGraphId() + "[label=\"" +
n
ame
+ + classDescriptor.getGraphId() + "[label=\"" +
methodN
ame
+ "\", color=\"" + classDescriptor.getColor()
+ "\", style=\"dotted, bold\"];\n");
+ "\", color=\"" + classDescriptor.getColor()
+ "\", style=\"dotted, bold\"];\n");
@@
-92,7
+92,7
@@
public class MethodDescriptor implements GraphElement,
// main type
if (returnType.areReferencesShown())
result.append(" " + getGraphId() + " -> "
// main type
if (returnType.areReferencesShown())
result.append(" " + getGraphId() + " -> "
- + returnType.getGraphId() + "[label=\"" +
n
ame + "\","
+ + returnType.getGraphId() + "[label=\"" +
methodN
ame + "\","
+ " color=\"" + returnType.getColor()
+ "\", style=\"dotted, bold\"];\n");
+ " color=\"" + returnType.getColor()
+ "\", style=\"dotted, bold\"];\n");
@@
-106,7
+106,7
@@
public class MethodDescriptor implements GraphElement,
final StringBuffer result = new StringBuffer();
final StringBuffer result = new StringBuffer();
- result.append(" // " +
n
ame + "\n");
+ result.append(" // " +
methodN
ame + "\n");
result.append(" <TR><td ALIGN=\"right\">"
+ "<FONT POINT-SIZE=\"8.0\">" + returnType.getClassName(true)
result.append(" <TR><td ALIGN=\"right\">"
+ "<FONT POINT-SIZE=\"8.0\">" + returnType.getClassName(true)
@@
-119,11
+119,11
@@
public class MethodDescriptor implements GraphElement,
@Override
public String getGraphId() {
@Override
public String getGraphId() {
- return parentClass.getGraphId() + ":" +
n
ame;
+ return parentClass.getGraphId() + ":" +
methodN
ame;
}
public String getMethodLabel() {
}
public String getMethodLabel() {
- return
n
ame;
+ return
methodN
ame;
}
public int getOutsideVisibleReferencesCount() {
}
public int getOutsideVisibleReferencesCount() {
@@
-143,24
+143,24
@@
public class MethodDescriptor implements GraphElement,
public boolean isVisible() {
// hide common object methods
public boolean isVisible() {
// hide common object methods
- if (Utils.isCommonObjectMethod(
n
ame))
+ if (Utils.isCommonObjectMethod(
methodN
ame))
return false;
// hide common Enumeration methods
return false;
// hide common Enumeration methods
- if (parentClass.isEnum && Utils.isEnumMethod(
n
ame))
+ if (parentClass.isEnum && Utils.isEnumMethod(
methodN
ame))
return false;
// hide get/set methods for the field of the same name
return false;
// hide get/set methods for the field of the same name
- if (
name.startsWith("get") || n
ame.startsWith("set"))
- if (parentClass.hasFieldIgnoreCase(
n
ame.substring(3)))
+ if (
methodName.startsWith("get") || methodN
ame.startsWith("set"))
+ if (parentClass.hasFieldIgnoreCase(
methodN
ame.substring(3)))
return false;
// hide is methods for the boolean field of the same name
return false;
// hide is methods for the boolean field of the same name
- if (
n
ame.startsWith("is")) {
- final FieldDescriptor field = parentClass.getFieldIgnoreCase(
n
ame
+ if (
methodN
ame.startsWith("is")) {
+ final FieldDescriptor field = parentClass.getFieldIgnoreCase(
methodN
ame
.substring(2));
if (field != null)
.substring(2));
if (field != null)
- if ("boolean".equals(field.getType().
f
ullyQualifiedName))
+ if ("boolean".equals(field.getType().
classF
ullyQualifiedName))
return false;
}
return false;
}