Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
import java classes with underscores

Subject: import java classes with underscores

From: Kees-Jan

Date: 25 Oct, 2010 09:47:04

Message: 1 of 3

Is it possible to import java classes that are located in a package that starts with an _ (underscore).

For example a package named: deelnemer._2010.rits

Subject: import java classes with underscores

From: Kees-Jan

Date: 1 Nov, 2010 02:10:04

Message: 2 of 3

"Kees-Jan " <hooglandmodelit@gmail.com> wrote in message <ia3jmn$6q9$1@fred.mathworks.com>...
> Is it possible to import java classes that are located in a package that starts with an _ (underscore).
>
> For example a package named: deelnemer._2010.rits

It is possible to create an instance of a class starting with an _ by using AWTcreate

e.g. obj = awtcreate('_package.classname')

but now when inspecting the class no methods seem to be available although

cls = getClass(obj)
cls.getMethods

results in:

cls.getMethods
 
ans =
 
java.lang.reflect.Method[]:
    [java.lang.reflect.Method]
    [java.lang.reflect.Method]
    [java.lang.reflect.Method]
    [java.lang.reflect.Method]
    [java.lang.reflect.Method]
    [java.lang.reflect.Method]
    [java.lang.reflect.Method]
    [java.lang.reflect.Method]
    [java.lang.reflect.Method]
    [java.lang.reflect.Method]

these methods can be used with awtinvoke but is there a way to make the methods directly available in Matlab?

Subject: import java classes with underscores

From: Yair Altman

Date: 1 Nov, 2010 06:24:04

Message: 3 of 3

"Kees-Jan " <hooglandmodelit@gmail.com> wrote in message <ial7hs$189$1@fred.mathworks.com>...
> > Is it possible to import java classes that are located in a package that starts with an _ (underscore).
> >
> > For example a package named: deelnemer._2010.rits
>
> It is possible to create an instance of a class starting with an _ by using AWTcreate
>
> e.g. obj = awtcreate('_package.classname')
>
> but now when inspecting the class no methods seem to be available although
>
> cls = getClass(obj)
> cls.getMethods
[snip]
> these methods can be used with awtinvoke but is there a way to make the methods directly available in Matlab?

obj.methods
obj.methodsview
obj.myMethod(a,b,c)

Yair Altman
http://UndocumentedMatlab.com

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us