In POF-serialized .NET objects, I have Class A containing Class B, and Class B has an Attribute X which I want to extract and use in a filter.
I can use a SimplePofPath
to navigate through the POF stream from A to B and grab X. This works well, except when A.B == null
.
When A does not have an instance of B where expected, the SimplePofPath
fails with message
getChild() method cannot be invoked on the SimplePofValue instance.
Instead of this, I would like an IPofNavigator
that does something more graceful than throw an exception when it can't traverse its path because I serialized null
in a field. This could be, say, returning a user-supplied "fallback" value.
Does such an implementation exist? If not, how would I get started extending AbstractPofPath
on my own? I have taken a look at this custom navigator dealing with contained collections, but can't wrap my head around how to get started implementing navigate()
.