Package com.google.inject.grapher
Class ShortNameFactory
- java.lang.Object
-
- com.google.inject.grapher.ShortNameFactory
-
- All Implemented Interfaces:
NameFactory
public class ShortNameFactory extends java.lang.Object implements NameFactory
Reasonable implementation forNameFactory
. Mostly takes variousObject.toString()
s and strips package names out of them so that they'll fit on the graph.
-
-
Constructor Summary
Constructors Constructor Description ShortNameFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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.
-
-
-
Method Detail
-
getMemberName
public java.lang.String getMemberName(java.lang.reflect.Member member)
- Specified by:
getMemberName
in interfaceNameFactory
-
getAnnotationName
public java.lang.String getAnnotationName(Key<?> key)
- Specified by:
getAnnotationName
in interfaceNameFactory
-
getClassName
public java.lang.String getClassName(Key<?> key)
- Specified by:
getClassName
in interfaceNameFactory
-
getInstanceName
public java.lang.String getInstanceName(java.lang.Object instance)
- Specified by:
getInstanceName
in interfaceNameFactory
-
getSourceName
public java.lang.String getSourceName(java.lang.Object source)
Returns a name for a Guice "source" object. This will typically be either aStackTraceElement
for when the binding is made to the instance, or aMethod
when a provider method is used.- Specified by:
getSourceName
in interfaceNameFactory
-
getFileString
protected java.lang.String getFileString(java.lang.StackTraceElement stackTraceElement)
-
getMethodString
protected java.lang.String getMethodString(java.lang.reflect.Method method)
-
-