-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make componentElement available in keyFactory (#56)
- Loading branch information
1 parent
5b87943
commit 8fc97ab
Showing
13 changed files
with
314 additions
and
255 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
compiler/src/main/java/io/jbock/simple/processor/binding/InjectBindingCache.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package io.jbock.simple.processor.binding; | ||
|
||
import io.jbock.simple.Inject; | ||
import io.jbock.simple.processor.util.ClearableCache; | ||
|
||
import javax.lang.model.element.TypeElement; | ||
import java.util.HashMap; | ||
import java.util.Map; | ||
import java.util.function.Function; | ||
|
||
public class InjectBindingCache implements ClearableCache { | ||
|
||
private final Map<TypeElement, Map<Key, InjectBinding>> injectBindingCache = new HashMap<>(); | ||
|
||
@Inject | ||
public InjectBindingCache() { | ||
} | ||
|
||
Map<Key, InjectBinding> computeIfAbsent( | ||
TypeElement typeElement, | ||
Function<TypeElement, Map<Key, InjectBinding>> f) { | ||
return injectBindingCache.computeIfAbsent(typeElement, f); | ||
} | ||
|
||
|
||
@Override | ||
public void clearCache() { | ||
injectBindingCache.clear(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.