minor updates

git-svn-id: https://pmd.svn.sourceforge.net/svnroot/pmd/trunk@4669 51baf565-9d33-0410-a72c-fc3788e3496d
This commit is contained in:
Brian Remedios
2006-10-15 06:22:05 +00:00
parent 810ae42392
commit 662189f644

View File

@ -1,28 +1,28 @@
{\rtf1\ansi\ansicpg1252\uc1\deff0\stshfdbch0\stshfloch0\stshfhich0\stshfbi0\deflang1033\deflangfe1033{\fonttbl{\f0\froman\fcharset0\fprq2{\*\panose 02020603050405020304}Times New Roman;}{\f1\fswiss\fcharset0\fprq2{\*\panose 020b0604020202020204}Arial;}
{\f2\fmodern\fcharset0\fprq1{\*\panose 02070309020205020404}Courier New;}{\f233\froman\fcharset238\fprq2 Times New Roman CE;}{\f234\froman\fcharset204\fprq2 Times New Roman Cyr;}{\f236\froman\fcharset161\fprq2 Times New Roman Greek;}
{\f237\froman\fcharset162\fprq2 Times New Roman Tur;}{\f238\froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f239\froman\fcharset178\fprq2 Times New Roman (Arabic);}{\f240\froman\fcharset186\fprq2 Times New Roman Baltic;}
{\f241\froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f243\fswiss\fcharset238\fprq2 Arial CE;}{\f244\fswiss\fcharset204\fprq2 Arial Cyr;}{\f246\fswiss\fcharset161\fprq2 Arial Greek;}{\f247\fswiss\fcharset162\fprq2 Arial Tur;}
{\f248\fswiss\fcharset177\fprq2 Arial (Hebrew);}{\f249\fswiss\fcharset178\fprq2 Arial (Arabic);}{\f250\fswiss\fcharset186\fprq2 Arial Baltic;}{\f251\fswiss\fcharset163\fprq2 Arial (Vietnamese);}{\f253\fmodern\fcharset238\fprq1 Courier New CE;}
{\f254\fmodern\fcharset204\fprq1 Courier New Cyr;}{\f256\fmodern\fcharset161\fprq1 Courier New Greek;}{\f257\fmodern\fcharset162\fprq1 Courier New Tur;}{\f258\fmodern\fcharset177\fprq1 Courier New (Hebrew);}
{\f259\fmodern\fcharset178\fprq1 Courier New (Arabic);}{\f260\fmodern\fcharset186\fprq1 Courier New Baltic;}{\f261\fmodern\fcharset163\fprq1 Courier New (Vietnamese);}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;
{\f2\fmodern\fcharset0\fprq1{\*\panose 02070309020205020404}Courier New;}{\f37\froman\fcharset238\fprq2 Times New Roman CE;}{\f38\froman\fcharset204\fprq2 Times New Roman Cyr;}{\f40\froman\fcharset161\fprq2 Times New Roman Greek;}
{\f41\froman\fcharset162\fprq2 Times New Roman Tur;}{\f42\froman\fcharset177\fprq2 Times New Roman (Hebrew);}{\f43\froman\fcharset178\fprq2 Times New Roman (Arabic);}{\f44\froman\fcharset186\fprq2 Times New Roman Baltic;}
{\f45\froman\fcharset163\fprq2 Times New Roman (Vietnamese);}{\f47\fswiss\fcharset238\fprq2 Arial CE;}{\f48\fswiss\fcharset204\fprq2 Arial Cyr;}{\f50\fswiss\fcharset161\fprq2 Arial Greek;}{\f51\fswiss\fcharset162\fprq2 Arial Tur;}
{\f52\fswiss\fcharset177\fprq2 Arial (Hebrew);}{\f53\fswiss\fcharset178\fprq2 Arial (Arabic);}{\f54\fswiss\fcharset186\fprq2 Arial Baltic;}{\f55\fswiss\fcharset163\fprq2 Arial (Vietnamese);}{\f57\fmodern\fcharset238\fprq1 Courier New CE;}
{\f58\fmodern\fcharset204\fprq1 Courier New Cyr;}{\f60\fmodern\fcharset161\fprq1 Courier New Greek;}{\f61\fmodern\fcharset162\fprq1 Courier New Tur;}{\f62\fmodern\fcharset177\fprq1 Courier New (Hebrew);}
{\f63\fmodern\fcharset178\fprq1 Courier New (Arabic);}{\f64\fmodern\fcharset186\fprq1 Courier New Baltic;}{\f65\fmodern\fcharset163\fprq1 Courier New (Vietnamese);}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;
\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;
\red128\green128\blue128;\red192\green192\blue192;}{\stylesheet{\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \snext0 \styrsid10772021 Normal;}{
\s1\ql \li0\ri0\sb240\sa60\keepn\widctlpar\aspalpha\aspnum\faauto\outlinelevel0\adjustright\rin0\lin0\itap0 \b\f1\fs32\lang1033\langfe1033\kerning32\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \styrsid10772021 heading 1;}{
\s2\ql \li0\ri0\sb240\sa60\keepn\widctlpar\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0 \b\i\f1\fs28\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \styrsid10772021 heading 2;}{
\s3\ql \li0\ri0\sb240\sa60\keepn\widctlpar\aspalpha\aspnum\faauto\outlinelevel2\adjustright\rin0\lin0\itap0 \b\f1\fs26\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 \sbasedon0 \snext0 \styrsid10772021 heading 3;}{\*\cs10 \additive \ssemihidden
Default Paragraph Font;}{\*\ts11\tsrowd\trftsWidthB3\trpaddl108\trpaddr108\trpaddfl3\trpaddft3\trpaddfb3\trpaddfr3\trcbpat1\trcfpat1\tscellwidthfts0\tsvertalt\tsbrdrt\tsbrdrl\tsbrdrb\tsbrdrr\tsbrdrdgl\tsbrdrdgr\tsbrdrh\tsbrdrv
\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs20\lang1024\langfe1024\cgrid\langnp1024\langfenp1024 \snext11 \ssemihidden Normal Table;}}{\*\latentstyles\lsdstimax156\lsdlockeddef0}{\*\rsidtbl \rsid1983827\rsid3096849
\rsid4678217\rsid7145406\rsid9769499\rsid10772021\rsid12590302\rsid14575721}{\*\generator Microsoft Word 11.0.6359;}{\info{\title PMD Properties}{\author Brian Remedios}{\keywords PMD}{\operator Herzum Software}{\creatim\yr2006\mo10\dy15\min54}
{\revtim\yr2006\mo10\dy15\min54}{\version2}{\edmins1}{\nofpages5}{\nofwords1366}{\nofchars7787}{\*\company }{\nofcharsws9135}{\vern24703}}
\widowctrl\ftnbj\aenddoc\makebackup\noxlattoyen\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\formshade\horzdoc\dgmargin\dghspace180\dgvspace180\dghorigin1701\dgvorigin1984\dghshow1\dgvshow1
\ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0 \fs20\lang1024\langfe1024\cgrid\langnp1024\langfenp1024 \snext11 \ssemihidden Normal Table;}}{\*\latentstyles\lsdstimax156\lsdlockeddef0}{\*\rsidtbl \rsid1983827\rsid2975317
\rsid3096849\rsid3702757\rsid3748839\rsid4678217\rsid5918372\rsid6625725\rsid7145406\rsid7691424\rsid9330656\rsid9769499\rsid10772021\rsid12590302\rsid13063373\rsid13122723\rsid13532092\rsid14379459\rsid14575721\rsid16523264}{\*\generator Microsoft Word 1
1.0.6359;}{\info{\title PMD Properties}{\author Brian Remedios}{\keywords PMD}{\operator Herzum Software}{\creatim\yr2006\mo10\dy15\min54}{\revtim\yr2006\mo10\dy15\hr1\min21}{\version3}{\edmins5}{\nofpages5}{\nofwords1358}{\nofchars7743}{\*\company }
{\nofcharsws9083}{\vern24703}}\widowctrl\ftnbj\aenddoc\makebackup\noxlattoyen\expshrtn\noultrlspc\dntblnsbdb\nospaceforul\hyphcaps0\formshade\horzdoc\dgmargin\dghspace180\dgvspace180\dghorigin1701\dgvorigin1984\dghshow1\dgvshow1
\jexpand\viewkind4\viewscale100\pgbrdrhead\pgbrdrfoot\splytwnine\ftnlytwnine\htmautsp\nolnhtadjtbl\useltbaln\alntblind\lytcalctblwd\lyttblrtgr\lnbrkrule\nobrkwrptbl\viewnobound1\snaptogridincell\allowfieldendsel
\wrppunct\asianbrkrule\rsidroot10772021\newtblstyruls\nogrowautofit \fet0\sectd \linex0\endnhere\sectlinegrid360\sectdefaultcl\sftnbj {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang
{\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang {\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang {\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang
{\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang {\pntxtb (}{\pntxta )}}\pard\plain
\s1\ql \li0\ri0\sb240\sa60\keepn\widctlpar\aspalpha\aspnum\faauto\outlinelevel0\adjustright\rin0\lin0\itap0\pararsid10772021 \b\f1\fs32\lang1033\langfe1033\kerning32\cgrid\langnp1033\langfenp1033 {\insrsid10772021 PMD Properties
\par }\pard\plain \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid10772021 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\insrsid10772021
\par The new PMD properties subsystem is intended to bring some rigor and expanded functionality to the wild world of rule properies. It defines a value type template that can be used by IDE plugins to enumerate the properties specified by indiv
idual rules and provides validation and serialization services for multi-value properties. It uses custom serialization routines to generate human-readable values that can be edited in the XML files
\par The new PMD properties subsystem is intended to bring some rigor and expanded functionality to the wild world of rule properies. It defines a value type template that can be used by IDE plugins to enumerate the properties specified by individual rules and
provides validation and serialization services for multi-value properties. It uses custom serialization routines to generate human-readable values that can be edited in the XML files
\par
\par The subsystem implements the following property constructors with the leading name and description arguments not shown:
\par }\pard\plain \s3\ql \li0\ri0\sb240\sa60\keepn\widctlpar\aspalpha\aspnum\faauto\outlinelevel2\adjustright\rin0\lin0\itap0\pararsid10772021 \b\f1\fs26\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\insrsid10772021 Boolean
@ -81,9 +81,8 @@ alues, float uiOrder}{\f2\fs18\insrsid10772021 , int maxValues}{\f2\fs18\insrsid
\par The 2D value array holds the label-value tuples in the order that they should be presented in the UI widget. See usage below.}{\insrsid10772021\charrsid2975317
\par }\pard\plain \s2\ql \li0\ri0\sb240\sa60\keepn\widctlpar\aspalpha\aspnum\faauto\outlinelevel1\adjustright\rin0\lin0\itap0\pararsid10772021 \b\i\f1\fs28\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\insrsid10772021 For Rule developers
\par }\pard\plain \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid10772021 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\insrsid10772021
\par All rule p
roperties need to be characterized via individual PMDProperty instances so that they can be viewed and adjusted the IDE plugin users. Since we are essentially creating descriptors for the properties rather than the properties themselves we have the option
of creating them as static singletons within the rule class definition. The following rule usage example makes use of a pair of integer properties:
\par All rule properties need to be characterized via individual }{\insrsid13532092 PropertyDescriptors}{\insrsid10772021 so that they can be viewed and adjusted the IDE plugin users. Since }{\insrsid13532092 the descriptors never change at runtime
we only need one of each so}{\insrsid10772021 we creat}{\insrsid13532092 e}{\insrsid10772021 them as static singletons within the rule class definition. The following rule usage example makes use of a pair of integer properties:
\par
\par }{\f2\fs20\insrsid10772021\charrsid3702757 public My}{\f2\fs20\insrsid10772021 VarNameLength}{\f2\fs20\insrsid10772021\charrsid3702757 Rule extends AbstractRule() \{
\par
@ -141,8 +140,8 @@ booleanPrefixes}{\f2\fs20\insrsid10772021\charrsid3702757 = }{\f2\fs20\insrsid1
\par \lquote |\rquote \tab // reserved as delimiter
\par }{\f2\fs20\insrsid10772021\charrsid3702757 );}{\f2\fs20\insrsid10772021
\par
\par }\pard \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid10772021 {\insrsid10772021\charrsid7691424 There are at least two constructors for each property type, one that limits the
property to a single value and another that accepts more than one.}{\insrsid10772021
\par }\pard \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid10772021 {\insrsid10772021\charrsid7691424 There are at least two constructors for each property type, one that
limits the property to a single value and another that accepts more than one.}{\insrsid10772021
\par
\par In addition to the regular Java types such as Boolean, Integer, Float, Character, String, and Class/Type values you can also allow your rule users to pick between complex mixed datatypes such as maps or graphs that you define at compilation time:
\par
@ -166,8 +165,8 @@ Descriptor}{\f2\fs20\insrsid9769499\charrsid3702757 }{\f2\fs20\insrsid10772021
t exist will result in an IllegalArgumentException.
\par
\par }\pard\plain \s3\ql \li0\ri0\sb240\sa60\keepn\widctlpar\aspalpha\aspnum\faauto\outlinelevel2\adjustright\rin0\lin0\itap0\pararsid10772021 \b\f1\fs26\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\insrsid10772021 XML values
\par }\pard\plain \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid10772021 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\insrsid10772021 Defining the property rules within the ruleset XML files is straightf
orward for single values:
\par }\pard\plain \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid10772021 \fs24\lang1033\langfe1033\cgrid\langnp1033\langfenp1033 {\insrsid10772021
Defining the property rules within the ruleset XML files is straightforward for single values:
\par
\par }\pard \ql \li720\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0\pararsid10772021 {\f2\fs18\insrsid10772021\charrsid13063373 <properties>
\par }\pard \ql \fi720\li720\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0\pararsid10772021 {\f2\fs18\insrsid10772021\charrsid13063373 <property name="maxMethodArgs" value="2"/>
@ -180,8 +179,9 @@ orward for single values:
value="java.util.ArrayList|java.util.Vector|java.util.HashMap"/>
\par }\pard \ql \li720\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin720\itap0\pararsid10772021 {\f2\fs18\insrsid10772021\charrsid13063373 </properties>}{\fs18\insrsid10772021\charrsid13063373
\par }\pard \ql \li0\ri0\widctlpar\aspalpha\aspnum\faauto\adjustright\rin0\lin0\itap0\pararsid10772021 {\insrsid10772021
\par You can define your own datatypes by implementing a subclass of AbstractPMDProperty and implementing the serialization, and
validation routines listed in the PMDProperty interface. Just ensure that you create a corresponding JUnit test in the test.net.sourceforge.pmd.properties package to go along with it.
\par You can
define your own datatypes by implementing a subclass of AbstractPMDProperty and implementing the serialization, and validation routines listed in the PMDProperty interface. Just ensure that you create a corresponding JUnit test in the test.net.sourceforge
.pmd.properties package to go along with it.
\par
\par One of the implementation goals in this system is to try and come up with property constructors sufficiently useful that we don\rquote t need to assemble them within static blocks. A single statement should be enough to build a rule property descriptor.
@ -203,8 +203,8 @@ value="java.util.ArrayList|java.util.Vector|java.util.HashMap"/>
\par 4) All multi-value properties make use of a character to delimit the values in their serialized form so you will need to ensure that you prevent the user from entering values containing it. Retrive the delimiter via the }{
\f2\fs22\insrsid10772021\charrsid16523264 multiValueDelimiter()}{\insrsid10772021 method.
\par
\par You can use the errorFor(value) method to validate the values entered by the user or check the values held by the rule configuration file. It returns null or an error
message as appropriate. It would be best to flag and disable rules that have invalid property values.
\par You can use the errorFor(value) method to validate
the values entered by the user or check the values held by the rule configuration file. It returns null or an error message as appropriate. It would be best to flag and disable rules that have invalid property values.
\par
\par Use the }{\f2\fs22\insrsid10772021\charrsid16523264 defaultValue()}{\insrsid10772021 method to reset the rule properties to their default value.
\par