Mercurial > hg > octave-nkf
annotate 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 |
rev | line source |
---|---|
15790
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
1 ## Copyright (C) 2007 Michael Goffioul |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
2 ## |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
3 ## This file is part of Octave. |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
4 ## |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
5 ## Octave is free software; you can redistribute it and/or modify it |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
6 ## under the terms of the GNU General Public License as published by |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
7 ## the Free Software Foundation; either version 3 of the License, or (at |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
8 ## your option) any later version. |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
9 ## |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
10 ## Octave is distributed in the hope that it will be useful, but |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
13 ## General Public License for more details. |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
14 ## |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
15 ## You should have received a copy of the GNU General Public License |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
16 ## along with Octave; see the file COPYING. If not, see |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
17 ## <http://www.gnu.org/licenses/>. |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
18 |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
19 ## -*- texinfo -*- |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
20 ## @deftypefn {Built-in Function} {@var{ret} =} java_invoke (@var{obj}, @var{methodname}) |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
21 ## @deftypefnx {Built-in Function} {@var{ret} =} java_invoke (@var{obj}, @var{methodname}, @var{arg1}, @dots{}) |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
22 ## Invoke the method @var{methodname} on the Java object @var{obj} with the |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
23 ## arguments @var{arg1}, @dots{} For static methods, @var{obj} can be a |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
24 ## string representing the fully qualified name of the corresponding class. |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
25 ## The function returns the result of the method invocation. |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
26 ## |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
27 ## When @var{obj} is a regular Java object, structure-like indexing can be |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
28 ## used as a shortcut syntax. For instance, the two following statements are |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
29 ## equivalent |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
30 ## |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
31 ## @example |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
32 ## @group |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
33 ## ret = java_invoke (x, \"method1\", 1.0, \"a string\") |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
34 ## ret = x.method1 (1.0, \"a string\") |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
35 ## @end group |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
36 ## @end example |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
37 ## |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
38 ## @seealso{javaMethod, javaObject} |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
39 ## @end deftypefn |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
40 |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
41 function retval = java_invoke (obj, methodname, varargin) |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
42 |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
43 persistent warned = false; |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
44 if (! warned) |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
45 warned = true; |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
46 warning ("Octave:deprecated-function", |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
47 "java_invoke is obsolete and will be removed from a future version of Octave, please use javaMethod instead"); |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
48 endif |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
49 |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
50 if (nargin < 2) |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
51 print_usage (); |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
52 endif |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
53 |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
54 retval = javaMethod (methodname, obj, varargin); |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
55 |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
56 endfunction |
921912c92102
Deprecate java_invoke, replace with javaMethod.
Rik <rik@octave.org>
parents:
diff
changeset
|
57 |