- PropertyUtils 就是此列
- /*
- *LicensedtotheApacheSoftwareFoundation(ASF)underoneormore
- *contributorlicenseagreements.SeetheNOTICEfiledistributedwith
- *thisworkforadditionalinformationregardingcopyrightownership.
- *TheASFlicensesthisfiletoYouundertheApacheLicense,Version2.0
- *(the"License");youmaynotusethisfileexceptincompliancewith
- *theLicense.YoumayobtainacopyoftheLicenseat
- *
- *http://www.apache.org/licenses/LICENSE-2.0
- *
- *Unlessrequiredbyapplicablelaworagreedtoinwriting,software
- *distributedundertheLicenseisdistributedonan"ASIS"BASIS,
- *WITHOUTWARRANTIESORCONDITIONSOFANYKIND,eitherexpressorimplied.
- *SeetheLicenseforthespecificlanguagegoverningpermissionsand
- *limitationsundertheLicense.
- */
- packageorg.apache.commons.beanutils;
- importjava.beans.PropertyDescriptor;
- importjava.lang.reflect.InvocationTargetException;
- importjava.lang.reflect.Method;
- importjava.util.Map;
- importorg.apache.commons.collections.FastHashMap;
- /**
- *<p>UtilitymethodsforusingJavaReflectionAPIstofacilitategeneric
- *propertygetterandsetteroperationsonJavaobjects.</p>
- *
- *<p>Theimplementationsforthesemethodsareprovidedby<code>PropertyUtilsBean</code>.
- *Formoredetailssee{@linkPropertyUtilsBean}.</p>
- *
- *@authorCraigR.McClanahan
- *@authorRalphSchaer
- *@authorChrisAudley
- *@authorReyFrancois
- *@authorGregorRayman
- *@authorJanSorensen
- *@authorScottSanders
- *@version$Revision:644137$$Date:2008-04-0303:30:23+0100(Thu,03Apr2008)$
- *@seePropertyUtilsBean
- *@seeorg.apache.commons.beanutils.expression.Resolver
- */
- publicclass
- {
- //-----------------------------------------------------ManifestConstants
- /**
- *Thedelimiterthatpreceedsthezero-relativesubscriptforan
- *indexedreference.
- *
- *@deprecatedThenotationusedforpropertynameexpressionsisnow
- *dependantonthe{@linkorg.apache.commons.beanutils.expression.Resolver}
- *implementationbeingused.
- */
- publicstaticfinalcharINDEXED_DELIM='[';
- /**
- *Thedelimiterthatfollowsthezero-relativesubscriptforan
- *indexedreference.
- *
- *@deprecatedThenotationusedforpropertynameexpressionsisnow
- *dependantonthe{@linkorg.apache.commons.beanutils.expression.Resolver}
- *implementationbeingused.
- */
- publicstaticfinalcharINDEXED_DELIM2=']';
- /**
- *Thedelimiterthatpreceedsthekeyofamappedproperty.
- *
- *@deprecatedThenotationusedforpropertynameexpressionsisnow
- *dependantonthe{@linkorg.apache.commons.beanutils.expression.Resolver}
- *implementationbeingused.
- */
- publicstaticfinalcharMAPPED_DELIM='(';
- /**
- *Thedelimiterthatfollowsthekeyofamappedproperty.
- *
- *@deprecatedThenotationusedforpropertynameexpressionsisnow
- *dependantonthe{@linkorg.apache.commons.beanutils.expression.Resolver}
- *implementationbeingused.
- */
- publicstaticfinalcharMAPPED_DELIM2=')';
- /**
- *Thedelimiterthatseparatesthecomponentsofanestedreference.
- *
- *@deprecatedThenotationusedforpropertynameexpressionsisnow
- *dependantonthe{@linkorg.apache.commons.beanutils.expression.Resolver}
- *implementationbeingused.
- */
- publicstaticfinalcharNESTED_DELIM='.';
- //-------------------------------------------------------StaticVariables
- /**
- *Thedebuggingdetaillevelforthiscomponent.
- *
- *Notethatthisstaticvariablewillhaveunexpectedside-effectsif
- *thisclassisdeployedinasharedclassloaderwithinacontainer.
- *Howeverasitisactuallycompletelyignoredbythisclassduetoits
- *deprecatedstatus,itdoesn'tdoanyactualharm.
- *
- *@deprecatedThe<code>debug</code>staticpropertyisnolongerused
- */
- privatestaticintdebug=0;
- /**
- *The<code>debug</code>staticpropertyisnolongerused
- *@returndebugproperty
- *@deprecatedThe<code>debug</code>staticpropertyisnolongerused
- */
- publicstaticintgetDebug(){
- return(debug);
- }
- /**
- *The<code>debug</code>staticpropertyisnolongerused
- *@paramnewDebugdebugproperty
- *@deprecatedThe<code>debug</code>staticpropertyisnolongerused
- */
- publicstaticvoidsetDebug(intnewDebug){
- debug=newDebug;
- }
- //---------------------------------------------------------PublicMethods
- /**
- *Clearanycachedpropertydescriptorsinformationforallclasses
- *loadedbyanyclassloaders.Thisisusefulincaseswhereclass
- *loadersarethrownawaytoimplementclassreloading.
- *
- *<p>Formoredetailssee<code>PropertyUtilsBean</code>.</p>
- *
- *@seePropertyUtilsBean#clearDescriptors
- */
- publicstaticvoidclearDescriptors(){
- PropertyUtilsBean.getInstance().clearDescriptors();
- }
- /**
- *<p>Copypropertyvaluesfromthe"origin"beantothe"destination"bean
- *forallcaseswherethepropertynamesarethesame(eventhoughthe
- *actualgetterandsettermethodsmighthavebeencustomizedvia
- *<code>BeanInfo</code>classes).</p>
- *
- *<p>Formoredetailssee<code>PropertyUtilsBean</code>.</p>
- *
- *@paramdestDestinationbeanwhosepropertiesaremodified
- *@paramorigOriginbeanwhosepropertiesareretrieved
- *
- *@exceptionIllegalAccessExceptionifthecallerdoesnothave
- *accesstothepropertyaccessormethod
- *@exceptionIllegalArgumentExceptionifthe<code>dest</code>or
- *<code>orig</code>argumentisnull
- *@exceptionInvocationTargetExceptionifthepropertyaccessormethod
- *throwsanexception
- *@exceptionNoSuchMethodExceptionifanaccessormethodforthis
- *propetycannotbefound
- *@seePropertyUtilsBean#copyProperties
- */
- publicstaticvoidcopyProperties(Objectdest,Objectorig)
- throwsIllegalAccessException,InvocationTargetException,
- NoSuchMethodException{
- PropertyUtilsBean.getInstance().copyProperties(dest,orig);
- }
- /**
- *<p>Returntheentiresetofpropertiesforwhichthespecifiedbean
- *providesareadmethod.</p>
- *
- *<p>Formoredetailssee<code>PropertyUtilsBean</code>.</p>
- *
- *@parambeanBeanwhosepropertiesaretobeextracted
- *@returnThesetofpropertiesforthebean
- *
- *@exceptionIllegalAccessExceptionifthecallerdoesnothave
- *accesstothepropertyaccessormethod
- *@exceptionIllegalArgumentExceptionif<code>bean</code>isnull
- *@exceptionInvocationTargetExceptionifthepropertyaccessormethod
- *throwsanexception
- *@exceptionNoSuchMethodExceptionifanaccessormethodforthis
- *propetycannotbefound
- *@seePropertyUtilsBean#describe
- */
- publicstaticMapdescribe(Objectbean)
- throwsIllegalAccessException,InvocationTargetException,
- NoSuchMethodException{
- return(PropertyUtilsBean.getInstance().describe(bean));
- }
- /**
- *<p>Returnthevalueofthespecifiedindexedpropertyofthespecified
- *bean,withnotypeconversions.</p>
- *
- *<p>Formoredetailssee<code>PropertyUtilsBean</code>.</p>
- *
- *@parambeanBeanwhosepropertyistobeextracted
- *@paramname<code>propertyname[index]</code>ofthepropertyvalue
- *tobeextracted
- *@returntheindexedpropertyvalue
- *
- *@exceptionIndexOutOfBoundsExceptionifthespecifiedindex
- *isoutsidethevalidrangefortheunderlyingproperty
- *@exceptionIllegalAccessExceptionifthecallerdoesnothave
- *accesstothepropertyaccessormethod
- *@exceptionIllegalArgumentExceptionif<code>bean</code>or
- *<code>name</code>isnull
- *@exceptionInvocationTargetExceptionifthepropertyaccessormethod
- *throwsanexception
- *@exceptionNoSuchMethodExceptionifanaccessormethodforthis
- *propetycannotbefound
- *@seePropertyUtilsBean#getIndexedProperty(Object,String)
- */
- publicstaticObjectgetIndexedProperty(Objectbean,Stringname)
- throwsIllegalAccessException,InvocationTargetException,
- NoSuchMethodException{
- return(PropertyUtilsBean.getInstance().getIndexedProperty(bean,name));
- }
- /**
- *<p>Returnthevalueofthespecifiedindexedpropertyofthespecified
- *bean,withnotypeconversions.</p>
- *
- *<p>Formoredetailssee<code>PropertyUtilsBean</code>.</p>
- *
- *@parambeanBeanwhosepropertyistobeextracted
- *@paramnameSimplepropertynameofthepropertyvaluetobeextracted
- *@paramindexIndexofthepropertyvaluetobeextracted
- *@returntheindexedpropertyvalue
- *
- *@exceptionIndexOutOfBoundsExceptionifthespecifiedindex
- *isoutsidethevalidrangefortheunderlyingproperty
- *@exceptionIllegalAccessExceptionifthecallerdoesnothave
- *accesstothepropertyaccessormethod
- *@exceptionIllegalArgumentExceptionif<code>bean</code>or
- *<code>name</code>isnull
- *@exceptionInvocationTargetExceptionifthepropertyaccessormethod
- *throwsanexception
- *@exceptionNoSuchMethodExceptionifanaccessormethodforthis
- *propetycannotbefound
- *@seePropertyUtilsBean#getIndexedProperty(Object,String,int)
- */
- publicstaticObjectgetIndexedProperty(Objectbean,
- Stringname,intindex)
- throwsIllegalAccessException,InvocationTargetException,
- NoSuchMethodException{
- return(PropertyUtilsBean.getInstance().getIndexedProperty(bean,name,index));
- }
- /**
- *<p>Returnthevalueofthespecifiedmappedpropertyofthe
- *specifiedbean,withnotypeconversions.</p>
- *
- *<p>Formoredetailssee<code>PropertyUtilsBean</code>.</p>
- *
- *@parambeanBeanwhosepropertyistobeextracted
- *@paramname<code>propertyname(key)</code>ofthepropertyvalue
- *tobeextracted
- *@returnthemappedpropertyvalue
- *
- *@exceptionIllegalAccessExceptionifthecallerdoesnothave
- *accesstothepropertyaccessormethod
- *@exceptionInvocationTargetExceptionifthepropertyaccessormethod
- *throwsanexception
- *@exceptionNoSuchMethodExceptionifanaccessormethodforthis
- *propetycannotbefound
- *@seePropertyUtilsBean#getMappedProperty(Object,String)
- */
- publicstaticObjectgetMappedProperty(Objectbean,Stringname)
- throwsIllegalAccessException,InvocationTargetException,
- NoSuchMethodException{
- return(PropertyUtilsBean.getInstance().getMappedProperty(bean,name));
- }
- /**
- *<p>Returnthevalueofthespecifiedmappedpropertyofthespecified
- *bean,withnotypeconversions.</p>
- *
- *<p>Formoredetailssee<code>PropertyUtilsBean</code>.</p>
- *
- *@parambeanBeanwhosepropertyistobeextracted
- *@paramnameMappedpropertynameofthepropertyvaluetobeextracted
- *@paramkeyKeyofthepropertyvaluetobeextracted
- *@returnthemappedpropertyvalue
- *
- *@exceptionIllegalAccessExceptionifthecallerdoesnothave
- *accesstothepropertyaccessormethod
- *@exceptionInvocationTargetExceptionifthepropertyaccessormethod
- *throwsanexception
- *@exceptionNoSuchMethodExceptionifanaccessormethodforthis
- *propetycannotbefound
- *@seePropertyUtilsBean#getMappedProperty(Object,String,String)
- */
- publicstaticObjectgetMappedProperty(Objectbean,
- Stringname,Stringkey)
- throwsIllegalAccessException,InvocationTargetException,
- NoSuchMethodException{
- returnPropertyUtilsBean.getInstance().getMappedProperty(bean,name,key);
- }
- /**
- *<p>Returnthemappedpropertydescriptorsforthisbeanclass.</p>
- *
- *<p>Formoredetailssee<code>PropertyUtilsBean</code>.</p>
- *
- *@parambeanClassBeanclasstobeintrospected
- *@returnthemappedpropertydescriptors
- *@seePropertyUtilsBean#getMappedPropertyDescriptors(Class)
- *@deprecatedThismethodshouldnotbeexposed
- */
- publicstaticFastHashMapgetMappedPropertyDescriptors(ClassbeanClass){
- returnPropertyUtilsBean.getInstance().getMappedPropertyDescriptors(beanClass);
- }
- /**
- *<p>Returnthemappedpropertydescriptorsforthisbean.</p>
- *
- *<p>Formoredetailssee<code>PropertyUtilsBean</code>.</p>
- *
- *@parambeanBeantobeintrospected
- *@returnthemappedpropertydescriptors
- *@seePropertyUtilsBean#getMappedPropertyDescriptors(Object)
- *@deprecatedThismethodshouldnotbeexposed
- */
- publicstaticFastHashMapgetMappedPropertyDescriptors(Objectbean){
- returnPropertyUtilsBean.getInstance().getMappedPropertyDescriptors(bean);
- }
- /**
- *<p>Returnthevalueofthe(possiblynested)propertyofthespecified
- *name,forthespecifiedbean,withnotypeconversions.</p>
- *
- *<p>Formoredetailssee<code>PropertyUtilsBean</code>.</p>
- *
- *@parambeanBeanwhosepropertyistobeextracted
- *@paramnamePossiblynestednameofthepropertytobeextracted
- *@returnthenestedpropertyvalue
- *
- *@exceptionIllegalAccessExceptionifthecallerdoesnothave
- *accesstothepropertyaccessormethod
- *@exceptionIllegalArgumentExceptionif<code>bean</code>or
- *<code>name</code>isnull
- *@exceptionNestedNullExceptionifanestedreferencetoa
- *propertyreturnsnull
- *@exceptionInvocationTargetException
- *ifthepropertyaccessormethodthrowsanexception
- *@exceptionNoSuchMethodExceptionifanaccessormethodforthis
- *propetycannotbefound
- *@seePropertyUtilsBean#getNestedProperty
- */
- publicstaticObjectgetNestedProperty(Objectbean,Stringname)
- throwsIllegalAccessException,InvocationTargetException,
- NoSuchMethodException{
- returnPropertyUtilsBean.getInstance().getNestedProperty(bean,name);
- }
- /**
- *<p>Returnthevalueofthespecifiedpropertyofthespecifiedbean,
- *nomatterwhichpropertyreferenceformatisused,withno
- *typeconversions.</p>
- *
- *<p>Formoredetailssee<code>PropertyUtilsBean</code>.</p>
- *
- *@parambeanBeanwhosepropertyistobeextracted
- *@paramnamePossiblyindexedand/ornestednameoftheproperty
- *tobeextracted
- *@returnthepropertyvalue
- *
- *@exceptionIllegalAccessExceptionifthecallerdoesnothave
- *accesstothepropertyaccessormethod
- *@exceptionIllegalArgumentExceptionif<code>bean</code>or
- *<code>name</code>isnull
- *@exceptionInvocationTargetExceptionifthepropertyaccessormethod
- *throwsanexception
- *@exceptionNoSuchMethodExceptionifanaccessormethodforthis
- *propetycannotbefound
- *@seePropertyUtilsBean#getProperty
- */
- publicstaticObjectgetProperty(Objectbean,Stringname)
- throwsIllegalAccessException,InvocationTargetException,
- NoSuchMethodException{
- return(PropertyUtilsBean.getInstance().getProperty(bean,name));
- }
- /**
- *<p>Retrievethepropertydescriptorforthespecifiedpropertyofthe
- *specifiedbean,orreturn<code>null</code>ifthereisnosuch
- *descriptor.</p>
- *
- *<p>Formoredetailssee<code>PropertyUtilsBean</code>.</p>
- *
- *@parambeanBeanforwhichapropertydescriptorisrequested
- *@paramnamePossiblyindexedand/ornestednameofthepropertyfor
- *whichapropertydescriptorisrequested
- *@returnthepropertydescriptor
- *
- *@exceptionIllegalAccessExceptionifthecallerdoesnothave
- *accesstothepropertyaccessormethod
- *@exceptionIllegalArgumentExceptionif<code>bean</code>or
- *<code>name</code>isnull
- *@exceptionIllegalArgumentExceptionifanestedreferencetoa
- *propertyreturnsnull
- *@exceptionInvocationTargetExceptionifthepropertyaccessormethod
- *throwsanexception
- *@exceptionNoSuchMethodExceptionifanaccessormethodforthis
- *propetycannotbefound
- *@seePropertyUtilsBean#getPropertyDescriptor
- */
- publicstaticPropertyDescriptorgetPropertyDescriptor(Objectbean,
- Stringname)
- throwsIllegalAccessException,InvocationTargetException,
- NoSuchMethodException{
- returnPropertyUtilsBean.getInstance().getPropertyDescriptor(bean,name);
- }
- /**
- *<p>Retrievethepropertydescriptorsforthespecifiedclass,
- *introspectingandcachingthemthefirsttimeaparticularbeanclass
- *isencountered.</p>
- *
- *<p>Formoredetailssee<code>PropertyUtilsBean</code>.</p>
- *
- *@parambeanClassBeanclassforwhichpropertydescriptorsarerequested
- *@returnthepropertydescriptors
- *@exceptionIllegalArgumentExceptionif<code>beanClass</code>isnull
- *@seePropertyUtilsBean#getPropertyDescriptors(Class)
- */
- publicstaticPropertyDescriptor[]
- getPropertyDescriptors(ClassbeanClass){
- returnPropertyUtilsBean.getInstance().getPropertyDescriptors(beanClass);
- }
- /**
- *<p>Retrievethepropertydescriptorsforthespecifiedbean,
- *introspectingandcachingthemthefirsttimeaparticularbeanclass
- *isencountered.</p>
- *
- *<p>Formoredetailssee<code>PropertyUtilsBean</code>.</p>
- *
- *@parambeanBeanforwhichpropertydescriptorsarerequested
- *@returnthepropertydescriptors
- *@exceptionIllegalArgumentExceptionif<code>bean</code>isnull
- *@seePropertyUtilsBean#getPropertyDescriptors(Object)
- */
- publicstaticPropertyDescriptor[]getPropertyDescriptors(Objectbean){
- returnPropertyUtilsBean.getInstance().getPropertyDescriptors(bean);
- }
- /**
- *<p>ReturntheJavaClassrepesentingthepropertyeditorclassthathas
- *beenregisteredforthisproperty(ifany).</p>
- *
- *<p>Formoredetailssee<code>PropertyUtilsBean</code>.</p>
- *
- *@parambeanBeanforwhichapropertydescriptorisrequested
- *@paramnamePossiblyindexedand/ornestednameofthepropertyfor
- *whichapropertydescriptorisrequested
- *@returnthepropertyeditorclass
- *
- *@exceptionIllegalAccessExceptionifthecallerdoesnothave
- *accesstothepropertyaccessormethod
- *@exceptionIllegalArgumentExceptionif<code>bean</code>or
- *<code>name</code>isnull
- *@exceptionIllegalArgumentExceptionifanestedreferencetoa
- *propertyreturnsnull
- *@exceptionInvocationTargetExceptionifthepropertyaccessormethod
- *throwsanexception
- *@exceptionNoSuchMethodExceptionifanaccessormethodforthis
- *propetycannotbefound
- *@seePropertyUtilsBean#getPropertyEditorClass(Object,String)
- */
- publicstaticClassgetPropertyEditorClass(Objectbean,Stringname)
- throwsIllegalAccessException,InvocationTargetException,
- NoSuchMethodException{
- returnPropertyUtilsBean.getInstance().getPropertyEditorClass(bean,name);
- }
- /**
- *<p>ReturntheJavaClassrepresentingthepropertytypeofthespecified
- *property,or<code>null</code>ifthereisnosuchpropertyforthe
- *specifiedbean.</p>
- *
- *<p>Formoredetailssee<code>PropertyUtilsBean</code>.</p>
- *
- *@parambeanBeanforwhichapropertydescriptorisrequested
- *@paramnamePossiblyindexedand/ornestednameofthepropertyfor
- *whichapropertydescriptorisrequested
- *@returnThepropertytype
- *
- *@exceptionIllegalAccessExceptionifthecallerdoesnothave
- *accesstothepropertyaccessormethod
- *@exceptionIllegalArgumentExceptionif<code>bean</code>or
- *<code>name</code>isnull
- *@exceptionIllegalArgumentExceptionifanestedreferencetoa
- *propertyreturnsnull
- *@exceptionInvocationTargetExceptionifthepropertyaccessormethod
- *throwsanexception
- *@exceptionNoSuchMethodExceptionifanaccessormethodforthis
- *propetycannotbefound
- *@seePropertyUtilsBean#getPropertyType(Object,String)
- */
- publicstaticClassgetPropertyType(Objectbean,Stringname)
- throwsIllegalAccessException,InvocationTargetException,
- NoSuchMethodException{
- returnPropertyUtilsBean.getInstance().getPropertyType(bean,name);
- }
- /**
- *<p>Returnanaccessiblepropertygettermethodforthisproperty,
- *ifthereisone;otherwisereturn<code>null</code>.</p>
- *
- *<p>Formoredetailssee<code>PropertyUtilsBean</code>.</p>
- *
- *@paramdescriptorPropertydescriptortoreturnagetterfor
- *@returnThereadmethod
- *@seePropertyUtilsBean#getReadMethod(PropertyDescriptor)
- */
- publicstaticMethodgetReadMethod(PropertyDescriptordescriptor){
- return(PropertyUtilsBean.getInstance().getReadMethod(descriptor));
- }
- /**
- *<p>Returnthevalueofthespecifiedsimplepropertyofthespecified
- *bean,withnotypeconversions.</p>
- *
- *<p>Formoredetailssee<code>PropertyUtilsBean</code>.</p>
- *
- *@parambeanBeanwhosepropertyistobeextracted
- *@paramnameNameofthepropertytobeextracted
- *@returnThepropertyvalue
- *
- *@exceptionIllegalAccessExceptionifthecallerdoesnothave
- *accesstothepropertyaccessormethod
- *@exceptionIllegalArgumentExceptionif<code>bean</code>or
- *<code>name</code>isnull
- *@exceptionIllegalArgumentExceptionifthepropertyname
- *isnestedorindexed
- *@exceptionInvocationTargetExceptionifthepropertyaccessormethod
- *throwsanexception
- *@exceptionNoSuchMethodExceptionifanaccessormethodforthis
- *propetycannotbefound
- *@seePropertyUtilsBean#getSimpleProperty
- */
- publicstaticObjectgetSimpleProperty(Objectbean,Stringname)
- throwsIllegalAccessException,InvocationTargetException,
- NoSuchMethodException{
- returnPropertyUtilsBean.getInstance().getSimpleProperty(bean,name);
- }
- /**
- *<p>Returnanaccessiblepropertysettermethodforthisproperty,
- *ifthereisone;otherwisereturn<code>null</code>.</p>
- *
- *<p>Formoredetailssee<code>PropertyUtilsBean</code>.</p>
- *
- *@paramdescriptorPropertydescriptortoreturnasetterfor
- *@returnThewritemethod
- *@seePropertyUtilsBean#getWriteMethod(PropertyDescriptor)
- */
- publicstaticMethodgetWriteMethod(PropertyDescriptordescriptor){
- returnPropertyUtilsBean.getInstance().getWriteMethod(descriptor);
- }
- /**
- *<p>Return<code>true</code>ifthespecifiedpropertynameidentifies
- *areadablepropertyonthespecifiedbean;otherwise,return
- *<code>false</code>.</p>
- *
- *<p>Formoredetailssee<code>PropertyUtilsBean</code>.</p>
- *
- *@parambeanBeantobeexamined(maybea{@linkDynaBean}
- *@paramnamePropertynametobeevaluated
- *@return<code>true</code>ifthepropertyisreadable,
- *otherwise<code>false</code>
- *
- *@exceptionIllegalArgumentExceptionif<code>bean</code>
- *or<code>name</code>is<code>null</code>
- *@seePropertyUtilsBean#isReadable
- *@sinceBeanUtils1.6
- */
- publicstaticbooleanisReadable(Objectbean,Stringname){
- returnPropertyUtilsBean.getInstance().isReadable(bean,name);
- }
- /**
- *<p>Return<code>true</code>ifthespecifiedpropertynameidentifies
- *awriteablepropertyonthespecifiedbean;otherwise,return
- *<code>false</code>.</p>
- *
- *<p>Formoredetailssee<code>PropertyUtilsBean</code>.</p>
- *
- *@parambeanBeantobeexamined(maybea{@linkDynaBean}
- *@paramnamePropertynametobeevaluated
- *@return<code>true</code>ifthepropertyiswriteable,
- *otherwise<code>false</code>
- *
- *@exceptionIllegalArgumentExceptionif<code>bean</code>
- *or<code>name</code>is<code>null</code>
- *@seePropertyUtilsBean#isWriteable
- *@sinceBeanUtils1.6
- */
- publicstaticbooleanisWriteable(Objectbean,Stringname){
- returnPropertyUtilsBean.getInstance().isWriteable(bean,name);
- }
- /**
- *<p>Setsthevalueofthespecifiedindexedpropertyofthespecified
- *bean,withnotypeconversions.</p>
- *
- *<p>Formoredetailssee<code>PropertyUtilsBean</code>.</p>
- *
- *@parambeanBeanwhosepropertyistobemodified
- *@paramname<code>propertyname[index]</code>ofthepropertyvalue
- *tobemodified
- *@paramvalueValuetowhichthespecifiedpropertyelement
- *shouldbeset
- *
- *@exceptionIndexOutOfBoundsExceptionifthespecifiedindex
- *isoutsidethevalidrangefortheunderlyingproperty
- *@exceptionIllegalAccessExceptionifthecallerdoesnothave
- *accesstothepropertyaccessormethod
- *@exceptionIllegalArgumentExceptionif<code>bean</code>or
- *<code>name</code>isnull
- *@exceptionInvocationTargetExceptionifthepropertyaccessormethod
- *throwsanexception
- *@exceptionNoSuchMethodExceptionifanaccessormethodforthis
- *propetycannotbefound
- *@seePropertyUtilsBean#setIndexedProperty(Object,String,Object)
- */
- publicstaticvoidsetIndexedProperty(Objectbean,Stringname,
- Objectvalue)
- throwsIllegalAccessException,InvocationTargetException,
- NoSuchMethodException{
- PropertyUtilsBean.getInstance().setIndexedProperty(bean,name,value);
- }
- /**
- *<p>Setsthevalueofthespecifiedindexedpropertyofthespecified
- *bean,withnotypeconversions.</p>
- *
- *<p>Formoredetailssee<code>PropertyUtilsBean</code>.</p>
- *
- *@parambeanBeanwhosepropertyistobeset
- *@paramnameSimplepropertynameofthepropertyvaluetobeset
- *@paramindexIndexofthepropertyvaluetobeset
- *@paramvalueValuetowhichtheindexedpropertyelementistobeset
- *
- *@exceptionIndexOutOfBoundsExceptionifthespecifiedindex
- *isoutsidethevalidrangefortheunderlyingproperty
- *@exceptionIllegalAccessExceptionifthecallerdoesnothave
- *accesstothepropertyaccessormethod
- *@exceptionIllegalArgumentExceptionif<code>bean</code>or
- *<code>name</code>isnull
- *@exceptionInvocationTargetExceptionifthepropertyaccessormethod
- *throwsanexception
- *@exceptionNoSuchMethodExceptionifanaccessormethodforthis
- *propetycannotbefound
- *@seePropertyUtilsBean#setIndexedProperty(Object,String,Object)
- */
- publicstaticvoidsetIndexedProperty(Objectbean,Stringname,
- intindex,Objectvalue)
- throwsIllegalAccessException,InvocationTargetException,
- NoSuchMethodException{
- PropertyUtilsBean.getInstance().setIndexedProperty(bean,name,index,value);
- }
- /**
- *<p>Setsthevalueofthespecifiedmappedpropertyofthe
- *specifiedbean,withnotypeconversions.</p>
- *
- *<p>Formoredetailssee<code>PropertyUtilsBean</code>.</p>
- *
- *@parambeanBeanwhosepropertyistobeset
- *@paramname<code>propertyname(key)</code>ofthepropertyvalue
- *tobeset
- *@paramvalueThepropertyvaluetobeset
- *
- *@exceptionIllegalAccessExceptionifthecallerdoesnothave
- *accesstothepropertyaccessormethod
- *@exceptionInvocationTargetExceptionifthepropertyaccessormethod
- *throwsanexception
- *@exceptionNoSuchMethodExceptionifanaccessormethodforthis
- *propetycannotbefound
- *@seePropertyUtilsBean#setMappedProperty(Object,String,Object)
- */
- publicstaticvoidsetMappedProperty(Objectbean,Stringname,
- Objectvalue)
- throwsIllegalAccessException,InvocationTargetException,
- NoSuchMethodException{
- PropertyUtilsBean.getInstance().setMappedProperty(bean,name,value);
- }
- /**
- *<p>Setsthevalueofthespecifiedmappedpropertyofthespecified
- *bean,withnotypeconversions.</p>
- *
- *<p>Formoredetailssee<code>PropertyUtilsBean</code>.</p>
- *
- *@parambeanBeanwhosepropertyistobeset
- *@paramnameMappedpropertynameofthepropertyvaluetobeset
- *@paramkeyKeyofthepropertyvaluetobeset
- *@paramvalueThepropertyvaluetobeset
- *
- *@exceptionIllegalAccessExceptionifthecallerdoesnothave
- *accesstothepropertyaccessormethod
- *@exceptionInvocationTargetExceptionifthepropertyaccessormethod
- *throwsanexception
- *@exceptionNoSuchMethodExceptionifanaccessormethodforthis
- *propetycannotbefound
- *@seePropertyUtilsBean#setMappedProperty(Object,String,String,Object)
- */
- publicstaticvoidsetMappedProperty(Objectbean,Stringname,
- Stringkey,Objectvalue)
- throwsIllegalAccessException,InvocationTargetException,
- NoSuchMethodException{
- PropertyUtilsBean.getInstance().setMappedProperty(bean,name,key,value);
- }
- /**
- *<p>Setsthevalueofthe(possiblynested)propertyofthespecified
- *name,forthespecifiedbean,withnotypeconversions.</p>
- *
- *<p>Formoredetailssee<code>PropertyUtilsBean</code>.</p>
- *
- *@parambeanBeanwhosepropertyistobemodified
- *@paramnamePossiblynestednameofthepropertytobemodified
- *@paramvalueValuetowhichthepropertyistobeset
提供静态方法访问单例对象中的方法
最新推荐文章于 2023-06-01 17:44:26 发布