锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲激情欧美,嗯用力啊快一点好舒服小柔久久,国产成人精品久久亚洲高清不卡
http://www.aygfsteel.com/carob/archive/2006/08/15/63766.htmlcarob carob Tue, 15 Aug 2006 12:56:00 GMT http://www.aygfsteel.com/carob/archive/2006/08/15/63766.html http://www.aygfsteel.com/carob/comments/63766.html http://www.aygfsteel.com/carob/archive/2006/08/15/63766.html#Feedback 0 http://www.aygfsteel.com/carob/comments/commentRss/63766.html http://www.aygfsteel.com/carob/services/trackbacks/63766.html 聽聽聽聽聽聽聽聽聽 浠庣洰鍓嶇殑瓚嬪娍鏉ョ湅錛孫SGI鍦ㄨ蔣浠惰涓氱殑搴旂敤鐩稿綋琚湅濂斤紝ECLIPSE,WAS涔熷叏闈㈤噰鐢∣SGI瑙勮寖浜嗭紝鐢變簬eclipse鑷韓鍦ㄩ噰鐢∣SGI涔嬪墠鏈変竴濂楄嚜鎭扮殑plugin鏈哄埗錛岃岃繖縐嶅嚑涔庡叿澶囨棤闄愭墿鍏呯殑plugin鏈哄埗鎵撳紑浜嗕竴涓法澶х殑plugin甯傚満錛屽啀鍔犱笂OpenSource鐨勪笢椋庯紝浣垮緱eclipse鍑犱箮涓緇烰ava鐨処DE甯傚満銆?br />聽聽聽聽聽聽聽聽 浠?.0eclipse鍏ㄩ潰閲囩敤OSGI寮濮嬶紝渚垮OSGI澶氫簡涓浠界爺絀訛紝鍦ㄤ互eclipse涓鴻儗鏅殑妗岄潰杞歡寮鍙戦鍩燂紝osgi濡傞奔寰楁按錛屼絾鎴戞洿澶氱殑鏄湪鍋欽ava鐨剆erver绔紑鍙戯紝寰堟兂鑳藉鐪嬪埌web棰嗗煙鑳戒粠osgi/Equinox涓緱鍒頒竴浜涚伒鎰燂紝寰堝笇鏈涳紝閭g伒媧葷殑plugin/bundle鏈哄埗鑳藉彂鎸ュ湪web鐨勫墠鍚庣寮鍙戜腑錛屼箣鍓嶅湪TSS涓婃湁浜哄仛浜嗕竴涓嚜縐頒負RSP錛堜笌RCP鐩稿搷搴旓級鐨凞EMO錛屽睍紺轟簡濡備綍鍦╓eb欏甸潰涓仛鍒頒笉閲嶅惎鏈嶅姟鍣ㄦ潵瀹炵幇欏甸潰鏁版嵁鐨勫姩鎬佺粍瑁呭強鏈嶅姟璇鋒眰銆傛垜浠兘鐭ラ亾鍦╡clipse鐨勬彃浠跺紑鍙戜腑錛屾垜浠彲浠ュ崟鐙紑鍙戜竴涓獀iewpart鎴栬呰彍鍗曟潵鎻掑叆鍒扮幇鎴愮殑IDE涓屼繚鎸佺嫭绔嬫э紝濡傛灉榪欑鐗規ц兘鍦╓EB涓疄鐜扮殑璇濓紝閭f槸鐩稿綋鐨勮浜虹殑錛岀幇鍦‥quinox宸茬粡瀹炵幇鐨凮SGI 鐨勫ぇ閮ㄥ垎瑙勮寖錛屼篃鎻愪緵浜嗗serlvet鍙妀sp鐨勬敮鎸侊紝浣嗕粛涓嶅鏂逛究錛屽笇鏈涘湪涓嶄箙浠ュ悗鑳界湅榪欐柟闈㈢殑榪涘睍銆?br />聽聽聽聽聽
]]>SWT涓殑Sytem Tray鐩稿叧澶勭悊 http://www.aygfsteel.com/carob/archive/2006/03/19/36076.htmlcarob carob Sun, 19 Mar 2006 08:36:00 GMT http://www.aygfsteel.com/carob/archive/2006/03/19/36076.html http://www.aygfsteel.com/carob/comments/36076.html http://www.aygfsteel.com/carob/archive/2006/03/19/36076.html#Feedback 0 http://www.aygfsteel.com/carob/comments/commentRss/36076.html http://www.aygfsteel.com/carob/services/trackbacks/36076.html 聽聽聽聽聽聽聽聽聽SWT宸茬粡鎻愪緵浜嗗閮ㄥ垎騫沖彴錛堟瘮濡倃indow錛変笂鐨勭郴緇熸墭鐩樼殑鏀寔銆備絾鏀寔寰楄繕涓嶅濂斤紝鎴戞渶榪戦渶瑕佸湪涓涓亰澶╁伐鍏峰疄鐜癇alloon鏁堟灉(綺橀檮浜庣郴緇熸墭鐩樹笂鐨勪竴涓秷鎭皵娉℃晥鏋滐紝鍦↖M杞歡涓櫘閬嶈鏀寔)錛屾煡涓涓婼WT API,鍒扮洰鍓嶄負涓婂茍娌℃湁鎻愪緵鏀寔銆備絾涓涓ソ娑堟伅鏄湪鏈堝簳浜よ鍑烘潵鐨?.2M6涓紝灝嗗閮ㄥ垎API鍋氳皟鏁達紝澧炲姞瀵笲alloon鐨勬敮鎸併?br />
Milestone聽Plan聽
3.2
聽M6聽March聽
31
,聽
2006
聽聽 聽Implement聽custom聽draw聽
for
聽table聽and聽tree聽 Implement聽
native
聽drag聽source聽effects聽
for
聽cursor聽 Implement聽ImageTransfer聽support聽Implement聽Balloon聽tooltips 聽 Implement聽Accessibility聽on聽Mac聽OS聽X聽
聽聽聽聽聽榪欏効鏄疎clipseZone涓婄殑涓涓拡瀵硅繖涓鏁堟灉鐨勬枃绔狅細TrayIcons and ToolTips 聽http://www.eclipsezone.com/eclipse/forums/t66093.rhtml 鐢氳嚦鍦ㄥ畼鏂圭綉绔欎笂錛屽凡緇忔彁渚涗簡榪欎竴涓狝PI鐨凷nippet// http://dev.eclipse.org/viewcvs/index.cgi/%7Echeckout%7E/org.eclipse.swt.snippets/src/org/eclipse/swt/snippets/Snippet225.java /**聽*/ /** ***************************************************************************** 聽*聽Copyright聽(c)聽2000,聽2006聽IBM聽Corporation聽and聽others. 聽*聽All聽rights聽reserved.聽This聽program聽and聽the聽accompanying聽materials 聽*聽are聽made聽available聽under聽the聽terms聽of聽the聽Eclipse聽Public聽License聽v1.0 聽*聽which聽accompanies聽this聽distribution,聽and聽is聽available聽at 聽*聽 http://www.eclipse.org/legal/epl-v10.html 聽* 聽*聽Contributors: 聽*聽聽聽聽聽IBM聽Corporation聽-聽initial聽API聽and聽implementation 聽*******************************************************************************/ package 聽org.eclipse.swt.snippets; 聽聽 /**/ /* 聽*聽Tooltip聽example聽snippet:聽create聽a聽balloon聽tooltip聽for聽a聽tray聽item 聽* 聽*聽For聽a聽list聽of聽all聽SWT聽example聽snippets聽see 聽*聽http://www.eclipse.org/swt/snippets/ 聽*聽 聽*聽@since聽3.0 聽*/ import 聽org.eclipse.swt. * ; import 聽org.eclipse.swt.graphics. * ; import 聽org.eclipse.swt.widgets. * ; public 聽 class 聽Snippet225聽 { public 聽 static 聽 void 聽main(String[]聽args)聽 { 聽聽聽聽Display聽display聽 = 聽 new 聽Display(); 聽聽聽聽Shell聽shell聽 = 聽 new 聽Shell(display); 聽聽聽聽Image聽image聽 = 聽 null ; 聽聽聽聽 final 聽ToolTip聽tip聽 = 聽 new 聽ToolTip(shell,聽SWT.BALLOON聽 | 聽SWT.ICON_INFORMATION); 聽聽聽聽tip.setMessage( " Here聽is聽message聽for聽the聽user.聽When聽the聽message聽is聽too聽long聽it聽wraps.聽I聽should聽say聽something聽cool聽but聽nothing聽comes聽to聽my聽mind. " ); 聽聽聽聽Tray聽tray聽 = 聽display.getSystemTray(); 聽聽聽聽 if 聽(tray聽 != 聽 null )聽 { 聽聽聽聽聽聽聽聽TrayItem聽item聽 = 聽 new 聽TrayItem(tray,聽SWT.NONE); 聽聽聽聽聽聽聽聽image聽 = 聽 new 聽Image(display,聽Snippet225. class .getResourceAsStream( " eclipse.png " )); 聽聽聽聽聽聽聽聽item.setImage(image); 聽聽聽聽聽聽聽聽tip.setText( " Notification聽from聽a聽tray聽item " ); 聽聽聽聽聽聽聽聽item.setToolTip(tip); 聽聽聽聽} 聽 else 聽 { 聽聽聽聽聽聽聽聽tip.setText( " Notification聽from聽anywhere " ); 聽聽聽聽聽聽聽聽tip.setLocation( 400 ,聽 400 ); 聽聽聽聽} 聽聽聽聽Button聽button聽= 聽 new 聽Button聽(shell,聽SWT.PUSH); 聽聽聽聽button.setText( " Press聽for聽balloon聽tip " ); 聽聽聽聽button.addListener(SWT.Selection,聽 new 聽Listener()聽 { 聽聽聽聽聽聽聽聽 public 聽 void 聽handleEvent(Event聽event)聽 { 聽聽聽聽聽聽聽聽聽聽聽聽tip.setVisible( true ); 聽聽聽聽聽聽聽聽} 聽聽聽聽}); 聽聽聽聽button.pack(); 聽聽聽聽shell.setBounds( 50 ,聽 50 ,聽 300 ,聽 200 ); 聽聽聽聽shell.open(); 聽聽聽聽 while 聽( ! shell.isDisposed())聽 { 聽聽聽聽聽聽聽聽 if 聽( ! display.readAndDispatch())聽display.sleep(); 聽聽聽聽} 聽聽聽聽if 聽(image聽 != 聽 null )聽image.dispose(); 聽聽聽聽display.dispose(); } }闄ゆ涔嬪錛屼篃鏈夊叾瀹冪殑絎笁鏂笰PI瀹炵幇浜嗘涓鏁堟灉銆傛槸鐢?a >www.novocode.com鎻愪緵鐨凚alloonWindow銆傚叾API鍙湪涓婅堪鐨勭綉绔欎腑鑾峰緱銆?/p>
]]> 濡備綍鑾峰彇call stack(璋冪敤鏍?淇℃伅鈥斺斾箣浜?/title> http://www.aygfsteel.com/carob/archive/2005/03/13/2027.htmlcarob carob Sun, 13 Mar 2005 10:25:00 GMT http://www.aygfsteel.com/carob/archive/2005/03/13/2027.html http://www.aygfsteel.com/carob/comments/2027.html http://www.aygfsteel.com/carob/archive/2005/03/13/2027.html#Feedback 1 http://www.aygfsteel.com/carob/comments/commentRss/2027.html http://www.aygfsteel.com/carob/services/trackbacks/2027.html getSourceMethodname鍜屾柟娉?STRONG>getSourceClassName錛?鎴戜滑宸茬粡璧板湪姝g‘鐨勯亾璺笂浜嗭紝緇х畫榪芥煡getSourceMethodname() 鈥︹︹︹?BR>
public String getSourceClassName() { if (needToInferCaller) { inferCaller(); } return sourceClassName; } 緇х畫
// Private method to infer the caller's class and method names private void inferCaller() { needToInferCaller = false ; // Get the stack trace. StackTraceElement stack[] = ( new Throwable()).getStackTrace(); // First, search back to a method in the Logger class. int ix = 0 ; while (ix < stack.length) { StackTraceElement frame = stack[ix]; String cname = frame.getClassName(); if (cname.equals( " java.util.logging.Logger " )) { break ; } ix++ ; } 鈥︹︹︹︹︹?BR> 鈥︹︹︹︹︹?/SPAN> 鐩磋嚦榪欏効錛屾垜浠粓浜庡彲浠ユ澗涓鍙f皵浜嗭紝鍥犱負鎴戜滑宸茬粡鎵懼埌浜嗗叾涓殑鍏抽敭
StackTraceElement stack[] = ( new Throwable()).getStackTrace(); 娌¢敊錛屽氨鏄繖涓猄tackTraceElement鏁扮粍璁拌澆浜嗘垜浠兂瑕佺殑淇℃伅錛堢被鍚嶏紝鏂規硶鍚嶇瓑錛夛紝榪欏拰鎴戜滑鐢ㄥ埌鐨凟xception綾諱腑鐨勬樉紺鴻皟鐢ㄦ爤鏄竴涓亾鐞嗙殑銆?BR> 娉ㄦ剰錛氳繖鍎塊氳繃鍒涘緩涓涓猅hrowable瀹炰緥錛屽茍鍒╃敤鍦═hrowable綾諱腑鎻愪緵榪欎釜getStackTrace()鏂規硶錛岃繑鍥炴槸StackTraceElement鏁扮粍鏉ヨ幏鍙栧埌浜嗚皟鐢ㄦ爤淇℃伅銆?BR> 鎴戜滑鏉ョ湅涓涓皬渚嬪瓙
public class CallStack { String showTrace() { return new Throwable().getStackTrace()[ 0 ].toString(); } public static void main(String[] args) { System. out .println( new CallStack().showTrace()); } } 鎵撳嵃濡備笅 chapter5.CallStack.showTrace(CallStack.java:5) 鎴戜滑浜﹀彲浠ラ氳繃榪欐牱涓涓畝鍗曞湴瀹炰緥鍖栦竴涓猅hrowable鏉ヨ幏鍙栫浉搴旂殑call strack銆?BR> 涓嶈繃錛屼竴鑸殑搴旂敤綰х▼搴忛噷闈笉澶細鐢ㄥ埌瀹冿紝鍙兘鍦ㄥ伐鍏風駭杞歡閲岄潰鐢ㄥ緱澶氫竴鐐逛簡錛氾級 ]]> 濡備綍鑾峰彇call stack(璋冪敤鏍?淇℃伅鈥斺斾箣涓 http://www.aygfsteel.com/carob/archive/2005/03/13/2025.htmlcarob carob Sun, 13 Mar 2005 09:58:00 GMT http://www.aygfsteel.com/carob/archive/2005/03/13/2025.html http://www.aygfsteel.com/carob/comments/2025.html http://www.aygfsteel.com/carob/archive/2005/03/13/2025.html#Feedback 0 http://www.aygfsteel.com/carob/comments/commentRss/2025.html http://www.aygfsteel.com/carob/services/trackbacks/2025.html 鎴戜滑鍏堟潵鐪嬩竴孌典唬鐮?BR>
鈥︹︹︹?BR> 鈥︹︹︹?BR> void doSomething() { logger.info( " doSomething()璋冪敤鎴愬姛 " ); } 鈥︹︹︹?BR> 鈥︹︹︹?/SPAN> 榪欐槸鎴戞渶甯歌鐨勬棩蹇楄褰曟柟寮忋?BR> 鎴戜笅闈㈠氨寮濮嬫垜浠殑榪借釜浠ユ煡鍑簂ogging API鏄浣曡褰曚笂闈㈡彁鍒扮殑榪欎簺metadata鐨勩?BR> 榪欏効浠DK1.4涓殑logging API涓虹爺絀跺璞°?BR> 鍏堣繘鍏ava.util.logging.Logger涓紝鐪嬩竴涓媔nfo(String msg)榪欎釜鏂規硶
public void info(String msg) { if (Level.INFO.intValue() < levelValue) { return ; } log(Level.INFO, msg); } 緇х畫榪借釜
public void log(Level level, String msg) { if (level.intValue() < levelValue || levelValue == offValue) { return ; } LogRecord lr = new LogRecord(level, msg); doLog(lr); } 榪欏効鎴戜滑鍙戠幇浜嗕竴涓煎緱鍏蟲敞鐨勭被 LogRecord ,浠庡悕瀛椾笂鐚滃簲璇ユ槸鍜屾棩蹇椾俊鎭湁鍏崇殑涓涓被銆傛垜浠潵鐪嬩竴涓嬪畠鐨凧avadoc涓殑鎻忚堪
/**/ /* * * LogRecord objects are used to pass logging requests between * the logging framework and individual log Handlers. * <p> * When a LogRecord is passed into the logging framework it * logically belongs to the framework and should no longer be * used or updated by the client application. * <p> * Note that if the client application has not specified an * explicit source method name and source class name, then the * LogRecord class will infer them automatically when they are * first accessed (due to a call on getSourceMethodName or * getSourceClassName) by analyzing the call stack. 浠庤繖鍎垮彲浠ョ湅鍒幫細娉ㄦ剰濡傛灉瀹㈡埛绔▼搴忔病鏈夋樉寮忓湴鎸囧畾婧愭柟娉曞悕鍜屾簮綾誨悕錛屽垯LogRecord 綾誨皢閫氳繃鍒嗘瀽 call stack(璋冪敤鏍?鏉ヨ嚜鍔ㄦ彁鍙栬繖浜涗俊鎭紙鏂規硶getSourceMethodname 鍜屾柟娉?STRONG>getSourceClassName錛?鎴戜滑宸茬粡璧板湪姝g‘鐨勯亾璺笂浜嗭紝緇х畫榪芥煡getSourceMethodname() 鈥︹︹︹?BR> 錛堟湭瀹岋級 ]]> 搴旂敤Java Dynamic Proxy 瀹炵幇綾繪柟娉曠殑鎷︽埅(AOP) http://www.aygfsteel.com/carob/archive/2005/03/04/1678.htmlcarob carob Fri, 04 Mar 2005 02:37:00 GMT http://www.aygfsteel.com/carob/archive/2005/03/04/1678.html http://www.aygfsteel.com/carob/comments/1678.html http://www.aygfsteel.com/carob/archive/2005/03/04/1678.html#Feedback 0 http://www.aygfsteel.com/carob/comments/commentRss/1678.html http://www.aygfsteel.com/carob/services/trackbacks/1678.html 姣斿鎴戜滑鐜版湁涓瀵笽nterface/Implemention錛歋peakable/Translater銆?BR>Speakable鎺ュ彛鎸囨槑浜嗗彲浠ayEnglish(),sayChinese()銆傛垜浠洰鍓嶇殑translater瀹炵幇浜嗚繖涓や釜鏂規硶銆傜幇鍦ㄦ垜浠湪姝ゅ熀紜涓婏紝澧炲姞瀵箃ranslater鐨勬柟娉曠殑logging鍔熻兘銆?BR> 鍦ㄤ互鍓嶏紝鎴戜滑鍙互錛?BR> 1.鐩存帴鏀瑰啓鍘熶唬鐮侊紝澧炲姞logging鍔熻兘銆?ugly) 2.澧炲姞涓涓狶oggingTranlater瀹炵幇Speakable,閲囩敤delegation(Design Pattern)錛屽鏂規硶榪涜澧炲己銆傚姝ょ被proxy鍙互鍙傝僯ive錛屽叾涓亶甯僷roxy 銆傜己鐐瑰氨鏄瘡涓涓澧炲姞鐨勭被閮借瀹炵幇涓涓唬鐞嗙被錛屽彲浠ユ兂璞★紝浠g爜閲忔ュ墽鑶ㄨ儉銆?BR> 鐜板湪璁╂垜浠潵鐪嬬湅Java Dynamic Proxy鏄浣曡揪鍒拌繖涓鐐圭殑錛屽0鏄庢垜緇欏嚭鐨勪唬鐞嗘槸紺轟緥鎬х殑錛屾瘮杈冪畝闄嬶紝涓昏鏄粰鍑轟竴涓疄鐜版柟娉曪紝鍔犱互鏀硅繘錛屽嵆鍙艦鎴愪竴涓瘮杈冮氱敤鐨勫伐鍏楓?BR> 鍏堟潵鐪嬬湅鎴戜滑鐨処nterface/Implemention瀵癸細
package reflection.example; public interface Speakable { void sayEnglish(); void sayChinese(); }
package reflection.example; public class Translater implements Speakable { public void sayEnglish() { System. out .println( " Hello,i am robbie " ); } public void sayChinese() { System. out .println( " 浣犲ソ錛屾垜鏄ズ瀛?/SPAN>" ); } } 鐜板湪鎴戜滑瑕佽繘琛宭ogging鍔熻兘浜嗭紝璁頒綇錛屾垜浠彧闇鎻愪緵涓涓狪nvocationHandler:
package reflection.example; import java.lang.reflect.InvocationHandler; import java.lang.reflect.Method; public class LoggingInvoktionHandler implements InvocationHandler { private Object target = null ; public LoggingInvoktionHandler(Object target) { this .target = target; } public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { logging(method); return method.invoke(target, args); } private void logging(Method method) { if ( " sayChinese " .equals(method.getName())) { System. out .println( " 緲昏瘧寮濮?/SPAN>" ); } if ( " sayEnglish " .equals(method.getName())) { System. out .println( " Tranlation beginning " ); } } }
榪欎釜LoggingInvocationHandler瀹炵幇浜咺nvocationHandler鎺ヤ腑銆傛柟娉曠殑浠g悊璋冪敤鍦╥nvoke(鈥︹?涓紝鍙互濡傛垜娣誨姞logging()鍔熻兘涓鏍鳳紝鍔犲叆鍏跺畠鐨勪換浣曟兂瑕佺殑鍔熻兘錛岀劧鍚庡啀榪涜 real target鐨勬柟娉曡皟鐢ㄣ?BR> 濡傛灉灝唋ogging(Method method)涓殑閫昏緫鎶藉嚭鏉ワ紝鏀懼埌澶栭儴鏂囦歡(XML)涓繘琛岄厤緗鍙栥傚啀瀵規柟娉曞悕閲囩敤姝e垯琛ㄨ揪寮忋傛槸涓嶆槸鏇翠負閫氱敤浜嗗憿錛?/P>
涓嬮潰鏄鎴風璋冪敤錛?BR>
package reflection.example; import java.lang.reflect.Proxy; public class Main { /**/ /* * * @param args */ public static void main(String[] args) { Speakable speaker = new Translater(); Speakable loggingSpeaker = (Speakable) Proxy.newProxyInstance( speaker.getClass().getClassLoader(), new Class[] { Speakable. class } , new LoggingInvoktionHandler(speaker)); loggingSpeaker.sayChinese(); loggingSpeaker.sayEnglish(); } }
鏄笉鏄潪甯哥畝鍗曞憿錛燂細) 濡傛灉鍒版涓烘錛岃繕鏄湅涓嶅嚭Dynamic鍦ㄥ摢鍎跨殑錛屾兂鎯蟲垜榪欏効緇欏嚭鐨勭ず渚嬩笌spring鐨凙OP鐨勪笉鍚岋紝鍛靛懙錛屽尯鍒湪浜庢垜榪欏効緇欏嚭鐨凪ain浜︽槸spring AOP鐨勪竴閮ㄥ垎錛屽湪spring閲岋紝 瀵規煇涓狪nterface鐨則arget鐨勪唬鐞嗭紝閲囩敤浜哛eflection錛屼互杈懼埌鏅亶閫傜敤鐨勶紝涓嶇敤璞℃垜榪欐牱鐩存帴鏄懼紡鍦扮粰鍑虹被鍚嶈屽凡銆傝嫢鎴戞妸Main鍋氭垚涓涓狧elper綾伙紝鍚屾椂錛屾妸閰嶇疆鎺ュ彛鍙婁粬鐨勫疄鐜扮被閮芥斁鍒板閮╔ML涓厤緗紝鏄笉鏄氨鏈夌偣璞′竴涓秴綰х畝鍖栫殑spring AOP浜嗭紵 褰撶劧spring涓嶆槸瀹屽叏鐢↗ava Dynamic Proxy鐨勶紝鍥犱負Java Dynamic Proxy鐨勫墠鎻愨斺?STRONG>閽堝鎺ュ彛緙栫▼錛侊紝閽堝鏅氱殑綾葷殑AOP錛孲pring閲囩敤浜嗗瓧鑺傜爜澧炲己鏉ュ疄鐜般?BR>
]]>閫氳繃Java Reflection 鑾峰彇鎸囧畾static鍙橀噺鐨勫?/title> http://www.aygfsteel.com/carob/archive/2005/03/04/1675.htmlcarob carob Fri, 04 Mar 2005 01:28:00 GMT http://www.aygfsteel.com/carob/archive/2005/03/04/1675.html http://www.aygfsteel.com/carob/comments/1675.html http://www.aygfsteel.com/carob/archive/2005/03/04/1675.html#Feedback 0 http://www.aygfsteel.com/carob/comments/commentRss/1675.html http://www.aygfsteel.com/carob/services/trackbacks/1675.html elegant
/**/ /* * Created on 2005-3-3 * * TODO To change the template for this generated file go to * Window - Preferences - Java - Code Style - Code Templates */ package reflection;/**/ /* * * @author ruby * * TODO To change the template for this generated type comment go to * Window - Preferences - Java - Code Style - Code Templates */ public class SQLUtil { public static final String SELECT_SQL = " from Ruby " ; }
/**/ /* * Created on 2005-3-3 * * TODO To change the template for this generated file go to * Window - Preferences - Java - Code Style - Code Templates */ package reflection; import java.lang.reflect.Field;/**/ /* * * @author ruby * * TODO To change the template for this generated type comment go to Window - * Preferences - Java - Code Style - Code Templates */ public class Manager { public static String getValue(String sqlName) throws SecurityException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException { Field f = SQLUtil. class .getField(sqlName); return f. get ( null ).toString(); } public static void main(String[] args) throws SecurityException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException { System. out .println(getValue( " SELECT_SQL " )); } } ]]> 鎼埌鏂板鏉ワ細) http://www.aygfsteel.com/carob/archive/2005/02/28/1562.htmlcarob carob Mon, 28 Feb 2005 12:10:00 GMT http://www.aygfsteel.com/carob/archive/2005/02/28/1562.html http://www.aygfsteel.com/carob/comments/1562.html http://www.aygfsteel.com/carob/archive/2005/02/28/1562.html#Feedback 0 http://www.aygfsteel.com/carob/comments/commentRss/1562.html http://www.aygfsteel.com/carob/services/trackbacks/1562.html 銆?BR>鈥滃崥瀹㈠洯鈥濊繕搴斿仛寰楀啀涓撲笟涓鐐規墠琛岋紝娉ㄥ唽鐨勬椂鍊欙紝鎸夌潃鎻愮ず璧幫紝绔熺劧瀵艱埅鏄敊璇殑錛屾敞鍐屽埌鍏跺畠鍦版柟鍘諱簡銆?img src ="http://www.aygfsteel.com/carob/aggbug/1562.html" width = "1" height = "1" /> ]]> Groovlets http://www.aygfsteel.com/carob/archive/2005/02/28/1564.htmlcarob carob Mon, 28 Feb 2005 03:18:00 GMT http://www.aygfsteel.com/carob/archive/2005/02/28/1564.html http://www.aygfsteel.com/carob/comments/1564.html http://www.aygfsteel.com/carob/archive/2005/02/28/1564.html#Feedback 0 http://www.aygfsteel.com/carob/comments/commentRss/1564.html http://www.aygfsteel.com/carob/services/trackbacks/1564.html 浣犺兘鍦℅roovy閲岄潰鍐欐櫘閫氱殑Java Servlet銆?BR>瀛樺湪涓涓?STRONG>GroovyServlet錛岃嚜鍔ㄧ紪璇?groovy鏂囦歡錛岃漿鍙樻垚瀛楄妭鐮侊紝瑁呰澆綾伙紝騫剁紦瀛樺畠浠紝鐩村埌淇敼浜嗘簮鏂囦歡銆?BR>榪欏効鏈変竴涓畝鍗曠殑渚嬪瓙鏉ュ悜浣犺鏄庤繖浜嬶細 (娉ㄦ剰璁塊棶session,output,request鐨勯殣寮忓彉閲忕殑鐢ㄦ硶)
import java.util.Date if (session.counter == null ) { session.counter = 1 } println """ < html > < head > < title > Groovy Servlet </ title > </ head > < body > Hello, ${request.remoteHost} : $ {session.counter} ! $ { new Date()} </ body > </ html > """ session.counter = session.counter + 1 鎴栬咃紝鐢∕arkupBuilder瀹屾垚鐩稿悓鐨勫姛鑳?BR>
import java.util.Date import groovy.xml.MarkupBuilder if (session.counter == null ) { session.counter = 1 } html.html { // html is implicitly bound to new MarkupBuilder(out) head { title( " Groovy Servlet " ) } body { p( " Hello, ${request.remoteHost}: ${session.counter}! ${new Date()} " ) } } session.counter = session.counter + 1 闅愬紡鍙橀噺 * 榪欎簺鍙橀噺鍦╣roovylet閲岄潰涓嶈兘琚啀嬈¤祴鍊箋備粬浠湪絎竴嬈¤闂椂琚粦瀹氾紝鍏佽璇稿鍦ㄧ敤"out"涔嬪墠璋冪敤瀵硅薄"response"鐨勬柟娉曘?BR>寤虹珛Groovylet 灝嗕笅闈㈡斁鍏eb.xml涓?BR>
<servlet>
<servlet-name> Groovy</servlet-name>
<servlet-class> groovy.servlet.GroovyServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name> Groovy</servlet-name>
<url-pattern> *.groovy</url-pattern>
</servlet-mapping> 鐒跺悗錛屾墍鏈塯roovy jar鏂囦歡鏀懼埌WEB/lib鐩綍涓?鍙渶鏀懼叆groovy.jar鍜宎sm.jar鍗沖彲) 鎶?groovy鏂囦歡鏀懼叆鏍圭洰褰?鏀緃tml鏂囦歡鐨勫湴鏂?涓紝groovy servlet灝嗕細鐓х榪欎簺.groovy鏂囦歡 灝辮繖涓緥瀛愪嬌鐢╰omcat鏉ヨ錛岃緙栬緫tomcat/conf/server.xml 錛岀被浼間簬涓嬮潰榪欐牱
<Context path="/groovy" docBase="c:/groovy-servlet" /> ]]> GSQL http://www.aygfsteel.com/carob/archive/2005/02/28/1565.htmlcarob carob Mon, 28 Feb 2005 02:26:00 GMT http://www.aygfsteel.com/carob/archive/2005/02/28/1565.html http://www.aygfsteel.com/carob/comments/1565.html http://www.aygfsteel.com/carob/archive/2005/02/28/1565.html#Feedback 0 http://www.aygfsteel.com/carob/comments/commentRss/1565.html http://www.aygfsteel.com/carob/services/trackbacks/1565.html 涓句緥錛?BR>
/**/ /* * * Test to verify valid construction of default DDL * * @author <a href="mailto:jeremy.rayner@bigfoot.com">Jeremy Rayner</a> * @version $Revision: 1.2 $ */ package org.javanicus.gsql import java.io.* class SqlGeneratorTest extends GroovyTestCase { property database property sqlGenerator void setUp() { typeMap = new TypeMap() build = new RelationalBuilder(typeMap) sqlGenerator = new SqlGenerator(typeMap,System.getProperty( " line.separator " , " \n " )) database = build.database(name: ' genealogy ' ) { table(name: ' event ' ) { column(name: ' event_id ' , type: ' integer ' , size: 10 , primaryKey: true , required: true ) column(name: ' description ' , type: ' varchar ' , size: 30 ) } table(name:' individual ' ) { column(name: ' individual_id ' , type: ' integer ' , size: 10 , required: true , primaryKey: true , autoIncrement: true ) column(name: ' surname ' , type: ' varchar ' , size: 15 , required: true ) column(name: ' event_id ' , type: ' integer ' , size: 10 ) foreignKey(foreignTable: ' event ' ) { reference(local: ' event_id ' ,foreign: ' event_id ' ) } index(name:' surname_index ' ) { indexColumn(name: ' surname ' ) } } } } void testGenerateDDL() { testWriter = new PrintWriter( new FileOutputStream( " SqlGeneratorTest.sql " )) sqlGenerator.writer = testWriter sqlGenerator.createDatabase(database, true ) testWriter.flush() } } ]]>
主站蜘蛛池模板:
岢岚县 |
安吉县 |
临漳县 |
桂平市 |
高尔夫 |
江川县 |
大余县 |
蓬溪县 |
湖州市 |
新建县 |
呼图壁县 |
嘉祥县 |
楚雄市 |
米泉市 |
桐庐县 |
宁安市 |
团风县 |
获嘉县 |
三亚市 |
溧阳市 |
扶余县 |
广宗县 |
凤冈县 |
淮阳县 |
诸城市 |
顺义区 |
高雄县 |
建始县 |
乌兰察布市 |
平舆县 |
额敏县 |
随州市 |
紫阳县 |
南安市 |
金秀 |
甘南县 |
巴中市 |
上饶市 |
普定县 |
施秉县 |
武威市 |