Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add factories annotations instead of getPriority() and getName()
- Loading branch information
Showing
14 changed files
with
126 additions
and
157 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
16 changes: 0 additions & 16 deletions
16
fluentlenium-core/src/main/java/org/fluentlenium/configuration/AlternativeNames.java
This file was deleted.
Oops, something went wrong.
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
20 changes: 6 additions & 14 deletions
20
fluentlenium-core/src/main/java/org/fluentlenium/configuration/Factory.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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,19 +1,11 @@ | |||
package org.fluentlenium.configuration; | package org.fluentlenium.configuration; | ||
|
|
||
/** | |||
* Marker interface for factories. | |||
* | |||
* @see FactoryPriority | |||
* @see FactoryName | |||
*/ | |||
public interface Factory { | public interface Factory { | ||
/** | |||
* Primary name of this factory. | |||
* <p> | |||
* To register it with alternative name, use {@link AlternativeNames}. | |||
* | |||
* @return Primary name | |||
*/ | |||
String getName(); | |||
|
|
||
/** | |||
* Priority of the factory to be grabbed as default Factory. | |||
* | |||
* @return a priority index | |||
*/ | |||
int getPriority(); | |||
} | } |
17 changes: 17 additions & 0 deletions
17
fluentlenium-core/src/main/java/org/fluentlenium/configuration/FactoryName.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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,17 @@ | |||
package org.fluentlenium.configuration; | |||
|
|||
import java.lang.annotation.ElementType; | |||
import java.lang.annotation.Inherited; | |||
import java.lang.annotation.Retention; | |||
import java.lang.annotation.RetentionPolicy; | |||
import java.lang.annotation.Target; | |||
|
|||
/** | |||
* Define names for a factory | |||
*/ | |||
@Target(ElementType.TYPE) | |||
@Retention(RetentionPolicy.RUNTIME) | |||
@Inherited | |||
public @interface FactoryName { | |||
String value(); | |||
} |
15 changes: 15 additions & 0 deletions
15
fluentlenium-core/src/main/java/org/fluentlenium/configuration/FactoryNames.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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,15 @@ | |||
package org.fluentlenium.configuration; | |||
|
|||
/** | |||
* Add names to a factory. | |||
* <p> | |||
* {@link Factory} implementations can implement this interface to be registered in registry with those names. | |||
*/ | |||
public interface FactoryNames { | |||
/** | |||
* Get the names. | |||
* | |||
* @return array of names | |||
*/ | |||
String[] getNames(); | |||
} |
18 changes: 18 additions & 0 deletions
18
fluentlenium-core/src/main/java/org/fluentlenium/configuration/FactoryPriority.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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,18 @@ | |||
package org.fluentlenium.configuration; | |||
|
|||
import java.lang.annotation.ElementType; | |||
import java.lang.annotation.Inherited; | |||
import java.lang.annotation.Retention; | |||
import java.lang.annotation.RetentionPolicy; | |||
import java.lang.annotation.Target; | |||
|
|||
|
|||
/** | |||
* Defines the priority of the factory. | |||
*/ | |||
@Target(ElementType.TYPE) | |||
@Retention(RetentionPolicy.RUNTIME) | |||
@Inherited | |||
public @interface FactoryPriority { | |||
int value(); | |||
} |
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.