/*
* The Apache Software License, Version 1.1
*
* Copyright (c) 2001-2003 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgement:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgement may appear in the software itself,
* if and wherever such third-party acknowledgements normally appear.
*
* 4. The names "Apache", "The Jakarta Project", "Commons", and "Apache Software
* Foundation" must not be used to endorse or promote products derived
* from this software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* "Apache" nor may "Apache" appear in their names without prior
* written permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
*/
package com.opensymphony.workflow.designer.beanutils;
import java.beans.*;
import java.lang.reflect.Array;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.*;
/**
* Utility methods for using Java Reflection APIs to facilitate generic
* property getter and setter operations on Java objects. Much of this
* code was originally included in <code>BeanUtils</code>, but has been
* separated because of the volume of code involved.
* <p/>
* In general, the objects that are examined and modified using these
* methods are expected to conform to the property getter and setter method
* naming conventions described in the JavaBeans Specification (Version 1.0.1).
* No data type conversions are performed, and there are no usage of any
* <code>PropertyEditor</code> classes that have been registered, although
* a convenient way to access the registered classes themselves is included.
* <p/>
* For the purposes of this class, five formats for referencing a particular
* property value of a bean are defined, with the layout of an identifying
* String in parentheses:
* <ul>
* <li><strong>Simple (<code>name</code>)</strong> - The specified
* <code>name</code> identifies an individual property of a particular
* JavaBean. The name of the actual getter or setter method to be used
* is determined using standard JavaBeans instrospection, so that (unless
* overridden by a <code>BeanInfo</code> class, a property named "xyz"
* will have a getter method named <code>getXyz()</code> or (for boolean
* properties only) <code>isXyz()</code>, and a setter method named
* <code>setXyz()</code>.</li>
* <li><strong>Nested (<code>name1.name2.name3</code>)</strong> The first
* name element is used to select a property getter, as for simple
* references above. The object returned for this property is then
* consulted, using the same approach, for a property getter for a
* property named <code>name2</code>, and so on. The property value that
* is ultimately retrieved or modified is the one identified by the
* last name element.</li>
* <li><strong>Indexed (<code>name[index]</code>)</strong> - The underlying
* property value is assumed to be an array, or this JavaBean is assumed
* to have indexed property getter and setter methods. The appropriate
* (zero-relative) entry in the array is selected. <code>List</code>
* objects are now also supported for read/write. You simply need to define
* a getter that returns the <code>List</code></li>
* <li><strong>Mapped (<code>name(key)</code>)</strong> - The JavaBean
* is assumed to have an property getter and setter methods with an
* additional attribute of type <code>java.lang.String</code>.</li>
* <li><strong>Combined (<code>name1.name2[index].name3(key)</code>)</strong> -
* Combining mapped, nested, and indexed references is also
* supported.</li>
* </ul>
*
* @author Craig R. McClanahan
* @author Ralph Schaer
* @author Chris Audley
* @author Rey Fran�ois
* @author Gregor Ra�man
* @author Jan Sorensen
* @author Scott Sanders
* @see PropertyUtils
* @since 1.7
*/
public class PropertyUtilsBean
{
private static final PropertyUtilsBean instance = new PropertyUtilsBean();
// --------------------------------------------------------- Class Methods
protected static PropertyUtilsBean getInstance()
{
return instance;
}
// --------------------------------------------------------- Variables
/**
* The cache of PropertyDescriptor arrays for beans we have already
* introspected, keyed by the java.lang.Class of this object.
*/
private Map descriptorsCache = null;
private Map mappedDescriptorsCache = null;
// ---------------------------------------------------------- Constructors
/**
* Base constructor
*/
public PropertyUtilsBean()
{
descriptorsCache = new HashMap();
mappedDescriptorsCache = new HashMap();
}
// --------------------------------------------------------- Public Methods
/**
* Clear any cached property descriptors information for all classes
* loaded by any class loaders. This is useful in cases where class
* loaders are thrown away to implement class reloading.
*/
public void clearDescriptors()
{
descriptorsCache.clear();
mappedDescriptorsCache.clear();
Introspector.flushCaches();
}
/**
* <p>Copy property values from the "origin" bean to the "destination" bean
* for all cases where the property names are the same (even though the
* actual getter and setter methods might have been customized via
* <code>BeanInfo</code> classes). No conversions are performed on the
* actual property values -- it is assumed that the values retrieved from
* the origin bean are assignment-compatible with the types expected by
* the destination bean.</p>
* <p/>
* <p>If the origin "bean" is actually a <code>Map</code>, it is assumed
* to contain String-valued <strong>simple</strong> property names as the keys, pointing
* at the corresponding property values that will be set in the destination
* bean.<strong>Note</strong> that this method is intended to perform
* a "shallow copy" of the properties and so complex properties
* (for example, nested ones) will not be copied.</p>
*
* @param dest Destination bean whose properties are modified
* @
没有合适的资源?快使用搜索试试~ 我知道了~
osworkflow-2.8.0
共1280个文件
html:566个
java:391个
xml:106个
5星 · 超过95%的资源 需积分: 48 217 下载量 186 浏览量
2008-10-09
15:33:00
上传
评论
收藏 20.79MB ZIP 举报
温馨提示
OSworkflow是一个嵌入式的工作流管理系统
资源推荐
资源详情
资源评论
收起资源包目录
osworkflow-2.8.0 (1280个子文件)
quartzrunner.bat 1KB
mckoi.conf 6KB
site.css 22KB
stylesheet.css 1KB
api.css 1KB
workflow_2_8.dtd 9KB
workflow_2_7.dtd 9KB
workflow_2_6_1.dtd 8KB
workflow_2_6.dtd 7KB
workflow_2_5.dtd 7KB
splash.gif 6KB
user_16.gif 1008B
home_16.gif 594B
user_12.gif 528B
mail_16.gif 381B
port.gif 326B
blogentry_16.gif 268B
mail_small.gif 202B
comment_16.gif 178B
linkext7.gif 166B
border_bottom.gif 117B
close.gif 73B
bullet_blue.gif 60B
inherit.gif 57B
spacer.gif 43B
index-all.html 638KB
StoreException.html 148KB
Step.html 93KB
AbstractWorkflow.html 88KB
WorkflowException.html 87KB
serialized-form.html 83KB
overview-tree.html 66KB
JDBCWorkflowStore.html 66KB
WorkflowEntry.html 61KB
WorkflowDescriptor.html 57KB
EJBWorkflow.html 57KB
OfbizSOAPWorkflow.html 56KB
BasicSOAPWorkflow.html 55KB
WorkflowDescriptor.html 54KB
FactoryException.html 52KB
AbstractHibernateWorkflowStore.html 50KB
AbstractHibernateWorkflowStore.html 50KB
Workflow.html 49KB
package-use.html 48KB
constant-values.html 48KB
SpringHibernateWorkflowStore.html 45KB
HTTPWorkflowFactory.html 43KB
WorkflowRemote.html 42KB
PrevaylerWorkflowStore.html 41KB
CurrentStepCMP.html 41KB
ActionDescriptor.html 40KB
WorkflowQuery.html 40KB
HibernateWorkflowStore.html 39KB
ResultDescriptor.html 39KB
WorkflowSystem.html 38KB
XMLWorkflowFactory.html 38KB
HistoryStepCMP.html 38KB
EJBWorkflowStore.html 38KB
OJBWorkflowStore.html 38KB
JDBCWorkflowFactory.html 37KB
OfbizWorkflowStore.html 37KB
DescriptorFactory.html 37KB
SerializableWorkflowStore.html 37KB
SpringBeanNameWorkflowFactory.html 36KB
WorkflowExpressionQuery.html 36KB
HibernateStep.html 35KB
MemoryWorkflowStore.html 35KB
OJBStep.html 35KB
DefaultConfiguration.html 35KB
StepDescriptor.html 34KB
SimpleStep.html 34KB
WorkflowEJB.html 34KB
allclasses-frame.html 34KB
FieldExpression.html 33KB
HistoryStepEJB.html 33KB
SpringConfiguration.html 32KB
SpringHibernateWorkflowFactory.html 32KB
CurrentStepEJB.html 32KB
URLWorkflowFactory.html 32KB
WorkflowStore.html 31KB
allclasses-noframe.html 30KB
WorkflowQuery.html 29KB
WorkflowContext.html 29KB
WorkflowStore.html 29KB
OfbizWorkflow.html 28KB
WorkflowStoreSessionEJB.html 27KB
HibernateWorkflowEntry.html 27KB
package-use.html 27KB
WorkflowStoreRemote.html 27KB
MySQLWorkflowStore.html 26KB
1.3 Running the Example App.html 26KB
WorkflowEntryCMP.html 26KB
SpringTypeResolver.html 26KB
ConditionalResultDescriptor.html 26KB
WorkflowSession.html 25KB
WorkflowFactory.html 25KB
ConditionDescriptor.html 25KB
FunctionProvider.html 24KB
TypeResolver.html 24KB
package-use.html 23KB
共 1280 条
- 1
- 2
- 3
- 4
- 5
- 6
- 13
chfhwl
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
前往页