/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* JMethod invocation
*/
/**
* Object expression upon which this method will be invoked, or null if
* this is a constructor invocation
*/
/**
* Name of the method to be invoked.
* Either this field is set, or {@link #method}, or {@link #type} (in which case it's a
* constructor invocation.)
* This allows {@link JMethod#name(String) the name of the method to be changed later}.
*/
private boolean isConstructor = false;
/**
* List of argument expressions for this method invocation
*/
/**
* If isConstructor==true, this field keeps the type to be created.
*/
/**
* Invokes a method on an object.
*
* @param object
* JExpression for the object upon which
* the named method will be invoked,
* or null if none
*
* @param name
* Name of method to invoke
*/
}
}
/**
* Invokes a static method on a class.
*/
}
}
}
}
/**
* Invokes a constructor of an object (i.e., creates
* a new object.)
*
* @param c
* Type of the object to be created. If this type is
* an array type, added arguments are treated as array
* initializer. Thus you can create an expression like
* <code>new int[]{1,2,3,4,5}</code>.
*/
this.isConstructor = true;
this.type = c;
}
/**
* Add an expression to this invocation's argument list
*
* @param arg
* Argument to add to argument list
*/
return this;
}
/**
* Adds a literal argument.
*
* Short for {@code arg(JExpr.lit(v))}
*/
}
/**
* Returns all arguments of the invocation.
* @return
* If there's no arguments, an empty array will be returned.
*/
}
// [RESULT] new T[]{arg1,arg2,arg3,...};
} else {
if (isConstructor)
else {
else
}
}
f.g(args);
f.p('}');
else
f.p(')');
}
}
f.g(this).p(';').nl();
}
}