{
final boolean isStringArray = returnType.getName().equals("[Ljava.lang.String;");
Object[] props = (Object[]) getter.invoke(bean, (Object[])null);
if (props != null)
{
IXMLElement indexElem = new XMLElement(propName);
indexElem.setAttribute(XMLConstants.INDEXED, "true");
beanElem.addChild(indexElem);
for (int i = 0; i < props.length; ++i)
{
if (isStringArray)
{
StringWrapper sw = new StringWrapper((String)props[i]);
indexElem.addChild(createElement(sw,
XMLConstants.BEAN_ELEMENT_NAME));
}
else
{
indexElem.addChild(createElement(props[i],
XMLConstants.BEAN_ELEMENT_NAME));
}
}
}
}
else if (returnType == boolean.class
|| returnType == int.class
|| returnType == short.class
|| returnType == long.class
|| returnType == float.class
|| returnType == double.class
|| returnType == char.class)
{
IXMLElement propElem = new XMLElement(propName);
propElem.setContent("" + getter.invoke(bean, (Object[])null));
beanElem.addChild(propElem);
}
else if (returnType == String.class)
{
IXMLElement propElem = new XMLElement(propName);
propElem.setContent((String) getter.invoke(bean, (Object[])null));
beanElem.addChild(propElem);
}
else
{
beanElem.addChild(createElement(getter.invoke(bean, (Object[])null), propName));