コード例 #1
0
ファイル: _jobject.py プロジェクト: mattooca/jpype
 def __new__(cls, *args, **kwargs):
     if cls != JObject:
         return super(JObject, cls).__new__(cls)
     # Create a null pointer object
     if len(args) == 0:
         args = [None]
     cls = _JObjectFactory(*args, **kwargs)
     self = cls.__new__(cls, args[0])
     self.__javavalue__ = _jpype.PyJPValue(cls.__javaclass__, args[0])
     return self
コード例 #2
0
 def init(self, v):
     if v is not None:
         self._pyv = v
         self.__javavalue__ = _jpype.PyJPValue(self.__javaclass__, v)
     else:
         self.__javavalue__ = None
コード例 #3
0
def runValueEntry():
    # fails as no JVM is running yet
    _jpype.PyJPValue()
コード例 #4
0
 def testValueInitBad2(self):
     with self.assertRaises(TypeError):
         _jpype.PyJPValue("no", "no")