/** * Used to identify if a method accepts a variable amount of * arguments. * * @param b true to set varargs, false otherwise */ public Modifiers toVarArgs(boolean b) { return convert(toVarArgs(mBitmask, b)); }
/** * Parse the given method declaration, throwing a exception if the syntax * is wrong. * * @param declaration declaration to parse, which matches Java syntax * @throws IllegalArgumentException if declaration syntax is wrong */ public MethodDeclarationParser(String declaration) throws IllegalArgumentException { int[] pos = new int[1]; Modifiers modifiers = parseModifiers(declaration, pos); mReturnType = parseTypeDesc(declaration, pos); if (mReturnType == null) { throw new IllegalArgumentException("No return type"); } mMethodName = parseIdentifier(declaration, pos); if (mMethodName == null) { throw new IllegalArgumentException("No method name"); } boolean[] isVarArgs = new boolean[1]; mParameters = parseParameters(declaration, pos, isVarArgs); if (isVarArgs[0]) { modifiers = modifiers.toVarArgs(true); } mModifiers = modifiers; }
/** * Used to identify if a method accepts a variable amount of * arguments. * * @param b true to set varargs, false otherwise */ public Modifiers toVarArgs(boolean b) { return convert(toVarArgs(mBitmask, b)); }
/** * Parse the given method declaration, throwing a exception if the syntax * is wrong. * * @param declaration declaration to parse, which matches Java syntax * @throws IllegalArgumentException if declaration syntax is wrong */ public MethodDeclarationParser(String declaration) throws IllegalArgumentException { int[] pos = new int[1]; Modifiers modifiers = parseModifiers(declaration, pos); mReturnType = parseTypeDesc(declaration, pos); if (mReturnType == null) { throw new IllegalArgumentException("No return type"); } mMethodName = parseIdentifier(declaration, pos); if (mMethodName == null) { throw new IllegalArgumentException("No method name"); } boolean[] isVarArgs = new boolean[1]; mParameters = parseParameters(declaration, pos, isVarArgs); if (isVarArgs[0]) { modifiers = modifiers.toVarArgs(true); } mModifiers = modifiers; }
if (varargs) { modifiers = modifiers.toVarArgs(false);
if (varargs) { modifiers = modifiers.toVarArgs(false);