× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Larry, I assume that you also have an object of type Source defined
somewhere:

D Source          S               O   Class(*Java:                     
D                                     :'javax.xml.transform-
D                                     .Source')

Define your constructor the way you normally would, to return an object
of type StreamSource, and then simply assign that result to the Source
variable:

D new_StreamSource...
D                 pr              O   EXTPROC(*JAVA
D                                     :'javax.xml.transform-
D                                     .stream.StreamSource'
D                                     :*CONSTRUCTOR)
D                                     Class(*JAVA
D                                     :'javax.xml.transform-
D                                     .Source')

In your C-specs:

C    Source = new_StreamSource();

Now you have an object handle of type Source that points to an object of
type StreamSource.

Joe


> From: Larry Ducie
> 
> I have a question regarding the ability to cast java objects via the
RPG -
> Java interface.
> (...)
> But, of course, I get the following message if I try this: 'The return
> value
> of a Java constructor must have the same class as the method.' (I'm
trying
> to use the StreamSource constructor to create a StreamSource object
cast
> as
> a Source object)
> 
> As javax.xml.transform.Source is an interface I can't simply
instantiate
> it
> can I?
> 
> Does anybody have any ideas on how I can cast a concrete object to an
> abstract object in RPG?


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.