test_class.file: rice-middleware/kns/src/test/java/org/kuali/rice/kns/web/struts/form/pojo/PojoPropertyUtilsBeanTest.java
test_class.identifier: PojoPropertyUtilsBeanTest
test_case.body: @Test
      /**
       * This test checks to ensure that the PropertyUtils method which delegates
       * to the PojoPropertyUtilsBean in the KNS properly handles checking if a
       * nested property is writeable.
       */
      public void testNestedPropertyIsWriteable() {
          ReadonlyBean testBean = new ReadonlyBean();
          ReadonlyWrappingBean readonlyBean = new ReadonlyWrappingBean(testBean);
          WriteableWrappingBean writeableBean = new WriteableWrappingBean(testBean);
  
          assertFalse(PropertyUtils.isWriteable(readonlyBean, "bean.value"));
          assertFalse(PropertyUtils.isWriteable(writeableBean, "bean.value"));
      }
test_case.class_method_signature: PojoPropertyUtilsBeanTest.testNestedPropertyIsWriteable()
test_case.full_signature: @Test /** * This test checks to ensure that the PropertyUtils method which delegates * to the PojoPropertyUtilsBean in the KNS properly handles checking if a * nested property is writeable. */ public void testNestedPropertyIsWriteable()
test_case.identifier: testNestedPropertyIsWriteable
test_case.invocations: assertFalse isWriteable assertFalse isWriteable
test_case.modifiers: @Test /** * This test checks to ensure that the PropertyUtils method which delegates * to the PojoPropertyUtilsBean in the KNS properly handles checking if a * nested property is writeable. */ public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testNestedPropertyIsWriteable()
focal_class.declarator: LOG = Logger.getLogger(PojoPropertyUtilsBean.class.getName())
focal_class.modifier: public static final
focal_class.original_string: public static final Logger LOG = Logger.getLogger(PojoPropertyUtilsBean.class.getName());
focal_class.type: Logger
focal_class.var_name: LOG
focal_class.declarator: collectionItemClassProvider = new LegacyDataAdapterProvider()
focal_class.modifier: protected static
focal_class.original_string: protected static CollectionItemClassProvider collectionItemClassProvider = new LegacyDataAdapterProvider();
focal_class.type: CollectionItemClassProvider
focal_class.var_name: collectionItemClassProvider
focal_class.declarator: cache = new HashMap<String, List<Method>>()
focal_class.modifier: private
focal_class.original_string: private Map<String,List<Method>> cache = new HashMap<String, List<Method>>();
focal_class.type: Map<String,List<Method>>
focal_class.var_name: cache
focal_class.declarator: readMethodCache = new HashMap<String, Method>()
focal_class.modifier: private static
focal_class.original_string: private static Map<String,Method> readMethodCache = new HashMap<String, Method>();
focal_class.type: Map<String,Method>
focal_class.var_name: readMethodCache
focal_class.declarator: introspectionException = new IntrospectionException( "" )
focal_class.modifier: private
focal_class.original_string: private IntrospectionException introspectionException = new IntrospectionException( "" );
focal_class.type: IntrospectionException
focal_class.var_name: introspectionException
focal_class.file: rice-middleware/kns/src/main/java/org/kuali/rice/kns/web/struts/form/pojo/PojoPropertyUtilsBean.java
focal_class.identifier: PojoPropertyUtilsBean
focal_class.class_method_signature: PojoPropertyUtilsBean.PojoPropertyUtilsBean()
focal_class.full_signature: public  PojoPropertyUtilsBean()
focal_class.identifier: PojoPropertyUtilsBean
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  PojoPropertyUtilsBean()
focal_class.class_method_signature: PojoPropertyUtilsBean.getProperty(Object bean, String key)
focal_class.full_signature: public Object getProperty(Object bean, String key)
focal_class.identifier: getProperty
focal_class.modifiers: public
focal_class.parameters: (Object bean, String key)
focal_class.return: Object
focal_class.signature: Object getProperty(Object bean, String key)
focal_class.class_method_signature: PojoPropertyUtilsBean.fastGetNestedProperty(Object obj, String propertyName)
focal_class.full_signature: public Object fastGetNestedProperty(Object obj, String propertyName)
focal_class.identifier: fastGetNestedProperty
focal_class.modifiers: public
focal_class.parameters: (Object obj, String propertyName)
focal_class.return: Object
focal_class.signature: Object fastGetNestedProperty(Object obj, String propertyName)
focal_class.class_method_signature: PojoPropertyUtilsBean.isWriteable(Object bean, String name)
focal_class.full_signature: @Override public boolean isWriteable(Object bean, String name)
focal_class.identifier: isWriteable
focal_class.modifiers: @Override public
focal_class.parameters: (Object bean, String name)
focal_class.return: boolean
focal_class.signature: boolean isWriteable(Object bean, String name)
focal_class.class_method_signature: PojoPropertyUtilsBean.getNestedProperty(Object arg0, String arg1)
focal_class.full_signature: public Object getNestedProperty(Object arg0, String arg1)
focal_class.identifier: getNestedProperty
focal_class.modifiers: public
focal_class.parameters: (Object arg0, String arg1)
focal_class.return: Object
focal_class.signature: Object getNestedProperty(Object arg0, String arg1)
focal_class.class_method_signature: PojoPropertyUtilsBean.getIndexedProperty(Object bean, String name, int index)
focal_class.full_signature: public Object getIndexedProperty(Object bean, String name, int index)
focal_class.identifier: getIndexedProperty
focal_class.modifiers: public
focal_class.parameters: (Object bean, String name, int index)
focal_class.return: Object
focal_class.signature: Object getIndexedProperty(Object bean, String name, int index)
focal_class.class_method_signature: PojoPropertyUtilsBean.generateIndexedProperty(Object nestedBean, String property, int index,
              IndexOutOfBoundsException ioobe)
