comparison scripts/deprecated/java_invoke.m @ 15790:921912c92102

Deprecate java_invoke, replace with javaMethod. Update all m-files to use javaMethod. * scripts/deprecated/java_invoke.m: New m-file with warning about function being deprecated. * libinterp/octave-value/ov-java.cc(Fjava_invoke, FjavaMethod): Remove java_invoke. Replace body of javaMethod with old java_invoke code. * libinterp/octave-value/ov-java.cc(do_java_invoke): Rename to do_javaMethod. * libinterp/octave-value/ov-java.cc(do_java_create): Rename to do_javaObject. * libinterp/octave-value/ov-java.h(do_java_invoke, do_java_create): Rename prototypes for functions to do_javaMethod and do_javaObject respectively. * scripts/deprecated/javafields.m, scripts/deprecated/javamethods.m, scripts/deprecated/module.mk, scripts/general/fieldnames.m, scripts/general/methods.m, scripts/java/errordlg.m, scripts/java/helpdlg.m, scripts/java/inputdlg.m, scripts/java/javaArray.m, scripts/java/javaaddpath.m, scripts/java/javaclasspath.m, scripts/java/javamem.m, scripts/java/javarmpath.m, scripts/java/listdlg.m, scripts/java/msgbox.m, scripts/java/questdlg.m, scripts/java/warndlg.m: Replace java_invoke calls with javaMethod calls.
author Rik <rik@octave.org>
date Fri, 14 Dec 2012 09:51:37 -0800
parents
children cf3bb2f353a5
comparison
equal deleted inserted replaced
15789:8056d0e36bef 15790:921912c92102
1 ## Copyright (C) 2007 Michael Goffioul
2 ##
3 ## This file is part of Octave.
4 ##
5 ## Octave is free software; you can redistribute it and/or modify it
6 ## under the terms of the GNU General Public License as published by
7 ## the Free Software Foundation; either version 3 of the License, or (at
8 ## your option) any later version.
9 ##
10 ## Octave is distributed in the hope that it will be useful, but
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 ## General Public License for more details.
14 ##
15 ## You should have received a copy of the GNU General Public License
16 ## along with Octave; see the file COPYING. If not, see
17 ## <http://www.gnu.org/licenses/>.
18
19 ## -*- texinfo -*-
20 ## @deftypefn {Built-in Function} {@var{ret} =} java_invoke (@var{obj}, @var{methodname})
21 ## @deftypefnx {Built-in Function} {@var{ret} =} java_invoke (@var{obj}, @var{methodname}, @var{arg1}, @dots{})
22 ## Invoke the method @var{methodname} on the Java object @var{obj} with the
23 ## arguments @var{arg1}, @dots{} For static methods, @var{obj} can be a
24 ## string representing the fully qualified name of the corresponding class.
25 ## The function returns the result of the method invocation.
26 ##
27 ## When @var{obj} is a regular Java object, structure-like indexing can be
28 ## used as a shortcut syntax. For instance, the two following statements are
29 ## equivalent
30 ##
31 ## @example
32 ## @group
33 ## ret = java_invoke (x, \"method1\", 1.0, \"a string\")
34 ## ret = x.method1 (1.0, \"a string\")
35 ## @end group
36 ## @end example
37 ##
38 ## @seealso{javaMethod, javaObject}
39 ## @end deftypefn
40
41 function retval = java_invoke (obj, methodname, varargin)
42
43 persistent warned = false;
44 if (! warned)
45 warned = true;
46 warning ("Octave:deprecated-function",
47 "java_invoke is obsolete and will be removed from a future version of Octave, please use javaMethod instead");
48 endif
49
50 if (nargin < 2)
51 print_usage ();
52 endif
53
54 retval = javaMethod (methodname, obj, varargin);
55
56 endfunction
57