/** * Converts an internal method descriptor into an external method return type. * @param internalMethodDescriptor the internal method descriptor, * e.g. "<code>(II)Z</code>". * @return the external method return type, * e.g. "<code>boolean</code>". */ public static String externalMethodReturnType(String internalMethodDescriptor) { return externalType(internalMethodReturnType(internalMethodDescriptor)); }
/** * Converts an internal method descriptor into an external method return type. * @param internalMethodDescriptor the internal method descriptor, * e.g. "<code>(II)Z</code>". * @return the external method return type, * e.g. "<code>boolean</code>". */ public static String externalMethodReturnType(String internalMethodDescriptor) { return externalType(internalMethodReturnType(internalMethodDescriptor)); }
/** * Converts an internal method descriptor into an external method return type. * @param internalMethodDescriptor the internal method descriptor, * e.g. "<code>(II)Z</code>". * @return the external method return type, * e.g. "<code>boolean</code>". */ public static String externalMethodReturnType(String internalMethodDescriptor) { return externalType(internalMethodReturnType(internalMethodDescriptor)); }
/** * Converts an internal method descriptor into an external method return type. * @param internalMethodDescriptor the internal method descriptor, * e.g. "<code>(II)Z</code>". * @return the external method return type, * e.g. "<code>boolean</code>". */ public static String externalMethodReturnType(String internalMethodDescriptor) { return externalType(internalMethodReturnType(internalMethodDescriptor)); }
/** * Converts an internal field description into an external full field description. * @param accessFlags the access flags of the field. * @param fieldName the field name, * e.g. "<code>myField</code>". * @param internalFieldDescriptor the internal field descriptor, * e.g. "<code>Z</code>". * @return the external full field description, * e.g. "<code>public boolean myField</code>". */ public static String externalFullFieldDescription(int accessFlags, String fieldName, String internalFieldDescriptor) { return externalFieldAccessFlags(accessFlags) + externalType(internalFieldDescriptor) + ' ' + fieldName; }
/** * Converts an internal field description into an external full field description. * @param accessFlags the access flags of the field. * @param fieldName the field name, * e.g. "<code>myField</code>". * @param internalFieldDescriptor the internal field descriptor, * e.g. "<code>Z</code>". * @return the external full field description, * e.g. "<code>public boolean myField</code>". */ public static String externalFullFieldDescription(int accessFlags, String fieldName, String internalFieldDescriptor) { return externalFieldAccessFlags(accessFlags) + externalType(internalFieldDescriptor) + ' ' + fieldName; }
/** * Converts an internal field description into an external full field description. * @param accessFlags the access flags of the field. * @param fieldName the field name, * e.g. "<code>myField</code>". * @param internalFieldDescriptor the internal field descriptor, * e.g. "<code>Z</code>". * @return the external full field description, * e.g. "<code>public boolean myField</code>". */ public static String externalFullFieldDescription(int accessFlags, String fieldName, String internalFieldDescriptor) { return externalFieldAccessFlags(accessFlags) + externalType(internalFieldDescriptor) + ' ' + fieldName; }
/** * Converts an internal field description into an external full field description. * @param accessFlags the access flags of the field. * @param fieldName the field name, * e.g. "<code>myField</code>". * @param internalFieldDescriptor the internal field descriptor, * e.g. "<code>Z</code>". * @return the external full field description, * e.g. "<code>public boolean myField</code>". */ public static String externalFullFieldDescription(int accessFlags, String fieldName, String internalFieldDescriptor) { return externalFieldAccessFlags(accessFlags) + externalType(internalFieldDescriptor) + ' ' + fieldName; }
writer.println(ClassUtil.externalType(memberSpecification.annotationType)); writer.print(" ");
writer.println(ClassUtil.externalType(memberSpecification.annotationType)); writer.print(" ");
writer.println(ClassUtil.externalType(memberSpecification.annotationType)); writer.print(" ");
public void visitProgramField(ProgramClass programClass, ProgramField programField) { String fieldName = programField.getName(programClass); String obfuscatedFieldName = MemberObfuscator.newMemberName(programField); if (obfuscatedFieldName == null) { obfuscatedFieldName = fieldName; } // Print out the field mapping. ps.println(" " + ClassUtil.externalType(programField.getDescriptor(programClass)) + " " + fieldName + " -> " + obfuscatedFieldName); }
public void visitProgramField(ProgramClass programClass, ProgramField programField) { String fieldName = programField.getName(programClass); String obfuscatedFieldName = MemberObfuscator.newMemberName(programField); if (obfuscatedFieldName == null) { obfuscatedFieldName = fieldName; } // Print out the field mapping. ps.println(" " + ClassUtil.externalType(programField.getDescriptor(programClass)) + " " + fieldName + " -> " + obfuscatedFieldName); }
public void visitProgramField(ProgramClass programClass, ProgramField programField) { String fieldName = programField.getName(programClass); String obfuscatedFieldName = MemberObfuscator.newMemberName(programField); if (obfuscatedFieldName == null) { obfuscatedFieldName = fieldName; } // Print out the field mapping. ps.println(" " + ClassUtil.externalType(programField.getDescriptor(programClass)) + " " + fieldName + " -> " + obfuscatedFieldName); }
/** * Converts an internal method descriptor into an external method argument * description. * @param internalMethodDescriptor the internal method descriptor, * e.g. "<code>(II)Z</code>". * @return the external method argument description, * e.g. "<code>int,int</code>". */ public static String externalMethodArguments(String internalMethodDescriptor) { StringBuffer externalMethodNameAndArguments = new StringBuffer(); InternalTypeEnumeration internalTypeEnumeration = new InternalTypeEnumeration(internalMethodDescriptor); while (internalTypeEnumeration.hasMoreTypes()) { externalMethodNameAndArguments.append(externalType(internalTypeEnumeration.nextType())); if (internalTypeEnumeration.hasMoreTypes()) { externalMethodNameAndArguments.append(ClassConstants.EXTERNAL_METHOD_ARGUMENTS_SEPARATOR); } } return externalMethodNameAndArguments.toString(); }
/** * Converts an internal method descriptor into an external method argument * description. * @param internalMethodDescriptor the internal method descriptor, * e.g. "<code>(II)Z</code>". * @return the external method argument description, * e.g. "<code>int,int</code>". */ public static String externalMethodArguments(String internalMethodDescriptor) { StringBuffer externalMethodNameAndArguments = new StringBuffer(); InternalTypeEnumeration internalTypeEnumeration = new InternalTypeEnumeration(internalMethodDescriptor); while (internalTypeEnumeration.hasMoreTypes()) { externalMethodNameAndArguments.append(externalType(internalTypeEnumeration.nextType())); if (internalTypeEnumeration.hasMoreTypes()) { externalMethodNameAndArguments.append(JavaConstants.METHOD_ARGUMENTS_SEPARATOR); } } return externalMethodNameAndArguments.toString(); }
/** * Converts an internal method descriptor into an external method argument * description. * @param internalMethodDescriptor the internal method descriptor, * e.g. "<code>(II)Z</code>". * @return the external method argument description, * e.g. "<code>int,int</code>". */ public static String externalMethodArguments(String internalMethodDescriptor) { StringBuffer externalMethodNameAndArguments = new StringBuffer(); InternalTypeEnumeration internalTypeEnumeration = new InternalTypeEnumeration(internalMethodDescriptor); while (internalTypeEnumeration.hasMoreTypes()) { externalMethodNameAndArguments.append(externalType(internalTypeEnumeration.nextType())); if (internalTypeEnumeration.hasMoreTypes()) { externalMethodNameAndArguments.append(JavaConstants.METHOD_ARGUMENTS_SEPARATOR); } } return externalMethodNameAndArguments.toString(); }
/** * Converts an internal method descriptor into an external method argument * description. * @param internalMethodDescriptor the internal method descriptor, * e.g. "<code>(II)Z</code>". * @return the external method argument description, * e.g. "<code>int,int</code>". */ public static String externalMethodArguments(String internalMethodDescriptor) { StringBuffer externalMethodNameAndArguments = new StringBuffer(); InternalTypeEnumeration internalTypeEnumeration = new InternalTypeEnumeration(internalMethodDescriptor); while (internalTypeEnumeration.hasMoreTypes()) { externalMethodNameAndArguments.append(externalType(internalTypeEnumeration.nextType())); if (internalTypeEnumeration.hasMoreTypes()) { externalMethodNameAndArguments.append(JavaConstants.METHOD_ARGUMENTS_SEPARATOR); } } return externalMethodNameAndArguments.toString(); }
/** * Sets the ClassSpecification to be represented in this dialog. */ public void setClassSpecification(ClassSpecification classSpecification) { String comments = classSpecification.comments; String annotationType = classSpecification.annotationType; String className = classSpecification.className; String extendsAnnotationType = classSpecification.extendsAnnotationType; String extendsClassName = classSpecification.extendsClassName; List keepFieldOptions = classSpecification.fieldSpecifications; List keepMethodOptions = classSpecification.methodSpecifications; // Set the comments text area. commentsTextArea.setText(comments == null ? "" : comments); // Set the access radio buttons. setClassSpecificationRadioButtons(classSpecification, ClassConstants.ACC_PUBLIC, publicRadioButtons); setClassSpecificationRadioButtons(classSpecification, ClassConstants.ACC_FINAL, finalRadioButtons); setClassSpecificationRadioButtons(classSpecification, ClassConstants.ACC_ABSTRACT, abstractRadioButtons); setClassSpecificationRadioButtons(classSpecification, ClassConstants.ACC_INTERFACE, interfaceRadioButtons); setClassSpecificationRadioButtons(classSpecification, ClassConstants.ACC_ANNOTATION, annotationRadioButtons); setClassSpecificationRadioButtons(classSpecification, ClassConstants.ACC_ENUM, enumRadioButtons); setClassSpecificationRadioButtons(classSpecification, ClassConstants.ACC_SYNTHETIC, syntheticRadioButtons); // Set the class and annotation text fields. annotationTypeTextField .setText(annotationType == null ? "" : ClassUtil.externalType(annotationType)); classNameTextField .setText(className == null ? "*" : ClassUtil.externalClassName(className)); extendsAnnotationTypeTextField.setText(extendsAnnotationType == null ? "" : ClassUtil.externalType(extendsAnnotationType)); extendsClassNameTextField .setText(extendsClassName == null ? "" : ClassUtil.externalClassName(extendsClassName)); // Set the keep class member option list. memberSpecificationsPanel.setMemberSpecifications(keepFieldOptions, keepMethodOptions); }
/** * Returns a suitable label summarizing the given class specification at * some given index. */ public String label(ClassSpecification classSpecification, int index) { return classSpecification == null ? msg("none") : classSpecification.comments != null ? classSpecification.comments.trim() : classSpecification.className != null ? (msg("class") + ' ' + ClassUtil.externalClassName(classSpecification.className)) : classSpecification.annotationType != null ? (msg("classesAnnotatedWith") + ' ' + ClassUtil.externalType(classSpecification.annotationType)) : classSpecification.extendsClassName != null ? (msg("extensionsOf") + ' ' + ClassUtil.externalClassName(classSpecification.extendsClassName)) : classSpecification.extendsAnnotationType != null ? (msg("extensionsOfClassesAnnotatedWith") + ' ' + ClassUtil.externalType(classSpecification.extendsAnnotationType)) : index >= 0 ? (msg("specificationNumber") + index) : msg("specification"); }