/** * This method parses a descriptor and adds the package of the descriptor to * the referenced packages. The syntax of the descriptor is: * * <pre> * descriptor ::= ( '(' reference * ')' )? reference * reference ::= 'L' classname ( '<' references '>' )? ';' | 'B' | 'Z' | ... | '+' | '-' | '[' * </pre> * * This methods uses heavy recursion to parse the descriptor and a roving * pointer to limit the creation of string objects. * * @param descriptor * The to be parsed descriptor * @param rover * The pointer to start at */ public void parseDescriptor(String descriptor, int modifiers) { // Some descriptors are weird, they start with a generic // declaration that contains ':', not sure what they mean ... int rover = 0; if (descriptor.charAt(0) == '<') { rover = parseFormalTypeParameters(descriptor, rover, modifiers); } if (descriptor.charAt(rover) == '(') { rover = parseReferences(descriptor, rover + 1, ')', modifiers); rover++; } parseReferences(descriptor, rover, (char) 0, modifiers); }
/** * This method parses a descriptor and adds the package of the descriptor to * the referenced packages. The syntax of the descriptor is: * * <pre> * descriptor ::= ( '(' reference * ')' )? reference * reference ::= 'L' classname ( '<' references '>' )? ';' | 'B' | 'Z' | ... | '+' | '-' | '[' * </pre> * * This methods uses heavy recursion to parse the descriptor and a roving * pointer to limit the creation of string objects. * * @param descriptor * The to be parsed descriptor * @param rover * The pointer to start at */ public void parseDescriptor(String descriptor, int modifiers) { // Some descriptors are weird, they start with a generic // declaration that contains ':', not sure what they mean ... int rover = 0; if (descriptor.charAt(0) == '<') { rover = parseFormalTypeParameters(descriptor, rover, modifiers); } if (descriptor.charAt(rover) == '(') { rover = parseReferences(descriptor, rover + 1, ')', modifiers); rover++; } parseReferences(descriptor, rover, (char) 0, modifiers); }
/** * This method parses a descriptor and adds the package of the descriptor to * the referenced packages. The syntax of the descriptor is: * * <pre> * descriptor ::= ( '(' reference * ')' )? reference * reference ::= 'L' classname ( '<' references '>' )? ';' | 'B' | 'Z' | ... | '+' | '-' | '[' * </pre> * * This methods uses heavy recursion to parse the descriptor and a roving * pointer to limit the creation of string objects. * * @param descriptor * The to be parsed descriptor * @param rover * The pointer to start at */ public void parseDescriptor(String descriptor, int modifiers) { // Some descriptors are weird, they start with a generic // declaration that contains ':', not sure what they mean ... int rover = 0; if (descriptor.charAt(0) == '<') { rover = parseFormalTypeParameters(descriptor, rover, modifiers); } if (descriptor.charAt(rover) == '(') { rover = parseReferences(descriptor, rover + 1, ')', modifiers); rover++; } parseReferences(descriptor, rover, (char) 0, modifiers); }