-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#36 Separate injector into core and extras module
- Loading branch information
Showing
175 changed files
with
793 additions
and
169 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<parent> | ||
<groupId>ch.jalu</groupId> | ||
<artifactId>injector-parent</artifactId> | ||
<version>0.5-SNAPSHOT</version> | ||
</parent> | ||
<modelVersion>4.0.0</modelVersion> | ||
<artifactId>injector-extras</artifactId> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>ch.jalu</groupId> | ||
<artifactId>injector</artifactId> | ||
<version>0.5-SNAPSHOT</version> | ||
<scope>compile</scope> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.reflections</groupId> | ||
<artifactId>reflections</artifactId> | ||
<scope>compile</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.hamcrest</groupId> | ||
<artifactId>java-hamcrest</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
</project> |
2 changes: 1 addition & 1 deletion
2
...lu/injector/annotations/AllInstances.java → ...ch/jalu/injector/extras/AllInstances.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
2 changes: 1 addition & 1 deletion
2
...h/jalu/injector/annotations/AllTypes.java → ...ava/ch/jalu/injector/extras/AllTypes.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
5 changes: 3 additions & 2 deletions
5
...ndency/AllInstancesAnnotationHandler.java → ...ndlers/AllInstancesAnnotationHandler.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
5 changes: 3 additions & 2 deletions
5
...dependency/AllTypesAnnotationHandler.java → ...s/handlers/AllTypesAnnotationHandler.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
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
7 changes: 7 additions & 0 deletions
7
injector-extras/src/test/java/ch/jalu/injector/extras/samples/CinnamonService.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,7 @@ | ||
package ch.jalu.injector.extras.samples; | ||
|
||
/** | ||
* Cinnamon service. | ||
*/ | ||
public class CinnamonService implements SpiceService { | ||
} |
7 changes: 7 additions & 0 deletions
7
injector-extras/src/test/java/ch/jalu/injector/extras/samples/LilacService.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,7 @@ | ||
package ch.jalu.injector.extras.samples; | ||
|
||
/** | ||
* Lilac service. | ||
*/ | ||
public class LilacService { | ||
} |
7 changes: 7 additions & 0 deletions
7
injector-extras/src/test/java/ch/jalu/injector/extras/samples/PaprikaService.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,7 @@ | ||
package ch.jalu.injector.extras.samples; | ||
|
||
/** | ||
* Paprika service. | ||
*/ | ||
public class PaprikaService implements SpiceService { | ||
} |
7 changes: 7 additions & 0 deletions
7
injector-extras/src/test/java/ch/jalu/injector/extras/samples/SpiceService.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,7 @@ | ||
package ch.jalu.injector.extras.samples; | ||
|
||
/** | ||
* Dummy sample interface. | ||
*/ | ||
public interface SpiceService { | ||
} |
14 changes: 14 additions & 0 deletions
14
injector-extras/src/test/java/ch/jalu/injector/extras/samples/animals/Animal.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,14 @@ | ||
package ch.jalu.injector.extras.samples.animals; | ||
|
||
/** | ||
* Animal interface. | ||
*/ | ||
public interface Animal { | ||
|
||
String getName(); | ||
|
||
boolean canFly(); | ||
|
||
String makeSound(); | ||
|
||
} |
8 changes: 4 additions & 4 deletions
8
...jector/samples/animals/AnimalHandler.java → ...extras/samples/animals/AnimalHandler.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
4 changes: 2 additions & 2 deletions
4
...njector/samples/animals/AnimalLister.java → .../extras/samples/animals/AnimalLister.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
28 changes: 28 additions & 0 deletions
28
injector-extras/src/test/java/ch/jalu/injector/extras/samples/animals/Bird.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,28 @@ | ||
package ch.jalu.injector.extras.samples.animals; | ||
|
||
import ch.jalu.injector.extras.samples.animals.services.ChirpService; | ||
|
||
/** | ||
* Bird. | ||
*/ | ||
public abstract class Bird implements Animal { | ||
|
||
private ChirpService chirpService; | ||
|
||
public Bird(ChirpService chirpService) { | ||
this.chirpService = chirpService; | ||
} | ||
|
||
@Override | ||
public boolean canFly() { | ||
return true; | ||
} | ||
|
||
@Override | ||
public final String makeSound() { | ||
return chirpService.makeSound(); | ||
} | ||
|
||
public abstract long weightInGramms(); | ||
|
||
} |
26 changes: 26 additions & 0 deletions
26
injector-extras/src/test/java/ch/jalu/injector/extras/samples/animals/Chicken.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,26 @@ | ||
package ch.jalu.injector.extras.samples.animals; | ||
|
||
import ch.jalu.injector.extras.samples.animals.services.ChirpService; | ||
|
||
import javax.inject.Inject; | ||
|
||
/** | ||
* | ||
*/ | ||
public class Chicken extends Bird { | ||
|
||
@Inject | ||
Chicken(ChirpService chirpService) { | ||
super(chirpService); | ||
} | ||
|
||
@Override | ||
public long weightInGramms() { | ||
return 2400; | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return "Chicken"; | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
injector-extras/src/test/java/ch/jalu/injector/extras/samples/animals/Frog.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,31 @@ | ||
package ch.jalu.injector.extras.samples.animals; | ||
|
||
import ch.jalu.injector.extras.samples.animals.services.CroakService; | ||
import ch.jalu.injector.extras.samples.animals.services.NameService; | ||
|
||
import javax.inject.Inject; | ||
|
||
/** | ||
* Frog. | ||
*/ | ||
public class Frog implements Animal { | ||
|
||
@Inject | ||
private NameService nameService; | ||
@Inject | ||
private CroakService croakService; | ||
|
||
@Override | ||
public String getName() { | ||
return nameService.constructName(this); | ||
} | ||
|
||
@Override | ||
public boolean canFly() { | ||
return false; | ||
} | ||
|
||
public String makeSound() { | ||
return croakService.makeSound(); | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
injector-extras/src/test/java/ch/jalu/injector/extras/samples/animals/Lion.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,33 @@ | ||
package ch.jalu.injector.extras.samples.animals; | ||
|
||
import ch.jalu.injector.extras.samples.animals.services.NameService; | ||
import ch.jalu.injector.extras.samples.animals.services.RoarService; | ||
|
||
import javax.inject.Inject; | ||
|
||
/** | ||
* Lion class. | ||
*/ | ||
public class Lion implements Animal { | ||
|
||
@Inject | ||
private RoarService roarService; | ||
@Inject | ||
private NameService nameService; | ||
|
||
@Override | ||
public boolean canFly() { | ||
return false; | ||
} | ||
|
||
@Override | ||
public String makeSound() { | ||
return roarService.makeSound(); | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return nameService.constructName(this); | ||
} | ||
|
||
} |
Oops, something went wrong.