focal_class.full_signature: protected Object generateIndexedProperty(Object nestedBean, String property, int index,
              IndexOutOfBoundsException ioobe)
focal_class.identifier: generateIndexedProperty
focal_class.modifiers: protected
focal_class.parameters: (Object nestedBean, String property, int index,
              IndexOutOfBoundsException ioobe)
focal_class.return: Object
focal_class.signature: Object generateIndexedProperty(Object nestedBean, String property, int index,
              IndexOutOfBoundsException ioobe)
focal_class.class_method_signature: PojoPropertyUtilsBean.getUnreachableNestedProperty(Object arg0, String arg1)
focal_class.full_signature: private Object getUnreachableNestedProperty(Object arg0, String arg1)
focal_class.identifier: getUnreachableNestedProperty
focal_class.modifiers: private
focal_class.parameters: (Object arg0, String arg1)
focal_class.return: Object
focal_class.signature: Object getUnreachableNestedProperty(Object arg0, String arg1)
focal_class.class_method_signature: PojoPropertyUtilsBean.setNestedProperty(Object bean, String name, Object value)
focal_class.full_signature: public void setNestedProperty(Object bean, String name, Object value)
focal_class.identifier: setNestedProperty
focal_class.modifiers: public
focal_class.parameters: (Object bean, String name, Object value)
focal_class.return: void
focal_class.signature: void setNestedProperty(Object bean, String name, Object value)
focal_class.class_method_signature: PojoPropertyUtilsBean.getPropertyDescriptor(Object bean, String name)
focal_class.full_signature: public PropertyDescriptor getPropertyDescriptor(Object bean, String name)
focal_class.identifier: getPropertyDescriptor
focal_class.modifiers: public
focal_class.parameters: (Object bean, String name)
focal_class.return: PropertyDescriptor
focal_class.signature: PropertyDescriptor getPropertyDescriptor(Object bean, String name)
focal_class.class_method_signature: PojoPropertyUtilsBean.findNextNestedIndex(String expression)
focal_class.full_signature: private int findNextNestedIndex(String expression)
focal_class.identifier: findNextNestedIndex
focal_class.modifiers: private
focal_class.parameters: (String expression)
focal_class.return: int
focal_class.signature: int findNextNestedIndex(String expression)
focal_class.class_method_signature: PojoPropertyUtilsBean.setSimpleProperty(Object bean,
                                           String name, Object value)
focal_class.full_signature: public void setSimpleProperty(Object bean,
                                           String name, Object value)
focal_class.identifier: setSimpleProperty
focal_class.modifiers: public
focal_class.parameters: (Object bean,
                                           String name, Object value)
focal_class.return: void
focal_class.signature: void setSimpleProperty(Object bean,
                                           String name, Object value)
focal_class.class_method_signature: PojoPropertyUtilsBean.invokeMethod(
                          Method method,
                          Object bean,
                          Object[] values)
focal_class.full_signature: private Object invokeMethod(
                          Method method,
                          Object bean,
                          Object[] values)
