Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 35 additions & 0 deletions javaobj/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -906,6 +906,9 @@ def do_object(self, parent=None, ident=0):
and classdesc.flags & self.SC_WRITE_METHOD
or classdesc.flags & self.SC_EXTERNALIZABLE
and classdesc.flags & self.SC_BLOCK_DATA
or classdesc.superclass is not None
and classdesc.superclass.flags & self.SC_SERIALIZABLE
and classdesc.superclass.flags & self.SC_WRITE_METHOD
):
# objectAnnotation
log_debug(
Expand Down Expand Up @@ -1709,6 +1712,35 @@ def __extra_loading__(self, unmarshaller, ident=0):
# Lists have their content in there annotations
self.extend(self.annotations[1:])

class JavaBool(JavaObject):
def __init__(self, unmarshaller):
JavaObject.__init__(self)
self.value = None
pass

def __str__(self):
return self.value.__str__()

def __repr__(self):
return self.value.__repr__()

def __bool__(self):
return self.value

class JavaInt(JavaObject):
def __init__(self, unmarshaller):
self.value = None
JavaObject.__init__(self)

def __str__(self):
return self.value.__str__()

def __repr__(self):
return self.value.__repr__()

def __int__(self):
return self.value

class JavaMap(dict, JavaObject):
"""
Python-Java dictionary/map bridge type
Expand Down Expand Up @@ -1955,6 +1987,9 @@ def do_period(self, unmarshaller, data):
"java.util.HashSet": JavaSet,
"java.util.TreeSet": JavaTreeSet,
"java.time.Ser": JavaTime,
"java.lang.Boolean": JavaBool,
"java.lang.Integer": JavaInt,
"java.lang.Long": JavaInt,
}

def create(self, classdesc, unmarshaller=None):
Expand Down