private static IFieldInfo[] getSortedFields(IClassFileReader cfReader) { IFieldInfo[] allFields = cfReader.getFieldInfos(); Arrays.sort(allFields, new Comparator<IFieldInfo>() { @Override public int compare(IFieldInfo o1, IFieldInfo o2) { return CharOperation.compareTo(o1.getName(), o2.getName()); } }); return allFields; }
public static IClassFileAttribute getAttribute(IFieldInfo fieldInfo, char[] attributeName) { IClassFileAttribute[] attributes = fieldInfo.getAttributes(); for (int i = 0, max = attributes.length; i < max; i++) { if (CharOperation.equals(attributes[i].getAttributeName(), attributeName)) { return attributes[i]; } } return null; }
private static IFieldInfo[] getSortedFields(IClassFileReader cfReader) { IFieldInfo[] allFields= cfReader.getFieldInfos(); Arrays.sort(allFields, new Comparator<IFieldInfo>() { public int compare(IFieldInfo o1, IFieldInfo o2) { return CharOperation.compareTo(o1.getName(), o2.getName()); } }); return allFields; }
/** * @see IClassFileReader#getFieldInfos() */ public IFieldInfo[] getFieldInfos() { return this.fields; }