Return-Path: Delivered-To: apmail-commons-user-archive@www.apache.org Received: (qmail 17287 invoked from network); 29 Apr 2009 06:09:51 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 29 Apr 2009 06:09:51 -0000 Received: (qmail 17345 invoked by uid 500); 29 Apr 2009 06:09:49 -0000 Delivered-To: apmail-commons-user-archive@commons.apache.org Received: (qmail 17237 invoked by uid 500); 29 Apr 2009 06:09:48 -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 17227 invoked by uid 99); 29 Apr 2009 06:09:48 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Apr 2009 06:09:48 +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.187 as permitted sender) Received: from [209.85.142.187] (HELO ti-out-0910.google.com) (209.85.142.187) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 29 Apr 2009 06:09:40 +0000 Received: by ti-out-0910.google.com with SMTP id b6so101175tic.10 for ; Tue, 28 Apr 2009 23:09:17 -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=kPAon6f480nK9SBxBApcyZBQ66f22VABUGctwsOWlKk=; b=eiJY3M25s2Q6W4e2h1z/on/PjpLI4cB8HzTUJAspLSbHp4HqU2KSvco5CTJsAw1GA0 i2Zxt/m0g/oov5ND5C68s5ArFWqRoOc2tmIao2Fkluxgc/mfeQNDNMstlPUN0odq9+vI ZdUErnl+VLLhb3qc/ujT7KJvmmyl9ktTCX940= 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=YGAbGrfB+i+dffy6fBOQvHjU3Kjh8VKjWCZi2+dn/gtGsO9S5YG20ptdYgZRG1x14z 8tqmSrmA9EehZOJZ94W28a1sVVvVKN2VbFh3F7MsKTLdPsIQ1OBTShhdrQkko4mMOljl mS3WG+3+IIvyagqcG0Bd3rtw+6WIMZoUsIwpg= MIME-Version: 1.0 Received: by 10.110.16.15 with SMTP id 15mr580759tip.53.1240985357226; Tue, 28 Apr 2009 23:09:17 -0700 (PDT) In-Reply-To: <3ee326610904271336x1a3926fel4b38b1fd3ad4e957@mail.gmail.com> References: <5f528cf40904231939w1cacd5a3sa5f0243eb30681de@mail.gmail.com> <5f528cf40904270650n1bbd990bib9f6308158137e8c@mail.gmail.com> <3ee326610904271336x1a3926fel4b38b1fd3ad4e957@mail.gmail.com> Date: Wed, 29 Apr 2009 15:39:17 +0930 Message-ID: <5f528cf40904282309y13eff944o2ce35d420d468617@mail.gmail.com> Subject: Re: [JXPath] Questions about pointers, listeners & filters From: Andrew Hughes To: Commons Users List Content-Type: multipart/alternative; boundary=0016e6513cb06396400468ab6bef X-Virus-Checked: Checked by ClamAV on apache.org --0016e6513cb06396400468ab6bef Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Actually, this has all fallen apart. The filtering idea revolving around two context's (one private one public), each with it's own DynamicPropertyHandler for the Bean. The public would only expose the bean if MyBean.filtered==false. The second would expose MyBean without this restriction - but do so privately. A custom JXPath function used in this context could be used to toggle this filtered value... for example... public static boolean applyFilter(ExpressionContext context) { ((MyBean)context.getValue()).setFiltered(true); } and this is applied to the context with the following expression... mynamespace:MyFunctionClass.applyFilter(/Path/To/Something[color="TRANSPARENT"]); The problem is that I can not define two seperate DynamicPropertyHandler's for the one class in seperate contexts :'( Any idea's? After loads of thought.. listeners are easy. Listeners can/should only be listening at the root pointer/context level (because they can listen to everything). My Bean itself is responsible for invoking the listener facility when something is constructed. The filter's above are invoked as they are applied as a listener. Hopefully there is a solution for the above, Cheers :) On Tue, Apr 28, 2009 at 6:06 AM, Adrian Mitev wrote: > Why don't you share us the solutions? > > On Mon, Apr 27, 2009 at 4:50 PM, Andrew Hughes wrote: > > I think I have a solution for both based on JXPath. > > > > Cheers && a HUGE thank's to JXPath && Matt. > > > > > > On Fri, Apr 24, 2009 at 12:09 PM, Andrew Hughes > wrote: > > > >> Hi All - probably just Matt tho :) > >> I've had some great results with JXPath, and I am now getting down to > the > >> nitty/gritty of what I am trying to achieve. Which is quite complex and > I've > >> no doubt that more experienced people than me exist in this area! Help > is > >> once again greatly appreciated!!! > >> > >> Background: I am dealing with dynamic objects (Nodes). Node's > >> appear/disappear at runtime and are encapsulated in a heirarchy of > HashMap's > >> for JXPath's context bean. This works fantastic, but I have two > remaining > >> mandatory requirements. > >> > >> Requirement 1: Listening > >> As a new node appears, listeners defined as expressions would like to > know > >> about this. For example, someone would like to know if a Ferrari ever > >> appears in the context bean: //Car[@name="Ferrari"] > >> or /Transport/Vehicle/Car[@name="Ferrari"]. I believe that I should be > >> testing is if the newly created/removed node/pointer is found in any of > the > >> supplied listening expressions? Ideally this can be done by traversing > the > >> minimal number of object's as possible - and could be too inefficient > :'( > >> for use. > >> > >> Requirement 2: Filtering. > >> As a new node appear's I would like to know if I should include this > node > >> in the context bean hierarchy (i.e. addNewChild()) or ignore it. The > >> criteria is if the new node is found using an expression (include or > >> exclude). For example, if we don't deal with China then we might have an > >> exclude expression /World/Asia/China or /World/Asia/*. Can I determine > if > >> the new node is within an includes/excludes expression without having to > add > >> the node to the context, then testing, then removing - becuase this has > the > >> potential to falsly invoke listeners in Requirement #1 > >> > >> I'd like to know if there is any helpful functionality within jxpath > that I > >> am unaware of. I suspect there is > >> > >> > >> As usual... I'm incredibly thankful for any help I can get :) > >> > >> > > > > > > -- > Although nobody can come back and make a new start, anyone can start > now and make a new end > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@commons.apache.org > For additional commands, e-mail: user-help@commons.apache.org > > --0016e6513cb06396400468ab6bef--