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.mock
Class MockObjectTypeDeterminer

    java.lang.Object
      com.opensymphony.xwork2.mock.MockObjectTypeDeterminer

All Implemented Interfaces:
  ObjectTypeDeterminer

    public class MockObjectTypeDeterminer

extends Object
implements ObjectTypeDeterminer

Mocks the function of an ObjectTypeDeterminer for testing purposes.

Author:
  Gabe

Field Summary
`private Class` | `elementClass`
`private Class` | `keyClass`
`private String` | `keyProperty`
`private boolean` | `shouldCreateIfNew`

Constructor Summary
`MockObjectTypeDeterminer()`
`MockObjectTypeDeterminer(Class keyClass, Class elementClass, String keyProperty, boolean shouldCreateIfNew)`

Method Summary
`Class` | `getElementClass()`
`Class` | `getElementClass(Class parentClass, String property, Object key)`
`Class` | `getKeyClass()`
`Class` | `getKeyClass(Class parentClass, String property)`
`String` | `getKeyProperty()`
`String` | `getKeyProperty(Class parentClass, String property)`
`boolean` | `isShouldCreateIfNew()`
`void` | `setElementClass(Class elementClass)`
`void` | `setKeyClass(Class keyClass)`
`void` | `setKeyProperty(String keyProperty)`
`void` | `setShouldCreateIfNew(boolean shouldCreateIfNew)`
`boolean` | `shouldCreateIfNew(Class parentClass, String property, Object target, String keyProperty, boolean isIndexAccessed)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### keyClass

    private Class keyClass

### elementClass

    private Class elementClass

### keyProperty

    private String keyProperty

### shouldCreateIfNew

    private boolean shouldCreateIfNew

Constructor Detail

### MockObjectTypeDeterminer

    public MockObjectTypeDeterminer()

### MockObjectTypeDeterminer

    public MockObjectTypeDeterminer(Class keyClass,
                                    Class elementClass,
                                    String keyProperty,
                                    boolean shouldCreateIfNew)

Parameters:
  `keyClass` -
  `elementClass` -
  `keyProperty` -
  `shouldCreateIfNew` -

Method Detail

### getKeyClass

    public Class getKeyClass(Class parentClass,
                             String property)

  Specified by:
    `getKeyClass` in interface `ObjectTypeDeterminer`

### getElementClass

    public Class getElementClass(Class parentClass,
                                 String property,
                                 Object key)

  Specified by:
    `getElementClass` in interface `ObjectTypeDeterminer`

### getKeyProperty

    public String getKeyProperty(Class parentClass,
                                 String property)

  Specified by:
    `getKeyProperty` in interface `ObjectTypeDeterminer`

### shouldCreateIfNew

    public boolean shouldCreateIfNew(Class parentClass,
                                     String property,
                                     Object target,
                                     String keyProperty,
                                     boolean isIndexAccessed)

  Specified by:
    `shouldCreateIfNew` in interface `ObjectTypeDeterminer`

### getElementClass

    public Class getElementClass()

  Returns:
    Returns the elementClass.

### setElementClass

    public void setElementClass(Class elementClass)

  Parameters:
    `elementClass` - The elementClass to set.

### getKeyClass

    public Class getKeyClass()

  Returns:
    Returns the keyClass.

### setKeyClass

    public void setKeyClass(Class keyClass)

  Parameters:
    `keyClass` - The keyClass to set.

### getKeyProperty

    public String getKeyProperty()

  Returns:
    Returns the keyProperty.

### setKeyProperty

    public void setKeyProperty(String keyProperty)

  Parameters:
    `keyProperty` - The keyProperty to set.

### isShouldCreateIfNew

    public boolean isShouldCreateIfNew()

  Returns:
    Returns the shouldCreateIfNew.

### setShouldCreateIfNew

    public void setShouldCreateIfNew(boolean shouldCreateIfNew)

  Parameters:
    `shouldCreateIfNew` - The shouldCreateIfNew to set.

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-2007 Apache Software Foundation. All Rights Reserved.