This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Is there a method (or something? anything?) that will allow me to determine where a given instance of TransactionDeclaration is from?
No; there's no way within Java to determine from where an object is referenced. Remember that although it may not be possible in your application, it's possible in theory for a single object to be an instance variable in several other objects.
That's actually one of the cool things about OO (and good modularity in any language.) An object doesn't depend on how it's used, so other folks are free to come up with creative new uses. If you had code that said:
you'd have to modify that code every time you used it in a new place. Back in the previous millennium I worked with COBOL programs that had that dependency and it was way ugly.
You said "I was afraid of that" which hints at some other problem you're trying to solve. What's up? Maybe we can help. [ October 19, 2007: Message edited by: Stan James ]
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi