/** * A main method for testing the class name enumeration. */ public static void main(String[] args) { try { for (int index = 0; index < args.length; index++) { String descriptor = args[index]; System.out.println("Descriptor ["+descriptor+"]"); DescriptorClassEnumeration enumeration = new DescriptorClassEnumeration(descriptor); System.out.println(" Fluff: ["+enumeration.nextFluff()+"]"); while (enumeration.hasMoreClassNames()) { System.out.println(" Name: ["+enumeration.nextClassName()+"]"); System.out.println(" Fluff: ["+enumeration.nextFluff()+"]"); } } } catch (Exception ex) { ex.printStackTrace(); } } }
/** * A main method for testing the class name enumeration. */ public static void main(String[] args) { try { for (int index = 0; index < args.length; index++) { String descriptor = args[index]; System.out.println("Descriptor ["+descriptor+"]"); DescriptorClassEnumeration enumeration = new DescriptorClassEnumeration(descriptor); System.out.println(" Fluff: ["+enumeration.nextFluff()+"]"); while (enumeration.hasMoreClassNames()) { System.out.println(" Name: ["+enumeration.nextClassName()+"]"); System.out.println(" Fluff: ["+enumeration.nextFluff()+"]"); } } } catch (Exception ex) { ex.printStackTrace(); } } }
/** * A main method for testing the class name enumeration. */ public static void main(String[] args) { try { for (int index = 0; index < args.length; index++) { String descriptor = args[index]; System.out.println("Descriptor ["+descriptor+"]"); DescriptorClassEnumeration enumeration = new DescriptorClassEnumeration(descriptor); System.out.println(" Fluff: ["+enumeration.nextFluff()+"]"); while (enumeration.hasMoreClassNames()) { System.out.println(" Name: ["+enumeration.nextClassName()+"]"); System.out.println(" Fluff: ["+enumeration.nextFluff()+"]"); } } } catch (Exception ex) { ex.printStackTrace(); } } }
/** * A main method for testing the class name enumeration. */ public static void main(String[] args) { try { for (int index = 0; index < args.length; index++) { String descriptor = args[index]; System.out.println("Descriptor ["+descriptor+"]"); DescriptorClassEnumeration enumeration = new DescriptorClassEnumeration(descriptor); System.out.println(" Fluff: ["+enumeration.nextFluff()+"]"); while (enumeration.hasMoreClassNames()) { System.out.println(" Name: ["+enumeration.nextClassName()+"]"); System.out.println(" Fluff: ["+enumeration.nextFluff()+"]"); } } } catch (Exception ex) { ex.printStackTrace(); } } }
private static String newDescriptor(String descriptor, Clazz referencedClass) { // If there is no referenced class, the descriptor won't change. if (referencedClass == null) { return descriptor; } // Unravel and reconstruct the class element of the descriptor. DescriptorClassEnumeration descriptorClassEnumeration = new DescriptorClassEnumeration(descriptor); StringBuffer newDescriptorBuffer = new StringBuffer(descriptor.length()); newDescriptorBuffer.append(descriptorClassEnumeration.nextFluff()); // Only if the descriptor contains a class name (e.g. with an array of // primitive types), the descriptor can change. if (descriptorClassEnumeration.hasMoreClassNames()) { String className = descriptorClassEnumeration.nextClassName(); String fluff = descriptorClassEnumeration.nextFluff(); String newClassName = newClassName(className, referencedClass); newDescriptorBuffer.append(newClassName); newDescriptorBuffer.append(fluff); } return newDescriptorBuffer.toString(); }
private static String newDescriptor(String descriptor, Clazz referencedClass) { // If there is no referenced class, the descriptor won't change. if (referencedClass == null) { return descriptor; } // Unravel and reconstruct the class element of the descriptor. DescriptorClassEnumeration descriptorClassEnumeration = new DescriptorClassEnumeration(descriptor); StringBuffer newDescriptorBuffer = new StringBuffer(descriptor.length()); newDescriptorBuffer.append(descriptorClassEnumeration.nextFluff()); // Only if the descriptor contains a class name (e.g. with an array of // primitive types), the descriptor can change. if (descriptorClassEnumeration.hasMoreClassNames()) { String className = descriptorClassEnumeration.nextClassName(); String fluff = descriptorClassEnumeration.nextFluff(); String newClassName = newClassName(className, referencedClass); newDescriptorBuffer.append(newClassName); newDescriptorBuffer.append(fluff); } return newDescriptorBuffer.toString(); }
private static String newDescriptor(String descriptor, Clazz referencedClass) { // If there is no referenced class, the descriptor won't change. if (referencedClass == null) { return descriptor; } // Unravel and reconstruct the class element of the descriptor. DescriptorClassEnumeration descriptorClassEnumeration = new DescriptorClassEnumeration(descriptor); StringBuffer newDescriptorBuffer = new StringBuffer(descriptor.length()); newDescriptorBuffer.append(descriptorClassEnumeration.nextFluff()); // Only if the descriptor contains a class name (e.g. with an array of // primitive types), the descriptor can change. if (descriptorClassEnumeration.hasMoreClassNames()) { String className = descriptorClassEnumeration.nextClassName(); String fluff = descriptorClassEnumeration.nextFluff(); String newClassName = newClassName(className, referencedClass); newDescriptorBuffer.append(newClassName); newDescriptorBuffer.append(fluff); } return newDescriptorBuffer.toString(); }
private static String newDescriptor(String descriptor, Clazz referencedClass) { // If there is no referenced class, the descriptor won't change. if (referencedClass == null) { return descriptor; } // Unravel and reconstruct the class element of the descriptor. DescriptorClassEnumeration descriptorClassEnumeration = new DescriptorClassEnumeration(descriptor); StringBuffer newDescriptorBuffer = new StringBuffer(descriptor.length()); newDescriptorBuffer.append(descriptorClassEnumeration.nextFluff()); // Only if the descriptor contains a class name (e.g. with an array of // primitive types), the descriptor can change. if (descriptorClassEnumeration.hasMoreClassNames()) { String className = descriptorClassEnumeration.nextClassName(); String fluff = descriptorClassEnumeration.nextFluff(); String newClassName = newClassName(className, referencedClass); newDescriptorBuffer.append(newClassName); newDescriptorBuffer.append(fluff); } return newDescriptorBuffer.toString(); }
while (descriptorClassEnumeration.hasMoreClassNames())
while (descriptorClassEnumeration.hasMoreClassNames())
while (descriptorClassEnumeration.hasMoreClassNames())
while (descriptorClassEnumeration.hasMoreClassNames())
/** * Returns the number of classes contained in the descriptor. This * is the number of class names that the enumeration will return. */ public int classCount() { int count = 0; nextFluff(); while (hasMoreClassNames()) { count++; nextClassName(); nextFluff(); } index = 0; return count; }
/** * Returns the single class referenced by the given descriptor, or * <code>null</code> if there isn't any useful reference. */ private Clazz findReferencedClass(String referencingClassName, String descriptor) { DescriptorClassEnumeration enumeration = new DescriptorClassEnumeration(descriptor); enumeration.nextFluff(); if (enumeration.hasMoreClassNames()) { return findClass(referencingClassName, enumeration.nextClassName()); } return null; }
/** * Returns the single class referenced by the given descriptor, or * <code>null</code> if there isn't any useful reference. */ private Clazz findReferencedClass(Clazz referencingClass, String descriptor) { DescriptorClassEnumeration enumeration = new DescriptorClassEnumeration(descriptor); enumeration.nextFluff(); if (enumeration.hasMoreClassNames()) { return findClass(referencingClass, enumeration.nextClassName()); } return null; }
/** * Returns the single class referenced by the given descriptor, or * <code>null</code> if there isn't any useful reference. */ private Clazz findReferencedClass(Clazz referencingClass, String descriptor) { DescriptorClassEnumeration enumeration = new DescriptorClassEnumeration(descriptor); enumeration.nextFluff(); if (enumeration.hasMoreClassNames()) { return findClass(referencingClass, enumeration.nextClassName()); } return null; }
/** * Returns the single class referenced by the given descriptor, or * <code>null</code> if there isn't any useful reference. */ private Clazz findReferencedClass(Clazz referencingClass, String descriptor) { DescriptorClassEnumeration enumeration = new DescriptorClassEnumeration(descriptor); enumeration.nextFluff(); if (enumeration.hasMoreClassNames()) { return findClass(referencingClass, enumeration.nextClassName()); } return null; }
/** * Returns the number of classes contained in the descriptor. This * is the number of class names that the enumeration will return. */ public int classCount() { int count = 0; reset(); nextFluff(); while (hasMoreClassNames()) { count++; nextClassName(); nextFluff(); } reset(); return count; }
/** * Returns the number of classes contained in the descriptor. This * is the number of class names that the enumeration will return. */ public int classCount() { int count = 0; reset(); nextFluff(); while (hasMoreClassNames()) { count++; nextClassName(); nextFluff(); } reset(); return count; }
/** * Returns the number of classes contained in the descriptor. This * is the number of class names that the enumeration will return. */ public int classCount() { int count = 0; reset(); nextFluff(); while (hasMoreClassNames()) { count++; nextClassName(); nextFluff(); } reset(); return count; }