Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.opensymphony.xwork2.ognl
Class OgnlReflectionProvider

    java.lang.Object
      com.opensymphony.xwork2.ognl.OgnlReflectionProvider

All Implemented Interfaces:
  ReflectionProvider

    public class OgnlReflectionProvider

extends java.lang.Object
implements ReflectionProvider

Constructor Summary
`OgnlReflectionProvider()`

Method Summary
`void` | `copy(java.lang.Object from, java.lang.Object to, java.util.Map<java.lang.String,java.lang.Object> context, java.util.Collection<java.lang.String> exclusions, java.util.Collection<java.lang.String> 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.
`java.util.Map` | `getBeanMap(java.lang.Object source)` Creates a Map with read properties for the given source object.
`java.lang.reflect.Field` | `getField(java.lang.Class inClass, java.lang.String name)`
`java.lang.reflect.Method` | `getGetMethod(java.lang.Class targetClass, java.lang.String propertyName)`
`java.beans.PropertyDescriptor` | `getPropertyDescriptor(java.lang.Class targetClass, java.lang.String propertyName)` This method returns a PropertyDescriptor for the given class and property name using a Map lookup (using getPropertyDescriptorsMap()).
`java.beans.PropertyDescriptor[]` | `getPropertyDescriptors(java.lang.Object source)` Get's the java beans property descriptors for the given source.
`java.lang.Object` | `getRealTarget(java.lang.String property, java.util.Map<java.lang.String,java.lang.Object> context, java.lang.Object root)` Looks for the real target with the specified property given a root Object which may be a CompoundRoot.
`java.lang.reflect.Method` | `getSetMethod(java.lang.Class targetClass, java.lang.String propertyName)`
`java.lang.Object` | `getValue(java.lang.String expression, java.util.Map<java.lang.String,java.lang.Object> context, java.lang.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(java.util.Map<java.lang.String,java.lang.String> properties, java.lang.Object o)` Sets the properties on the object using the default context, defaulting to not throwing exceptions for problems setting the properties.
`void` | `setProperties(java.util.Map<java.lang.String,java.lang.String> props, java.lang.Object o, java.util.Map<java.lang.String,java.lang.Object> context)` Sets the object's properties using the default type converter, defaulting to not throw exceptions for problems setting the properties.
`void` | `setProperties(java.util.Map<java.lang.String,java.lang.String> props, java.lang.Object o, java.util.Map<java.lang.String,java.lang.Object> context, boolean throwPropertyExceptions)` Sets the object's properties using the default type converter.
`void` | `setProperty(java.lang.String name, java.lang.Object value, java.lang.Object o, java.util.Map<java.lang.String,java.lang.Object> context)` Sets the named property to the supplied value on the Object, defaults to not throwing property exceptions.
`void` | `setProperty(java.lang.String name, java.lang.Object value, java.lang.Object o, java.util.Map<java.lang.String,java.lang.Object> context, boolean throwPropertyExceptions)` Sets the named property to the supplied value on the Object,
`void` | `setValue(java.lang.String expression, java.util.Map<java.lang.String,java.lang.Object> context, java.lang.Object root, java.lang.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`

Constructor Detail

### OgnlReflectionProvider

    public OgnlReflectionProvider()

Method Detail

### setOgnlUtil

    public void setOgnlUtil(OgnlUtil ognlUtil)

### getField

    public java.lang.reflect.Field getField(java.lang.Class inClass,
                                            java.lang.String name)

  Specified by:
    `getField` in interface `ReflectionProvider`

### getGetMethod

    public java.lang.reflect.Method getGetMethod(java.lang.Class targetClass,
                                                 java.lang.String propertyName)
                                          throws java.beans.IntrospectionException,
                                                 ReflectionException

  Specified by:
    `getGetMethod` in interface `ReflectionProvider`
  Throws:
    `java.beans.IntrospectionException`
    `ReflectionException`

### getSetMethod

    public java.lang.reflect.Method getSetMethod(java.lang.Class targetClass,
                                                 java.lang.String propertyName)
                                          throws java.beans.IntrospectionException,
                                                 ReflectionException

  Specified by:
    `getSetMethod` in interface `ReflectionProvider`
  Throws:
    `java.beans.IntrospectionException`
    `ReflectionException`

### setProperties

    public void setProperties(java.util.Map<java.lang.String,java.lang.String> props,
                              java.lang.Object o,
                              java.util.Map<java.lang.String,java.lang.Object> context)

  Description copied from interface: `ReflectionProvider`
  Sets the object's properties using the default type converter, defaulting to not throw exceptions for problems setting the properties.

  Specified by:
    `setProperties` in interface `ReflectionProvider`
  Parameters:
    `props` - the properties being set
    `o` - the object
    `context` - the action context

### setProperties

    public void setProperties(java.util.Map<java.lang.String,java.lang.String> props,
                              java.lang.Object o,
                              java.util.Map<java.lang.String,java.lang.Object> context,
                              boolean throwPropertyExceptions)
                       throws ReflectionException

  Description copied from interface: `ReflectionProvider`
  Sets the object's properties using the default type converter.

  Specified by:
    `setProperties` in interface `ReflectionProvider`
  Parameters:
    `props` - the properties being set
    `o` - the object
    `context` - the action context
    `throwPropertyExceptions` - boolean which tells whether it should throw exceptions for problems setting the properties
  Throws:
    `ReflectionException`

### setProperties

    public void setProperties(java.util.Map<java.lang.String,java.lang.String> properties,
                              java.lang.Object o)

  Description copied from interface: `ReflectionProvider`
  Sets the properties on the object using the default context, defaulting to not throwing exceptions for problems setting the properties.

  Specified by:
    `setProperties` in interface `ReflectionProvider`

### getPropertyDescriptor

    public java.beans.PropertyDescriptor getPropertyDescriptor(java.lang.Class targetClass,
                                                               java.lang.String propertyName)
                                                        throws java.beans.IntrospectionException,
                                                               ReflectionException

  Description copied from interface: `ReflectionProvider`
  This method returns a PropertyDescriptor for the given class and property name using a Map lookup (using getPropertyDescriptorsMap()).

  Specified by:
    `getPropertyDescriptor` in interface `ReflectionProvider`
  Throws:
    `java.beans.IntrospectionException`
    `ReflectionException`

### copy

    public void copy(java.lang.Object from,
                     java.lang.Object to,
                     java.util.Map<java.lang.String,java.lang.Object> context,
                     java.util.Collection<java.lang.String> exclusions,
                     java.util.Collection<java.lang.String> inclusions)

  Description copied from interface: `ReflectionProvider`
  Copies the properties in the object "from" and sets them in the object "to" using specified type converter, or `XWorkConverter` if none is specified.

  Specified by:
    `copy` in interface `ReflectionProvider`
  Parameters:
    `from` - the source object
    `to` - the target object
    `context` - the action context we're running under
    `exclusions` - 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.

### getRealTarget

    public java.lang.Object getRealTarget(java.lang.String property,
                                          java.util.Map<java.lang.String,java.lang.Object> context,
                                          java.lang.Object root)
                                   throws ReflectionException

  Description copied from interface: `ReflectionProvider`
  Looks for the real target with the specified property given a root Object which may be a CompoundRoot.

  Specified by:
    `getRealTarget` in interface `ReflectionProvider`
  Returns:
    the real target or null if no object can be found with the specified property
  Throws:
    `ReflectionException`

### setProperty

    public void setProperty(java.lang.String name,
                            java.lang.Object value,
                            java.lang.Object o,
                            java.util.Map<java.lang.String,java.lang.Object> context)

  Description copied from interface: `ReflectionProvider`
  Sets the named property to the supplied value on the Object, defaults to not throwing property exceptions.

  Specified by:
    `setProperty` in interface `ReflectionProvider`
  Parameters:
    `name` - the name of the property to be set
    `value` - the value to set into the named property
    `o` - the object upon which to set the property
    `context` - the context which may include the TypeConverter

### setProperty

    public void setProperty(java.lang.String name,
                            java.lang.Object value,
                            java.lang.Object o,
                            java.util.Map<java.lang.String,java.lang.Object> context,
                            boolean throwPropertyExceptions)

  Description copied from interface: `ReflectionProvider`
  Sets the named property to the supplied value on the Object,

  Specified by:
    `setProperty` in interface `ReflectionProvider`
  Parameters:
    `name` - the name of the property to be set
    `value` - the value to set into the named property
    `o` - the object upon which to set the property
    `context` - the context which may include the TypeConverter
    `throwPropertyExceptions` - boolean which tells whether it should throw exceptions for problems setting the properties

### getBeanMap

    public java.util.Map getBeanMap(java.lang.Object source)
                             throws java.beans.IntrospectionException,
                                    ReflectionException

  Description copied from interface: `ReflectionProvider`
  Creates a Map with read properties for the given source object.

  If the source object does not have a read property (i.e. write-only) then the property is added to the map with the value `here is no read method for property-name`.

  Specified by:
    `getBeanMap` in interface `ReflectionProvider`
  Parameters:
    `source` - the source object.
  Returns:
    a Map with (key = read property name, value = value of read property).
  Throws:
    `java.beans.IntrospectionException` - is thrown if an exception occurs during introspection.
    `ReflectionException`

### getValue

    public java.lang.Object getValue(java.lang.String expression,
                                     java.util.Map<java.lang.String,java.lang.Object> context,
                                     java.lang.Object root)
                              throws ReflectionException

  Description copied from interface: `ReflectionProvider`
  Evaluates the given OGNL expression to extract a value from the given root object in a given context

  Specified by:
    `getValue` in interface `ReflectionProvider`
  Parameters:
    `expression` - the OGNL expression to be parsed
    `context` - the naming context for the evaluation
    `root` - the root object for the OGNL expression
  Returns:
    the result of evaluating the expression
  Throws:
    `ReflectionException`

### setValue

    public void setValue(java.lang.String expression,
                         java.util.Map<java.lang.String,java.lang.Object> context,
                         java.lang.Object root,
                         java.lang.Object value)
                  throws ReflectionException

  Description copied from interface: `ReflectionProvider`
  Evaluates the given OGNL expression to insert a value into the object graph rooted at the given root object given the context.

  Specified by:
    `setValue` in interface `ReflectionProvider`
  Parameters:
    `expression` - the OGNL expression to be parsed
    `context` - the naming context for the evaluation
    `root` - the root object for the OGNL expression
    `value` - the value to insert into the object graph
  Throws:
    `ReflectionException`

### getPropertyDescriptors

    public java.beans.PropertyDescriptor[] getPropertyDescriptors(java.lang.Object source)
                                                           throws java.beans.IntrospectionException

  Description copied from interface: `ReflectionProvider`
  Get's the java beans property descriptors for the given source.

  Specified by:
    `getPropertyDescriptors` in interface `ReflectionProvider`
  Parameters:
    `source` - the source object.
  Returns:
    property descriptors.
  Throws:
    `java.beans.IntrospectionException` - is thrown if an exception occurs during introspection.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2000-2011 Apache Software Foundation. All Rights Reserved.