??xml version="1.0" encoding="utf-8" standalone="yes"?>av福利导福航大全在线,精品视频高潮,精品中文字幕在线2019http://www.aygfsteel.com/lippea/If u can look into my eyes, u will see how beautiful the life is.zh-cnSat, 17 May 2025 17:28:57 GMTSat, 17 May 2025 17:28:57 GMT60取未知类型对象的属性?/title><link>http://www.aygfsteel.com/lippea/archive/2005/05/25/5188.html</link><dc:creator>lippea'blog</dc:creator><author>lippea'blog</author><pubDate>Wed, 25 May 2005 07:42:00 GMT</pubDate><guid>http://www.aygfsteel.com/lippea/archive/2005/05/25/5188.html</guid><wfw:comment>http://www.aygfsteel.com/lippea/comments/5188.html</wfw:comment><comments>http://www.aygfsteel.com/lippea/archive/2005/05/25/5188.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.aygfsteel.com/lippea/comments/commentRss/5188.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/lippea/services/trackbacks/5188.html</trackback:ping><description><![CDATA[<FONT color=#000000><STRONG> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 27pt; TEXT-ALIGN: left; mso-char-indent-count: 2.57; mso-char-indent-size: 10.5pt; mso-pagination: widow-orphan" align=left><FONT face=Arial><FONT face="Times New Roman" size=1><STRONG><SPAN style="FONT-WEIGHT: normal; COLOR: black; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-size: 7.5pt"><SPAN style="FONT-SIZE: 12pt; COLOR: black; FONT-FAMILY: 宋体; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA; mso-bidi-font-family: 'Times New Roman'">讨论~写复杂<SPAN lang=EN-US>struts</SPAN>标签Ӟ需要在已知对象和其属性名U的情况下取得该对象中对应的属性倹{但是对于传q来的数据ƈ不知道其数据cdQ即时?SPAN lang=EN-US>Object.getClass()</SPAN>得到其数据类型,也不可能提前引入相关的类。将<SPAN lang=EN-US>struts</SPAN>?SPAN lang=EN-US>logic.iterate</SPAN>?SPAN lang=EN-US>bean:write</SPAN>反编译后详细研究Q得C列代码:</SPAN></SPAN></STRONG></FONT></FONT></P> <DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 3pt; BORDER-LEFT: windowtext 0.5pt solid; PADDING-TOP: 3pt; BORDER-BOTTOM: windowtext 0.5pt solid"> <P class=MsoNormal style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0cm; BORDER-TOP: medium none; PADDING-LEFT: 0cm; PADDING-BOTTOM: 0cm; MARGIN: 0cm 0cm 0pt; BORDER-LEFT: medium none; WORD-BREAK: break-all; PADDING-TOP: 0cm; BORDER-BOTTOM: medium none; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 3.0pt 5.0pt 3.0pt 5.0pt"><SPAN lang=EN-US style="COLOR: black; mso-bidi-font-size: 7.5pt"><?xml:namespace prefix = v ns = "urn:schemas-microsoft-com:vml" /><v:shapetype id=_x0000_t75 coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"><v:stroke joinstyle="miter"></v:stroke><v:formulas><v:f eqn="if lineDrawn pixelLineWidth 0"></v:f><v:f eqn="sum @0 1 0"></v:f><v:f eqn="sum 0 0 @1"></v:f><v:f eqn="prod @2 1 2"></v:f><v:f eqn="prod @3 21600 pixelWidth"></v:f><v:f eqn="prod @3 21600 pixelHeight"></v:f><v:f eqn="sum @0 0 1"></v:f><v:f eqn="prod @6 1 2"></v:f><v:f eqn="prod @7 21600 pixelWidth"></v:f><v:f eqn="sum @8 21600 0"></v:f><v:f eqn="prod @7 21600 pixelHeight"></v:f><v:f eqn="sum @10 21600 0"></v:f></v:formulas><v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"></v:path><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:lock v:ext="edit" aspectratio="t"></o:lock></v:shapetype><v:shape id=_x0000_i1025 style="WIDTH: 8.25pt; HEIGHT: 12pt" type="#_x0000_t75" alt=""><v:imagedata o:HREF="/Images/OutliningIndicators/None.gif" src="file:///C:/DOCUME~1/黄凤?LOCALS~1/Temp/msoclip1/01/clip_image001.gif"><FONT face=Arial size=1></FONT></v:imagedata></v:shape><STRONG><SPAN style="FONT-WEIGHT: normal"><FONT face=Arial size=1>Object propertyValue = PropertyUtils.getProperty(</FONT></SPAN></STRONG></SPAN><FONT face=Arial><FONT size=1><STRONG><SPAN lang=EN-US style="FONT-WEIGHT: normal; mso-bidi-font-size: 7.5pt">object<SPAN style="COLOR: black">, propertyName)</SPAN></SPAN></STRONG><SPAN lang=EN-US><o:p></o:p></SPAN></FONT></FONT></P></DIV> <P><FONT face=Arial><FONT size=1><STRONG><SPAN lang=EN-US style="FONT-WEIGHT: normal; FONT-SIZE: 10.5pt; COLOR: black; FONT-FAMILY: 'Times New Roman'; mso-bidi-font-size: 7.5pt; mso-font-kerning: 1.0pt; mso-fareast-font-family: 宋体; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">object</SPAN></STRONG><STRONG><SPAN style="FONT-WEIGHT: normal; FONT-SIZE: 10.5pt; COLOR: black; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-size: 7.5pt; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA; mso-bidi-font-family: 'Times New Roman'">为对象,</SPAN></STRONG><STRONG><SPAN lang=EN-US style="FONT-WEIGHT: normal; FONT-SIZE: 10.5pt; COLOR: black; FONT-FAMILY: 'Times New Roman'; mso-bidi-font-size: 7.5pt; mso-font-kerning: 1.0pt; mso-fareast-font-family: 宋体; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA">propertyName</SPAN></STRONG><STRONG><SPAN style="FONT-WEIGHT: normal; FONT-SIZE: 10.5pt; COLOR: black; FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-size: 7.5pt; mso-font-kerning: 1.0pt; mso-ansi-language: EN-US; mso-fareast-language: ZH-CN; mso-bidi-language: AR-SA; mso-bidi-font-family: 'Times New Roman'">为需要得到的属性名Uͼq回的是该对象中对应属性的倹{试验可以用?/SPAN></STRONG></FONT></FONT></STRONG></FONT></P><img src ="http://www.aygfsteel.com/lippea/aggbug/5188.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/lippea/" target="_blank">lippea'blog</a> 2005-05-25 15:42 <a href="http://www.aygfsteel.com/lippea/archive/2005/05/25/5188.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>使用正则表达?/title><link>http://www.aygfsteel.com/lippea/archive/2005/05/25/5184.html</link><dc:creator>lippea'blog</dc:creator><author>lippea'blog</author><pubDate>Wed, 25 May 2005 07:31:00 GMT</pubDate><guid>http://www.aygfsteel.com/lippea/archive/2005/05/25/5184.html</guid><wfw:comment>http://www.aygfsteel.com/lippea/comments/5184.html</wfw:comment><comments>http://www.aygfsteel.com/lippea/archive/2005/05/25/5184.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/lippea/comments/commentRss/5184.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/lippea/services/trackbacks/5184.html</trackback:ping><description><![CDATA[<P><FONT size=1>         一直觉得这东西很神U,昨天要求校验数据cdQ想自己写方法的时候突然想到这个它Q上|查了一下。它最单的形式是:</FONT></P> <DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid"> <P><FONT size=1><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">Pattern.matches(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">[0-9]*</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">, szInput);</SPAN></FONT></P></DIV> <P><FONT size=1>szInput是需要校验的字符丌Ӏ拆开写就是:</FONT></P> <DIV style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; BACKGROUND: #e6e6e6; PADDING-BOTTOM: 4px; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 98%; WORD-BREAK: break-all; PADDING-TOP: 4px; BORDER-BOTTOM: windowtext 0.5pt solid"> <P><FONT size=1><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align=top><SPAN style="COLOR: #000000">Pattern p </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> Pattern.compile(</SPAN><SPAN style="COLOR: #000000">"</SPAN><SPAN style="COLOR: #000000">[0-9]*</SPAN><SPAN style="COLOR: #000000">"</SPAN></FONT><FONT size=1><SPAN style="COLOR: #000000">);<BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align=top>Matcher m </SPAN><SPAN style="COLOR: #000000">=</SPAN></FONT><FONT size=1><SPAN style="COLOR: #000000"> p.matcher(szInput);<BR><IMG src="http://www.aygfsteel.com/images/OutliningIndicators/None.gif" align=top>boolean b </SPAN><SPAN style="COLOR: #000000">=</SPAN><SPAN style="COLOR: #000000"> m.matches(); </SPAN></FONT></P></DIV> <P><FONT size=1>详细的规则可以参见java帮助文档中的java.util.regex部分?/FONT></P><img src ="http://www.aygfsteel.com/lippea/aggbug/5184.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/lippea/" target="_blank">lippea'blog</a> 2005-05-25 15:31 <a href="http://www.aygfsteel.com/lippea/archive/2005/05/25/5184.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>使用Eclipse创徏模板q格式化代码(l?http://www.aygfsteel.com/lippea/archive/2005/05/09/4108.htmllippea'bloglippea'blogMon, 09 May 2005 02:46:00 GMThttp://www.aygfsteel.com/lippea/archive/2005/05/09/4108.htmlhttp://www.aygfsteel.com/lippea/comments/4108.htmlhttp://www.aygfsteel.com/lippea/archive/2005/05/09/4108.html#Feedback0http://www.aygfsteel.com/lippea/comments/commentRss/4108.htmlhttp://www.aygfsteel.com/lippea/services/trackbacks/4108.html

昨天把之前的x?/SPAN>yj交流后,发现其中~失代码格式化中很重要的一块,是每个Ҏ的注释。方法注释用于说明该Ҏ的各信息,比如创徏人、创建日期、主要功能及输入输出的说明。另外还了解到规范化Ҏ注释可以用于自动生成JavaDocQ看h?/SPAN>Java帮助文档很类似的目说明文档?/SPAN>

今天扑ֈeclipse中设|方法注释模板ƈ使用Ҏ注释的方法?/SPAN>

讄Ҏ注释模板Q选择eclipse菜单栏中【窗口】下的【首选项】,展开左边树到Java->代码样式->代码模板Q展开双出现的对话框中的注释->ҎQ点d边的【编辑】按钮。编辑其中的内容。也可以点击下面的【插入变量】按钮添加变量。例如:

/**

 * @author ${user}

 * 功能Q?/SPAN>

 * ${tags}
 */

其中@author?/SPAN>JavaDoc的标C,?/SPAN>$W号的是变量?/SPAN>

 

使用旉标放|在需要添加注释的Ҏ内部的Q意位|。点击菜单栏?SPAN style="COLOR: black">【源代码】下的【添?/SPAN>Javadoc注释】,或者用快捷键Alt+Shift+JQ则eclipse自动在该Ҏ前面d注释Q例?/SPAN>public static void main(String[] args)生成如下注释Q?/SPAN>

    /**

     * @author hfm

     * 功能Q?/SPAN>

     * @param args

     */

