public static void collectAnnotatedStyleableInfos( Object obj, Map<String, Class<?>> infos )
		throws IllegalArgumentException
	{
		HashSet<String> processedFields = new HashSet<>();
		Class<?> cls = obj.getClass();

		for(;;) {
			// find fields annotated with 'Styleable'
			for( Field f : cls.getDeclaredFields() ) {
				if( !isValidField( f ) )
					continue;

				Styleable styleable = f.getAnnotation( Styleable.class );
				if( styleable == null )
					continue;

				String name = f.getName();
				Class<?> type = f.getType();

				// for the case that the same field name is used in a class and in
				// one of its superclasses (e.g. field 'borderColor' in FlatButtonBorder
				// and in FlatBorder), do not process field in superclass
				if( processedFields.contains( name ) )
					continue;
				processedFields.add( name );

				// handle "dot" keys (e.g. change field name "iconArrowType" to style key "icon.arrowType")
				if( styleable.dot() ) {
					int len = name.length();
					for( int i = 0; i < len; i++ ) {
						if( Character.isUpperCase( name.charAt( i ) ) ) {
							name = name.substring( 0, i ) + '.'
								+ Character.toLowerCase( name.charAt( i ) )
								+ name.substring( i + 1 );
							break;
						}
					}
				}

				// field has a different type
				if( styleable.type() != Void.class )
					type = styleable.type();

				infos.put( name, type );
			}

			// get fields specified in 'StyleableField' annotation
			for( StyleableField styleableField : cls.getAnnotationsByType( StyleableField.class ) ) {
				String name = styleableField.key();

				// for the case that the same field name is used in a class and in
				// one of its superclasses, do not process field in superclass
				if( processedFields.contains( name ) )
					continue;
				processedFields.add( name );

				Field f = getStyleableField( styleableField );
				infos.put( name, f.getType() );
			}

			cls = cls.getSuperclass();
			if( cls == null )
				return;

			String superclassName = cls.getName();
			if( superclassName.startsWith( "java." ) || superclassName.startsWith( "javax." ) )
				return;
		}
	}
Search for all fields annotated with {@link Styleable} and add them to the given map.
The key is the name of the field and the value the type of the field.
flatlaf-core/src/main/java/com/formdev/flatlaf/ui/FlatStylingSupport.java