Get the Class Properties of the object under inspection. @return String array to be indexed by the CLASS_xxx_IDX constants
()
| 134 | * @return String array to be indexed by the CLASS_xxx_IDX constants |
| 135 | */ |
| 136 | public String[] getClassProps() { |
| 137 | String[] result = new String[CLASS_OTHER_IDX + 1]; |
| 138 | Package pack = getClassUnderInspection().getPackage(); |
| 139 | result[CLASS_PACKAGE_IDX] = "package " + ((pack == null) ? NOT_APPLICABLE : pack.getName()); |
| 140 | String modifiers = Modifier.toString(getClassUnderInspection().getModifiers()); |
| 141 | result[CLASS_CLASS_IDX] = modifiers + " class " + shortName(getClassUnderInspection()); |
| 142 | result[CLASS_INTERFACE_IDX] = "implements "; |
| 143 | Class[] interfaces = getClassUnderInspection().getInterfaces(); |
| 144 | for (Class anInterface : interfaces) { |
| 145 | result[CLASS_INTERFACE_IDX] += shortName(anInterface) + " "; |
| 146 | } |
| 147 | result[CLASS_SUPERCLASS_IDX] = "extends " + shortName(getClassUnderInspection().getSuperclass()); |
| 148 | result[CLASS_OTHER_IDX] = "is Primitive: " + getClassUnderInspection().isPrimitive() |
| 149 | + ", is Array: " + getClassUnderInspection().isArray() |
| 150 | + ", is Groovy: " + isGroovy(); |
| 151 | return result; |
| 152 | } |
| 153 | |
| 154 | /** |
| 155 | * Indicates whether the inspected type implements {@link GroovyObject}. |