use of jodd.introspector.FieldDescriptor in project jodd by oblac.
the class TypeJsonVisitor method visit.
/**
* Visits a type.
*/
public void visit() {
ClassDescriptor classDescriptor = ClassIntrospector.lookup(type);
if (classMetadataName != null) {
// process first 'meta' fields 'class'
onProperty(classMetadataName, null, false);
}
PropertyDescriptor[] propertyDescriptors = classDescriptor.getAllPropertyDescriptors();
for (PropertyDescriptor propertyDescriptor : propertyDescriptors) {
Getter getter = propertyDescriptor.getGetter(declared);
if (getter != null) {
String propertyName = propertyDescriptor.getName();
boolean isTransient = false;
// check for transient flag
FieldDescriptor fieldDescriptor = propertyDescriptor.getFieldDescriptor();
if (fieldDescriptor != null) {
isTransient = Modifier.isTransient(fieldDescriptor.getField().getModifiers());
}
onProperty(propertyName, propertyDescriptor, isTransient);
}
}
}
Aggregations