|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.gwt.inject.rebind.util.NameGenerator
public class NameGenerator
Helper to generate various names for members of a Ginjector
implementation.
Constructor Summary | |
---|---|
NameGenerator()
|
Method Summary | |
---|---|
java.lang.String |
convertToValidMemberName(java.lang.String name)
|
java.lang.String |
createMethodName(java.lang.String base)
Returns a new valid (i.e. |
java.lang.String |
getAssistedInjectMethodName(Key<?> factoryKey,
java.lang.String methodName)
Returns the name of an assisted injection helper method. |
java.lang.String |
getChildInjectorGetterMethodName(java.lang.String childInjectorClassName)
Returns the name of a getter for a child injector. |
java.lang.String |
getFragmentCanonicalClassName(java.lang.String injectorClassName,
FragmentPackageName fragmentPackageName)
Computes the canonical name (including package) of a single fragment of a Ginjector. |
java.lang.String |
getFragmentClassName(java.lang.String injectorClassName,
FragmentPackageName fragmentPackageName)
Computes the name of a single fragment of a Ginjector. |
java.lang.String |
getFragmentFieldName(FragmentPackageName fragmentPackageName)
Computes the field name of a single fragment of an injector. |
java.lang.String |
getFragmentGetterMethodName(FragmentPackageName fragmentPackageName)
Returnst he name of a getter for an injector fragment. |
java.lang.String |
getGetterMethodName(Key<?> key)
Returns the key's getter method name. |
java.lang.String |
getGinjectorInterfaceFieldName()
Computes the name of the field in which the Ginjector interface implementation is stored. |
java.lang.String |
getGinjectorInterfaceGetterMethodName()
Computes the name of the method used to retrieve the Ginjector interface implementation. |
java.lang.String |
getMemberInjectMethodName(TypeLiteral<?> type)
Returns the type's member inject method name. |
java.lang.String |
getSingletonFieldName(Key<?> key)
Returns the key's singleton field name. |
void |
markAsUsed(java.lang.String name)
Reserves the given name to prevent new methods to be created with it. |
static java.lang.String |
replaceLast(java.lang.String source,
char toReplace,
char with)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NameGenerator()
Method Detail |
---|
public java.lang.String getAssistedInjectMethodName(Key<?> factoryKey, java.lang.String methodName)
public java.lang.String getChildInjectorGetterMethodName(java.lang.String childInjectorClassName)
public java.lang.String getFragmentGetterMethodName(FragmentPackageName fragmentPackageName)
public java.lang.String getGetterMethodName(Key<?> key)
public java.lang.String getFragmentClassName(java.lang.String injectorClassName, FragmentPackageName fragmentPackageName)
injectorClassName
- the simple name of the injector's class (not
including its package)public java.lang.String getFragmentCanonicalClassName(java.lang.String injectorClassName, FragmentPackageName fragmentPackageName)
public java.lang.String getFragmentFieldName(FragmentPackageName fragmentPackageName)
public java.lang.String getGinjectorInterfaceFieldName()
public java.lang.String getGinjectorInterfaceGetterMethodName()
public java.lang.String getMemberInjectMethodName(TypeLiteral<?> type)
public java.lang.String getSingletonFieldName(Key<?> key)
public java.lang.String createMethodName(java.lang.String base)
base
.
Note: Method names are considered "used" after being returned by this
method, whether they're actually used to write a new method or not.
base
- base on which method name gets created
public void markAsUsed(java.lang.String name) throws java.lang.IllegalArgumentException
name
- name to be reserved
java.lang.IllegalArgumentException
public java.lang.String convertToValidMemberName(java.lang.String name)
public static java.lang.String replaceLast(java.lang.String source, char toReplace, char with)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |