-
Notifications
You must be signed in to change notification settings - Fork 300
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add code unit parameter annotations to
JavaClassDependencies
Signed-off-by: Peter Gafert <peter.gafert@tngtech.com>
- Loading branch information
1 parent
273ba74
commit 98787a0
Showing
12 changed files
with
183 additions
and
20 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
...e-plain/src/main/java/com/tngtech/archunit/example/layers/controller/OtherController.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,9 @@ | ||
package com.tngtech.archunit.example.layers.controller; | ||
|
||
import com.tngtech.archunit.example.layers.controller.marshaller.StringUnmarshaller; | ||
|
||
@SuppressWarnings("unused") | ||
public class OtherController { | ||
void receive(@UnmarshalTransport(StringUnmarshaller.class) Object param) { | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...lain/src/main/java/com/tngtech/archunit/example/layers/controller/UnmarshalTransport.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,12 @@ | ||
package com.tngtech.archunit.example.layers.controller; | ||
|
||
import java.lang.annotation.Retention; | ||
|
||
import com.tngtech.archunit.example.layers.controller.marshaller.Unmarshaller; | ||
|
||
import static java.lang.annotation.RetentionPolicy.RUNTIME; | ||
|
||
@Retention(RUNTIME) | ||
public @interface UnmarshalTransport { | ||
Class<? extends Unmarshaller<?>>[] value(); | ||
} |
8 changes: 8 additions & 0 deletions
8
...main/java/com/tngtech/archunit/example/layers/controller/marshaller/ByteUnmarshaller.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,8 @@ | ||
package com.tngtech.archunit.example.layers.controller.marshaller; | ||
|
||
public class ByteUnmarshaller implements Unmarshaller<Byte> { | ||
@Override | ||
public <T> T unmarschal(Byte from) { | ||
return null; | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
...in/java/com/tngtech/archunit/example/layers/controller/marshaller/StringUnmarshaller.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,8 @@ | ||
package com.tngtech.archunit.example.layers.controller.marshaller; | ||
|
||
public class StringUnmarshaller implements Unmarshaller<String> { | ||
@Override | ||
public <T> T unmarschal(String from) { | ||
return null; | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
...src/main/java/com/tngtech/archunit/example/layers/controller/marshaller/Unmarshaller.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,6 @@ | ||
package com.tngtech.archunit.example.layers.controller.marshaller; | ||
|
||
public interface Unmarshaller<F> { | ||
@SuppressWarnings("unused") | ||
<T> T unmarschal(F from); | ||
} |
11 changes: 11 additions & 0 deletions
11
...ain/java/com/tngtech/archunit/example/layers/service/OtherServiceViolatingLayerRules.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,11 @@ | ||
package com.tngtech.archunit.example.layers.service; | ||
|
||
import com.tngtech.archunit.example.layers.controller.UnmarshalTransport; | ||
import com.tngtech.archunit.example.layers.controller.marshaller.ByteUnmarshaller; | ||
import com.tngtech.archunit.example.layers.controller.marshaller.StringUnmarshaller; | ||
|
||
public class OtherServiceViolatingLayerRules { | ||
@SuppressWarnings("unused") | ||
public void dependentOnParameterAnnotation(@UnmarshalTransport({StringUnmarshaller.class, ByteUnmarshaller.class}) Object param) { | ||
} | ||
} |
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
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
Oops, something went wrong.