JField[] fields = JClassUtils.getDeclaredFields(dtoType);
String dtoTypeName = dtoType.getParameterizedQualifiedSourceName();
for (int i = 0; i < fields.length; i++)
{
JField field = fields[i];
String name = field.getName();
JType fieldType = field.getType();
String fieldTypeName = fieldType.getParameterizedQualifiedSourceName();
String setterName = null;
String getterName = null;
if (fieldType.isPrimitive() != null)
{
JPrimitiveType jPrimitiveType = fieldType.isPrimitive();
fieldTypeName = jPrimitiveType.getQualifiedBoxedSourceName();
}
try
{
setterName = dtoType.getMethod(ClassUtils.getSetterMethod(name), new JType[]{fieldType}).getName();
getterName = dtoType.getMethod(ClassUtils.getGetterMethod(name), new JType[]{}).getName();
}
catch (NotFoundException e)
{
// do nothing
}
boolean isPublic = field.isPublic() && !field.isStatic();
boolean hasGetterAndSetter = setterName != null && getterName != null;
boolean isAccessible = isPublic || hasGetterAndSetter;
if(isAccessible)
{