MCPcopy Create free account
hub / github.com/java-native-access/jna / toString

Method toString

src/com/sun/jna/ptr/ByReference.java:60–74  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

58 }
59
60 @Override
61 public String toString() {
62 try {
63 Method getValue = getClass().getMethod("getValue");
64 Object value = getValue.invoke(this);
65 if (value == null) {
66 return String.format("null@0x%x", Pointer.nativeValue(getPointer()));
67 }
68 return String.format("%s@0x%x=%s", value.getClass().getSimpleName(), Pointer.nativeValue(getPointer()),
69 value);
70 } catch (Exception ex) {
71 return String.format("ByReference Contract violated - %s#getValue raised exception: %s",
72 getClass().getName(), ex.getMessage());
73 }
74 }
75}

Callers 6

testPlatformToStringsMethod · 0.95
lookupMethodMethod · 0.45
runMethod · 0.45
toNativeMethod · 0.45
fromNativeMethod · 0.45

Calls 6

nativeValueMethod · 0.95
formatMethod · 0.80
invokeMethod · 0.65
getPointerMethod · 0.65
getNameMethod · 0.65
getMethodMethod · 0.45

Tested by 1

testPlatformToStringsMethod · 0.76