I have a method which takes : "java.io.Reader" as argument java.io.Reader is an Interface and cannot be instancied.
So, I use one sub class like this: StringReader= jp.java.io.StringReader("teststring")
How can I convert StringReader into java.io.Reader type ?
Because the method cannot do implicetely.
EDIT: I receive this error message when using the method:
txt= u'gfdgfdgddf'
StringReader = jp.JClass('java.io.StringReader')(txt)
StringReader.ready() #Ok works
userDicC= jp.JClass('org.apache.lucene.analysis.ja.dict.UserDictionary')
useDic= userDicC(StringReader)
Method details: public static UserDictionary open(Reader reader) throws IOException
I got this error:
userDicC= java.jp.JClass('org.apache.lucene.analysis.ja.dict.UserDictionary') useDic= userDicC(StringReader)
line 84, in _javaInit
self.__javaobject__ = self.__class__.__javaclass__.newClassInstance(*args)
RuntimeError: No matching overloads found. at src\native\common\jp_method.cpp:121
StringReaderto the method you say needs ajava.io.Reader?BufferedReaderfrom aStringReaderand that worked.