focal_class.identifier: invokeMethod
focal_class.modifiers: private
focal_class.parameters: (
                          Method method,
                          Object bean,
                          Object[] values)
focal_class.return: Object
focal_class.signature: Object invokeMethod(
                          Method method,
                          Object bean,
                          Object[] values)
focal_class.class_method_signature: PojoPropertyUtilsBean.getPropertyType(Object bean, String name)
focal_class.full_signature: public Class getPropertyType(Object bean, String name)
focal_class.identifier: getPropertyType
focal_class.modifiers: public
focal_class.parameters: (Object bean, String name)
focal_class.return: Class
focal_class.signature: Class getPropertyType(Object bean, String name)
focal_class.superclass: extends PropertyUtilsBean
focal_method.body: @Override
      public boolean isWriteable(Object bean, String name) {
          // Validate method parameters
          if (bean == null) {
              throw new IllegalArgumentException("No bean specified");
          }
          if (name == null) {
              throw new IllegalArgumentException("No name specified for bean class '" +
                      bean.getClass() + "'");
          }
  
         // Begin Kuali foundation modification
  
          Resolver nestedResolver = getResolver();
  
          // Resolve nested references
          while (nestedResolver.hasNested(name)) {
              String next = nestedResolver.next(name);
              Object nestedBean = null;
  
              try {
                  nestedBean = getProperty(bean, next);
  
                  // If an object on which we're trying to set a value is null,
                  // 1: get its type
                  // 2: if it's not an interface, create an instance of it and set the property
                  // 2a: if it is an interface, we can't instantiate it, so the property shouldn't be writeable.
                  if (nestedBean == null) {
  
                      Class propertyType = getPropertyType(bean, next);
                      if (propertyType != null && !propertyType.isInterface()) {
                          Object newInstance = ObjectUtils.createNewObjectFromClass(propertyType);
                          setSimpleProperty(bean, next, newInstance);
                          nestedBean = getSimpleProperty(bean, next);
                      } else {
                          return false;
                      }
                  }
              } catch (IllegalAccessException e) {
                  return false;
              } catch (InvocationTargetException e) {
                  return false;
              } catch (NoSuchMethodException e) {
                  return false;
              }
  
              bean = nestedBean;
              name = nestedResolver.remove(name);
          }
  
          // End Kuali foundation modification
  
          // Remove any subscript from the final name value
          name = getResolver().getProperty(name);
  
          // Treat WrapDynaBean as special case - may be a read-only property
          // (see Jira issue# BEANUTILS-61)
          if (bean instanceof WrapDynaBean) {
              bean = ((WrapDynaBean)bean).getInstance();
          }
  
          // Return the requested result
          if (bean instanceof DynaBean) {
              // All DynaBean properties are writeable
              return (((DynaBean) bean).getDynaClass().getDynaProperty(name) != null);
          } else {
              try {
                  PropertyDescriptor desc =
                          getPropertyDescriptor(bean, name);
                  if (desc != null) {
                      Method writeMethod = desc.getWriteMethod();
                      if (writeMethod == null) {
                          if (desc instanceof IndexedPropertyDescriptor) {
                              writeMethod = ((IndexedPropertyDescriptor) desc).getIndexedWriteMethod();
                          } else if (desc instanceof MappedPropertyDescriptor) {
                              writeMethod = ((MappedPropertyDescriptor) desc).getMappedWriteMethod();
                          }
                          writeMethod = MethodUtils.getAccessibleMethod(bean.getClass(), writeMethod);
                      }
                      return (writeMethod != null);
                  } else {
                      return (false);
                  }
              } catch (IllegalAccessException e) {
                  return (false);
              } catch (InvocationTargetException e) {
                  return (false);
              } catch (NoSuchMethodException e) {
                  return (false);
              }
          }
  
      }
focal_method.class_method_signature: PojoPropertyUtilsBean.isWriteable(Object bean, String name)
focal_method.full_signature: @Override public boolean isWriteable(Object bean, String name)
focal_method.identifier: isWriteable
focal_method.invocations: getClass getResolver hasNested next getProperty getPropertyType isInterface createNewObjectFromClass setSimpleProperty getSimpleProperty remove getProperty getResolver getInstance getDynaProperty getDynaClass getPropertyDescriptor getWriteMethod getIndexedWriteMethod getMappedWriteMethod getAccessibleMethod getClass
focal_method.modifiers: @Override public
focal_method.parameters: (Object bean, String name)
focal_method.return: boolean
focal_method.signature: boolean isWriteable(Object bean, String name)