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 StringgetAnnotationName(Key<?> key)StringgetClassName(Key<?> key)protected StringgetFileString(StackTraceElement stackTraceElement)StringgetInstanceName(Object instance)StringgetMemberName(Member member)protected StringgetMethodString(Method method)StringgetSourceName(Object source)Returns a name for a Guice "source" object.
-
-
-
Method Detail
-
getMemberName
public String getMemberName(Member member)
- Specified by:
getMemberNamein interfaceNameFactory
-
getAnnotationName
public String getAnnotationName(Key<?> key)
- Specified by:
getAnnotationNamein interfaceNameFactory
-
getClassName
public String getClassName(Key<?> key)
- Specified by:
getClassNamein interfaceNameFactory
-
getInstanceName
public String getInstanceName(Object instance)
- Specified by:
getInstanceNamein interfaceNameFactory
-
getSourceName
public String getSourceName(Object source)
Returns a name for a Guice "source" object. This will typically be either aStackTraceElementfor when the binding is made to the instance, or aMethodwhen a provider method is used.- Specified by:
getSourceNamein interfaceNameFactory
-
getFileString
protected String getFileString(StackTraceElement stackTraceElement)
-
-