com.opensymphony.xwork2.mock
Class MockObjectTypeDeterminer

java.lang.Object
  extended by com.opensymphony.xwork2.mock.MockObjectTypeDeterminer
All Implemented Interfaces:
ObjectTypeDeterminer

public class MockObjectTypeDeterminer
extends java.lang.Object
implements ObjectTypeDeterminer

Mocks the function of an ObjectTypeDeterminer for testing purposes.

Author:
Gabe

Constructor Summary
MockObjectTypeDeterminer()
           
MockObjectTypeDeterminer(java.lang.Class keyClass, java.lang.Class elementClass, java.lang.String keyProperty, boolean shouldCreateIfNew)
           
 
Method Summary
 java.lang.Class getElementClass()
           
 java.lang.Class getElementClass(java.lang.Class parentClass, java.lang.String property, java.lang.Object key)
           
 java.lang.Class getKeyClass()
           
 java.lang.Class getKeyClass(java.lang.Class parentClass, java.lang.String property)
           
 java.lang.String getKeyProperty()
           
 java.lang.String getKeyProperty(java.lang.Class parentClass, java.lang.String property)
           
 boolean isShouldCreateIfNew()
           
 void setElementClass(java.lang.Class elementClass)
           
 void setKeyClass(java.lang.Class keyClass)
           
 void setKeyProperty(java.lang.String keyProperty)
           
 void setShouldCreateIfNew(boolean shouldCreateIfNew)
           
 boolean shouldCreateIfNew(java.lang.Class parentClass, java.lang.String property, java.lang.Object target, java.lang.String keyProperty, boolean isIndexAccessed)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MockObjectTypeDeterminer

public MockObjectTypeDeterminer()

MockObjectTypeDeterminer

public MockObjectTypeDeterminer(java.lang.Class keyClass,
                                java.lang.Class elementClass,
                                java.lang.String keyProperty,
                                boolean shouldCreateIfNew)
Parameters:
keyClass -
elementClass -
keyProperty -
shouldCreateIfNew -
Method Detail

getKeyClass

public java.lang.Class getKeyClass(java.lang.Class parentClass,
                                   java.lang.String property)
Specified by:
getKeyClass in interface ObjectTypeDeterminer

getElementClass

public java.lang.Class getElementClass(java.lang.Class parentClass,
                                       java.lang.String property,
                                       java.lang.Object key)
Specified by:
getElementClass in interface ObjectTypeDeterminer

getKeyProperty

public java.lang.String getKeyProperty(java.lang.Class parentClass,
                                       java.lang.String property)
Specified by:
getKeyProperty in interface ObjectTypeDeterminer

shouldCreateIfNew

public boolean shouldCreateIfNew(java.lang.Class parentClass,
                                 java.lang.String property,
                                 java.lang.Object target,
                                 java.lang.String keyProperty,
                                 boolean isIndexAccessed)
Specified by:
shouldCreateIfNew in interface ObjectTypeDeterminer

getElementClass

public java.lang.Class getElementClass()
Returns:
Returns the elementClass.

setElementClass

public void setElementClass(java.lang.Class elementClass)
Parameters:
elementClass - The elementClass to set.

getKeyClass

public java.lang.Class getKeyClass()
Returns:
Returns the keyClass.

setKeyClass

public void setKeyClass(java.lang.Class keyClass)
Parameters:
keyClass - The keyClass to set.

getKeyProperty

public java.lang.String getKeyProperty()
Returns:
Returns the keyProperty.

setKeyProperty

public void setKeyProperty(java.lang.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.


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