当然d完之后还需要手动添加其中的各项内容Q如Ҏ的功能和参数的含义等?/SPAN>



lippea'blog 2005-05-09 10:46 发表评论
]]>
使用Eclipse创徏模板q格式化代码http://www.aygfsteel.com/lippea/archive/2005/04/30/3976.htmllippea'bloglippea'blogSat, 30 Apr 2005 10:10:00 GMThttp://www.aygfsteel.com/lippea/archive/2005/04/30/3976.htmlhttp://www.aygfsteel.com/lippea/comments/3976.htmlhttp://www.aygfsteel.com/lippea/archive/2005/04/30/3976.html#Feedback1http://www.aygfsteel.com/lippea/comments/commentRss/3976.htmlhttp://www.aygfsteel.com/lippea/services/trackbacks/3976.html上次听了其他目l介l在~写完代码后使用代码格式化程序对代码q行格式化,有利于版本冲H时q行Ҏ和文件合q。想到当前代码编写格式多有些太个性化Q如果可以创Z份代码模板,之导入到所有h的工具中Q然后所有的代码在编写后都进行格式化Q则避免了代码格式太混ؕ的情况,有利于大安M码?/SPAN>

Eclipse有内|的代码格式化程序和模板Q也可以创徏自己的模板:

在菜单栏中选中『窗口?SPAN lang=EN-US>-〉『首选项』。在出现的对话框的左Ҏ中展开『Java』下的『代码样式』。其中有两项Q一Ҏ『代码格式化E序』,另一Ҏ『代码模ѝ。主要的是设|『代码格式化E序』,『代码模ѝ中讄的是自动生成的代码的格式Q比如setter和getterҎ的代码及相关注释??xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

讄『代码格式化E序』:Eclipse内置的模板不能导出,需要新Z个。输入模板名Uͼq择初始化设|的文g。这部分主要是设|格式化后代码的格式Q包括羃q、空行、花括弧{等内容。具体的东西按照自q爱好Q自己慢慢确定吧。然后点d出,存成.xml文g?o:p>

讄『代码模ѝ没有什么,主要是设|自动生成的一些方法等的注释格式,如getter/setterҎ的注释。里面可以包括一些变量,可以生成时自动填充相应内容,如姓名,参数名称{。设|完毕后Q点d部导出,存成.xml文g?o:p>

 

用的时候当然是分别点击导入按钮Q选择正确的配|文件。选中菜单栏中『源代码』下的格式化Q或者用快h?SPAN lang=EN-US>ctrl+shift+f对代码进行格式化。OK!



lippea'blog 2005-04-30 18:10 发表评论
]]>
վ֩ģ壺 ߷| | | | տ| | ˳| | | | | | ع| »| | ɳ| ˫| ɽ| ʡ| | Ҵ| | ҵ| | | | | | | ԫ| Դ| | | | گ| ɽ| | | ˮ| ʯ| |