1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 package org.skife.lucene.graph;
16
17 /***
18 * <code>NameMapper</code> which returns the lowercased base name of
19 * the class of the instance passed in. For instance, <code>java.lang.String</code>
20 * would return <code>string</code>
21 */
22 public class SimpleNameMapper implements NameMapper
23 {
24 /***
25 * Returns the lowercased base name of
26 * the class of the instance passed in.
27 */
28 public String build(final Object entity)
29 {
30 final String full_name = entity.getClass().getName();
31 final</strong> String package_name = entity.getClass().getPackage().getName();
32 return</strong> full_name.substring(package_name.length() + 1, full_name.length()).toLowerCase();
33 }
34 }