<commit_before><commit_msg>Path helper for dot notation<commit_after>package org.fugerit.java.core.lang.helpers.reflect;

/**
 * Simple class to look up a property path in a java object
 * 
 * @author fugerit
 *
 */
public class PathHelper {

	public static Object lookup( String path, Object target ) throws Exception {
		String[] nodes = path.split( "\\." );
		Object result = target;
		for ( int k=0; k<nodes.length; k++ ) {
			result = MethodHelper.invokeGetter( result, nodes[k] );
		}
		return result;
	}
	
}

{'fraction_non_alphanumeric': 0.12427184466019417, 'fraction_numerical': 0.001941747572815534, 'mean_word_length': 3.6486486486486487, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7062713', 'n_tokens_mistral': 173, 'n_tokens_neox': 162, 'n_words': 50}