Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 71157 invoked from network); 26 May 2005 06:25:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 26 May 2005 06:25:51 -0000 Received: (qmail 31847 invoked by uid 500); 26 May 2005 06:25:44 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 31832 invoked by uid 500); 26 May 2005 06:25:44 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 31813 invoked by uid 99); 26 May 2005 06:25:44 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from mail.wilde-welt.de (HELO mail.wilde-welt.de) (81.169.128.129) by apache.org (qpsmtpd/0.28) with ESMTP; Wed, 25 May 2005 23:25:43 -0700 Received: from [10.0.1.201] (p50862077.dip0.t-ipconnect.de [80.134.32.119]) by mail.wilde-welt.de (Postfix) with ESMTP id 89DF850097 for ; Thu, 26 May 2005 08:25:39 +0200 (CEST) Mime-Version: 1.0 (Apple Message framework v622) In-Reply-To: <1117053378.5005.42.camel@knossos.elmet> References: <2430.195.227.102.133.1116934221.squirrel@currywurst.wilde-welt.de> <1117053378.5005.42.camel@knossos.elmet> X-Priority: 3 Content-Type: text/plain; charset=US-ASCII; format=flowed Message-Id: Content-Transfer-Encoding: 7bit From: Christian Aust Subject: Re: [betwixt] Using options while mapping a Java type Date: Thu, 26 May 2005 08:25:41 +0200 To: "Jakarta Commons Users List" X-Mailer: Apple Mail (2.622) X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi Robert, thanks for your reply. My problem is that the BeanWriter has to decide at runtime if it should descend into the return value of getStandardProperty() or getOtherProperty(). It's needed for some kind of 'preview' functionality where non-standard data needs to be written. I can't implement this in the data model because it would create dependencies between the data model and the runtime behaviour. I'd like to have that "option" approach working because this way I could define in the .betwixt file what property needs to be changed to another method in the case of a preview. Obviously putting this knowledge in the BeanWriter wouldn't be too smart either, hard-coding class and method names from the data model which need to be changed. Changing the property value is perfect, but change it to what value? That's where the option should come in. Unfortunately, the BeanWriter doesn't introspect bean metadata until a bean class is written for the first time, so I figured that some strategy would help that allows the introspector to access options from the .betwixt file. I didn't find anything now where this could fit in so I'm a bit lost... - Christian Am 25.05.2005 um 22:36 schrieb robert burrell donkin: > hi christian > > i'm not sure that this is possible right now. i'm also not too sure > whether it'd be possible to add an easy implementation to betwixt. > > one thing i'm a little unclear about is why using an option in the > betwixt file is preferable to just changing the property attribute > value. will you explain? > > - robert > > On Tue, 2005-05-24 at 13:30 +0200, Christian Aust wrote: >> Hi, >> >> I'd like to customize the way betwixt maps Java types at runtime. See >> this: >> >> Class file (shortened for readability): >> ============================================================== >> class MyBean { >> public Object getStandardProperty() {} >> public Object getOtherProperty() {} >> } >> ============================================================== >> >> .betwixt file: >> ============================================================== >> >> >> >> >> >> >> >> >> >> ============================================================== >> >> I'd like to implement some (pluggable?) strategy that checks if that >> option "ifPreview" >> is set and in that case returns the value of getOtherProperty() >> instead of >> getStandardProperty() as the element named "mybean.attachedObject". >> >> I've tried a number of strategies, but couldn't find the right one. >> Could somebody >> please assist me in the right direction? Regards, >> >> - Christian > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: commons-user-help@jakarta.apache.org > > -- Christian Aust mailto:christian@wilde-welt.de icq: 84500990 - Yahoo!: datenimperator - MSN: datenimperator PGP: A94E 0181 664D 27E3 F05A A751 6A7E 90D1 A0A3 DEC7 --------------------------------------------------------------------- To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: commons-user-help@jakarta.apache.org