/** * Scans the owner class to find all fields annotated with @UiField, and puts * them in {@link #uiFields} and {@link #uiFieldTypes}. * * @param ownerType the type of the owner class */ private void findUiFields(JClassType ownerType) throws UnableToCompleteException { JField[] fields = ownerType.getFields(); for (JField field : fields) { if (field.isAnnotationPresent(UiField.class)) { JClassType ownerFieldType = field.getType().isClassOrInterface(); if (ownerFieldType == null) { logger.die("Field type is not a class in field " + field.getName()); } OwnerField ownerField = new OwnerField(field, logger, context); String ownerFieldName = field.getName(); uiFields.put(ownerFieldName, ownerField); uiFieldTypes.put(ownerFieldType, ownerField); } } // Recurse to superclass JClassType superclass = ownerType.getSuperclass(); if (superclass != null) { findUiFields(superclass); } }
/** * Scans the owner class to find all fields annotated with @UiField, and puts * them in {@link #uiFields} and {@link #uiFieldTypes}. * * @param ownerType the type of the owner class */ private void findUiFields(JClassType ownerType) throws UnableToCompleteException { JField[] fields = ownerType.getFields(); for (JField field : fields) { if (field.isAnnotationPresent(UiField.class)) { JClassType ownerFieldType = field.getType().isClassOrInterface(); if (ownerFieldType == null) { logger.die("Field type is not a class in field " + field.getName()); } OwnerField ownerField = new OwnerField(field, logger, context); String ownerFieldName = field.getName(); uiFields.put(ownerFieldName, ownerField); uiFieldTypes.put(ownerFieldType, ownerField); } } // Recurse to superclass JClassType superclass = ownerType.getSuperclass(); if (superclass != null) { findUiFields(superclass); } }