Note that there are some explanatory texts on larger screens.

plurals
  1. POJava Class extends Groovy Class
    primarykey
    data
    text
    <p>I am using a library called “SOA-Model”, by “Predic8”. Code can be found <a href="http://www.membrane-soa.org/downloads/soa-model.htm" rel="nofollow">here</a>.</p> <p>Some code of the library has been written in Groovy, but I am using this library from a Java Application. I am trying to write a class “ExternalResolver” that extends “ResourceResolver”. It is similar to this example code found <a href="https://github.com/membrane/soa-model/blob/3228d5a85d9e19ace24b798185db18e637c5a0eb/core/src/main/groovy/com/predic8/xml/util/ExternalResolver.groovy" rel="nofollow">here</a>. And the source-code for ResourceResolver I believe can be found <a href="https://github.com/membrane/soa-model/blob/master/core/src/main/groovy/com/predic8/xml/util/ResourceResolver.groovy" rel="nofollow">here</a>. </p> <p>However, I am writing this in <strong>Java</strong>, something like this:</p> <pre><code>import com.predic8.schema.Import; import com.predic8.xml.util.ResourceResolver; public class ExternalWSDLResolver extends ResourceResolver { public Object resolve(Object input, String baseDir){ //some code here to do the customised resolving } } </code></pre> <p>Now, the above all works fine if compiling in Eclipse.</p> <p>However, when I try to compile on IntellijIDEA, it forces me to implement several more methods. Essentially methods that implement: </p> <pre><code> - implements groovy.lang.GroovyObject.invokeMethod(String s, Object o) - implements groovy.lang.GroovyObject.getProperty(String s) - implements groovy.lang.GroovyObject.setProperty(String s, Object o) - implements groovy.lang.GroovyObject.getMetaClass() - implements groovy.lang.GroovyObject.setMetaClass(MetaClass metaClass) </code></pre> <p>For most I can simply get away with just returning “null”. However, if I do this for getMetaClass, my code won’t work, and returns an exception.</p> <p>I therefore need to know: </p> <ul> <li>Is there a way I can shut-down these warning on Intellij? ... OR</li> <li>What I could put into getMetaClass to just get it to work? I.e. a kind-of default value.</li> </ul> <p><strong>EDIT:</strong></p> <p>As suggested in the comments to decompile the <code>ResourceResolver.class</code>, accordingly, here is the results for example for getMetaClass. </p> <p>Also, for reference I have pasted the entire output here: <a href="http://pastie.org/7980007" rel="nofollow">http://pastie.org/7980007</a></p> <pre><code>public groovy.lang.MetaClass getMetaClass(); Code: 0: aload_0 1: getfield #27; //Field metaClass:Lgroovy/lang/MetaClass; 4: dup 5: ifnull 9 8: areturn 9: pop 10: aload_0 11: dup 12: invokevirtual #25; //Method $getStaticMetaClass:()Lgroovy/lang/MetaClass; 15: putfield #27; //Field metaClass:Lgroovy/lang/MetaClass; 18: aload_0 19: getfield #27; //Field metaClass:Lgroovy/lang/MetaClass; 22: areturn </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload