Return-Path: Delivered-To: apmail-commons-user-archive@www.apache.org Received: (qmail 43473 invoked from network); 23 Mar 2009 11:19:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 23 Mar 2009 11:19:03 -0000 Received: (qmail 50317 invoked by uid 500); 23 Mar 2009 11:19:02 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 50203 invoked by uid 500); 23 Mar 2009 11:19:02 -0000 Mailing-List: contact user-help@commons.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Commons Users List" Delivered-To: mailing list user@commons.apache.org Received: (qmail 50193 invoked by uid 99); 23 Mar 2009 11:19:01 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Mar 2009 11:19:01 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of ahhughes@gmail.com designates 209.85.142.186 as permitted sender) Received: from [209.85.142.186] (HELO ti-out-0910.google.com) (209.85.142.186) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Mar 2009 11:18:54 +0000 Received: by ti-out-0910.google.com with SMTP id y8so1264178tia.10 for ; Mon, 23 Mar 2009 04:18:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=VhHcilc0S3gppUNkC/v9+8Ibg/96tXV3G1ot+xh61Ps=; b=FL/zgWSl/w5js9gtSQgd93/8ipvRjneJQZZTLMU4xZp3uvTt4zCWqypsC3P4XFumu6 +28Q6DMt1pFJptlJMdsoCJJRf14zDpP6fmsXw3yS57du/Nnd0x2LUYo/f45/Xkrwxl4O v9on7qIdxjArcbDSUQqjNF6vXx/S/u32YTC1o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=m63KMOPaHKeRa9BRFdVlyWeJtIG/JoXlWIX+cjNBC0JCxQzLLDzwklMqQf2jAFFlCA ZRYn3C9/ZgxBCouyE85s80DemQJA2eCp8Nk4ERyePZw0tHlXuy1lQmfntz4XExN57Fgb kXZ1iU5NoOsUC4Hf7VPMs1kx3Hq+kDMb8oG7Q= MIME-Version: 1.0 Received: by 10.110.37.3 with SMTP id k3mr10855948tik.16.1237807110910; Mon, 23 Mar 2009 04:18:30 -0700 (PDT) In-Reply-To: <924919.22594.qm@web55103.mail.re4.yahoo.com> References: <924919.22594.qm@web55103.mail.re4.yahoo.com> Date: Mon, 23 Mar 2009 21:48:30 +1030 Message-ID: <5f528cf40903230418k2eb94816n2ab715c0d9ee0092@mail.gmail.com> Subject: Re: [JXPath][BeanUtils] External Bean PropertyDescriptor? From: Andrew Hughes To: Commons Users List Content-Type: multipart/alternative; boundary=0016e64f80b42576960465c76d52 X-Virus-Checked: Checked by ClamAV on apache.org --0016e64f80b42576960465c76d52 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Thanks again Matt, Well in the limited time I have to write code... I've learnt that the DynamicPropertyHandler does indeed do what I need it to do. I'd also say that I learnt a few things about it... because the DynamicPropertyHandler is an inspector of the BeanClass (instance), it's a "slow" mechanism because it needs to inspect the BeanClass(es) each evalution. Sure it works... perfect... but slow. I have two solutions both are really the same.. 1) is to load the BeanClass (refernces) into a DynaBean name/index delegate 2) is to load the (references) to BeanClass into HashMap>. Whichever is up to the implementation, but it is quite straight foward and it does lead to some extremely fast lookups 16ms in my case :) Watch how you store your references and make them optimized and then w00t for JXPath :) On Wed, Mar 18, 2009 at 2:41 AM, Matt Benson wrote: > > Possibly you can get some love registering a DynamicPropertyHandler class > via JXPathIntrospector.registerDynamicClass(...). > > -Matt > > --- On Mon, 3/16/09, Andrew Hughes wrote: > > > From: Andrew Hughes > > Subject: [JXPath][BeanUtils] External Bean PropertyDescriptor? > > To: "Commons Users List" > > Date: Monday, March 16, 2009, 9:53 PM > > Hi, > > I am trying to use JXPath on a not-so-bean complient > > "Something.java" class. > > The JXBeanInfo< > http://commons.apache.org/jxpath/apidocs/org/apache/commons/jxpath/JXPathBeanInfo.html#getDynamicPropertyHandlerClass() > > > > method > > getPropertyDescriptor stipulates that I return a > > PropertyDescriptor< > http://java.sun.com/j2se/1.3/docs/api/java/beans/PropertyDescriptor.html> > > in > > order to allow JXPath to get/set the properties within > > "Something.java". The > > problem is that the not-so-bean-complient "Something.java" > > class doesn't > > have get/set equivalent methods. It actually has iterator() > > and from that > > you can then iterate over all "properties" and work with > > them directly. > > > > Can I somehow inject a method implementation or proxy > > object outside of > > "Something.java" that will provide the required logic/code > > to perform the > > get/set operation on Something.java's properties? > > > > Any help would be much appreciated :) > > > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org > For additional commands, e-mail: user-help@commons.apache.org > > --0016e64f80b42576960465c76d52--