users@codemodel.java.net

Re: Where is JInvocation#getArgs()

From: Aleksei Valikov <valikov_at_gmx.net>
Date: Tue, 15 Jun 2010 00:27:41 +0200

Hi,

> I'd like to find out how many arguments I have still added to a
> JInvocation. At the moment that is not possible.
> Is there a reason why there isn't no JInvocation#getArgs() method or is
> it just missing?

I think it's a reasonable request. I've added the following method:

        /**
         * Returns all arguments of the invocation.
         * @return
         * If there's no arguments, an empty array will be returned.
         */
        public JExpression[] listArgs() {
                return args.toArray(new JExpression[args.size()]);
        }

Analogous to JMethod.listParams().

CodeModel generally does not provide much "read" methods since it was
initially developed as "write-only".

Bye.
/lexi