Package com.google.inject.grapher
Class ShortNameFactory
- java.lang.Object
-
- com.google.inject.grapher.ShortNameFactory
-
- All Implemented Interfaces:
NameFactory
public class ShortNameFactory extends 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 String
getAnnotationName(Key<?> key)
String
getClassName(Key<?> key)
protected String
getFileString(StackTraceElement stackTraceElement)
String
getInstanceName(Object instance)
String
getMemberName(Member member)
protected String
getMethodString(Method method)
String
getSourceName(Object source)
Returns a name for a Guice "source" object.
-
-
-
Method Detail
-
getMemberName
public String getMemberName(Member member)
- Specified by:
getMemberName
in interfaceNameFactory
-
getAnnotationName
public String getAnnotationName(Key<?> key)
- Specified by:
getAnnotationName
in interfaceNameFactory
-
getClassName
public String getClassName(Key<?> key)
- Specified by:
getClassName
in interfaceNameFactory
-
getInstanceName
public String getInstanceName(Object instance)
- Specified by:
getInstanceName
in interfaceNameFactory
-
getSourceName
public String getSourceName(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 String getFileString(StackTraceElement stackTraceElement)
-
-