import org.aspectj.lang.annotation.Aspect; import org.aspectj.lang.annotation.Before; import org.aspectj.lang.annotation.Pointcut; /** * This test is exploring situations where an if() pointcut is used with a parameter * and yet a reference pointcut referring to it is not binding the parameter. */ public class C { int i; C(int i) { this.i = i; } public static void main(String []argv) { new C(1).run(); } public void run() { System.out.println("C.run() executing"); } public String toString() { return "C("+i+")"; } } @Aspect abstract class Azpect1 { @Pointcut("if(false)") public void isCondition() {} @Before("isCondition() && execution(* C.run(..))") public void beforeAdvice() { System.out.println("Azpect1.beforeAdvice executing"); } } @Aspect class Azpect2 extends Azpect1 { @Pointcut("check(*)") public void isCondition() { } @Pointcut("this(c) && if()") public static boolean check(C c) { System.out.println("check if() pointcut running on "+c.toString()); return true; } } // //abstract aspect A { // pointcut isCondition(): if(false); // before(): isCondition() && execution(* C.run(..)) { System.out.println("A.before"); } //} // //aspect B extends A { // pointcut isCondition(): check(*); // pointcut check(Object o): this(o) && if(o.toString().equals("abc")); //} The official jQuery user interface library: https://github.com/jquery/jquery-uiwww-data
aboutsummaryrefslogtreecommitdiffstats
path: root/ui/data.js
blob: d0417b8f95006f3e3963e455a3d55462e2d51843 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*!
 * jQuery UI :data @VERSION
 * http://jqueryui.com
 *
 * Copyright jQuery Foundation and other contributors
 * Released under the MIT license.
 * http://jquery.org/license
 */

//>>label: :data Selector
//>>group: Core
//>>description: Selects elements which have data stored under the specified key.
//>>docs: http://api.jqueryui.com/data-selector/

( function( factory ) {
	if ( typeof define === "function" && define.amd ) {

		// AMD. Register as an anonymous module.
		define( [ "jquery", "./version" ], factory );
	} else {

		// Browser globals
		factory( jQuery );
	}
} ( function( $ ) {
return $.extend( $.expr[ ":" ], {
	data: $.expr.createPseudo ?
		$.expr.createPseudo( function( dataName ) {
			return function( elem ) {
				return !!$.data( elem, dataName );
			};
		} ) :

		// Support: jQuery <1.8
		function( elem, i, match ) {
			return !!$.data( elem, match[ 3 ] );
		}
} );
} ) );