public class ShortNameFactory extends java.lang.Object implements NameFactory
NameFactory
. Mostly takes various Object.toString()
s and strips package names out of them so that they'll fit on the graph.Constructor and Description |
---|
ShortNameFactory() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAnnotationName(Key<?> key) |
java.lang.String |
getClassName(Key<?> key) |
protected java.lang.String |
getFileString(java.lang.StackTraceElement stackTraceElement) |
java.lang.String |
getInstanceName(java.lang.Object instance) |
java.lang.String |
getMemberName(java.lang.reflect.Member member) |
protected java.lang.String |
getMethodString(java.lang.reflect.Method method) |
java.lang.String |
getSourceName(java.lang.Object source)
Returns a name for a Guice "source" object.
|
public java.lang.String getMemberName(java.lang.reflect.Member member)
getMemberName
in interface NameFactory
public java.lang.String getAnnotationName(Key<?> key)
getAnnotationName
in interface NameFactory
public java.lang.String getClassName(Key<?> key)
getClassName
in interface NameFactory
public java.lang.String getInstanceName(java.lang.Object instance)
getInstanceName
in interface NameFactory
public java.lang.String getSourceName(java.lang.Object source)
StackTraceElement
for when the binding is made to the instance, or a Method
when a
provider method is used.getSourceName
in interface NameFactory
protected java.lang.String getFileString(java.lang.StackTraceElement stackTraceElement)
protected java.lang.String getMethodString(java.lang.reflect.Method method)