|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.opensymphony.xwork2.ognl.OgnlReflectionProvider
public class OgnlReflectionProvider
Field Summary | |
---|---|
private OgnlUtil |
ognlUtil
|
Constructor Summary | |
---|---|
OgnlReflectionProvider()
|
Method Summary | |
---|---|
void |
copy(Object from,
Object to,
Map context,
Collection exclusions,
Collection inclusions)
Copies the properties in the object "from" and sets them in the object "to" using specified type converter, or XWorkConverter if none
is specified. |
Map |
getBeanMap(Object source)
Creates a Map with read properties for the given source object. |
Field |
getField(Class inClass,
String name)
|
Method |
getGetMethod(Class targetClass,
String propertyName)
|
PropertyDescriptor |
getPropertyDescriptor(Class targetClass,
String propertyName)
This method returns a PropertyDescriptor for the given class and property name using a Map lookup (using getPropertyDescriptorsMap()). |
PropertyDescriptor[] |
getPropertyDescriptors(Object source)
Get's the java beans property descriptors for the given source. |
Object |
getRealTarget(String property,
Map context,
Object root)
Looks for the real target with the specified property given a root Object which may be a CompoundRoot. |
Method |
getSetMethod(Class targetClass,
String propertyName)
|
Object |
getValue(String expression,
Map context,
Object root)
Evaluates the given OGNL expression to extract a value from the given root object in a given context |
void |
setOgnlUtil(OgnlUtil ognlUtil)
|
void |
setProperties(Map properties,
Object o)
Sets the properties on the object using the default context, defaulting to not throwing exceptions for problems setting the properties. |
void |
setProperties(Map props,
Object o,
Map context)
Sets the object's properties using the default type converter, defaulting to not throw exceptions for problems setting the properties. |
void |
setProperties(Map props,
Object o,
Map context,
boolean throwPropertyExceptions)
Sets the object's properties using the default type converter. |
void |
setProperty(String name,
Object value,
Object o,
Map context)
Sets the named property to the supplied value on the Object, defaults to not throwing property exceptions. |
void |
setValue(String expression,
Map context,
Object root,
Object value)
Evaluates the given OGNL expression to insert a value into the object graph rooted at the given root object given the context. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private OgnlUtil ognlUtil
Constructor Detail |
---|
public OgnlReflectionProvider()
Method Detail |
---|
public void setOgnlUtil(OgnlUtil ognlUtil)
public Field getField(Class inClass, String name)
getField
in interface ReflectionProvider
public Method getGetMethod(Class targetClass, String propertyName) throws IntrospectionException, ReflectionException
getGetMethod
in interface ReflectionProvider
IntrospectionException
ReflectionException
public Method getSetMethod(Class targetClass, String propertyName) throws IntrospectionException, ReflectionException
getSetMethod
in interface ReflectionProvider
IntrospectionException
ReflectionException
public void setProperties(Map props, Object o, Map context)
ReflectionProvider
setProperties
in interface ReflectionProvider
props
- the properties being seto
- the objectcontext
- the action contextpublic void setProperties(Map props, Object o, Map context, boolean throwPropertyExceptions)
ReflectionProvider
setProperties
in interface ReflectionProvider
props
- the properties being seto
- the objectcontext
- the action contextthrowPropertyExceptions
- boolean which tells whether it should throw exceptions for
problems setting the propertiespublic void setProperties(Map properties, Object o)
ReflectionProvider
setProperties
in interface ReflectionProvider
public PropertyDescriptor getPropertyDescriptor(Class targetClass, String propertyName) throws IntrospectionException, ReflectionException
ReflectionProvider
getPropertyDescriptor
in interface ReflectionProvider
IntrospectionException
ReflectionException
public void copy(Object from, Object to, Map context, Collection exclusions, Collection inclusions)
ReflectionProvider
XWorkConverter
if none
is specified.
copy
in interface ReflectionProvider
from
- the source objectto
- the target objectcontext
- the action context we're running underexclusions
- collection of method names to excluded from copying ( can be null)inclusions
- collection of method names to included copying (can be null)
note if exclusions AND inclusions are supplied and not null nothing will get copied.public Object getRealTarget(String property, Map context, Object root) throws ReflectionException
ReflectionProvider
getRealTarget
in interface ReflectionProvider
ReflectionException
public void setProperty(String name, Object value, Object o, Map context)
ReflectionProvider
setProperty
in interface ReflectionProvider
name
- the name of the property to be setvalue
- the value to set into the named propertyo
- the object upon which to set the propertycontext
- the context which may include the TypeConverterpublic Map getBeanMap(Object source) throws IntrospectionException, ReflectionException
ReflectionProvider
here is no read method for property-name
.
getBeanMap
in interface ReflectionProvider
source
- the source object.
IntrospectionException
- is thrown if an exception occurs during introspection.
ReflectionException
public Object getValue(String expression, Map context, Object root) throws ReflectionException
ReflectionProvider
getValue
in interface ReflectionProvider
expression
- the OGNL expression to be parsedcontext
- the naming context for the evaluationroot
- the root object for the OGNL expression
ReflectionException
public void setValue(String expression, Map context, Object root, Object value) throws ReflectionException
ReflectionProvider
setValue
in interface ReflectionProvider
expression
- the OGNL expression to be parsedcontext
- the naming context for the evaluationroot
- the root object for the OGNL expressionvalue
- the value to insert into the object graph
ReflectionException
public PropertyDescriptor[] getPropertyDescriptors(Object source) throws IntrospectionException
ReflectionProvider
getPropertyDescriptors
in interface ReflectionProvider
source
- the source object.
IntrospectionException
- is thrown if an exception occurs during introspection.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |