-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#1213 Merge branch 'dev_core' into master
- Loading branch information
Showing
32 changed files
with
628 additions
and
272 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
35 changes: 35 additions & 0 deletions
35
...-parent/cobigen-core-api/src/main/java/com/devonfw/cobigen/api/annotation/Activation.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,35 @@ | ||
package com.devonfw.cobigen.api.annotation; | ||
|
||
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; | ||
|
||
/** | ||
* Annotation allowing activation criteria for a plug-in | ||
*/ | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@Target({ ElementType.TYPE }) | ||
@Inherited | ||
public @interface Activation { | ||
|
||
/** | ||
* @return the file extensions for which the plug-in should be activated respectively for which the | ||
* plug-in provides an input reader. The file extension should be noted by the extension only | ||
* without dot or asterix, i.e. { 'html', 'xhtml' } | ||
*/ | ||
String[] byFileExtension() default {}; | ||
|
||
/** | ||
* @return whether this plug-in can read a folder as input. | ||
*/ | ||
boolean byFolder() default false; | ||
|
||
/** | ||
* @return the merge strategies provided by this plug-in, which will cause the plug-in lazily to be loaded | ||
* just in case a merge strategy is requested which is provided by this plug-in | ||
*/ | ||
String[] byMergeStrategy() default {}; | ||
|
||
} |
19 changes: 19 additions & 0 deletions
19
...n-core-parent/cobigen-core-api/src/main/java/com/devonfw/cobigen/api/annotation/Name.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,19 @@ | ||
package com.devonfw.cobigen.api.annotation; | ||
|
||
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; | ||
|
||
/** | ||
* Name of an extension | ||
*/ | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@Target({ ElementType.TYPE }) | ||
@Inherited | ||
public @interface Name { | ||
|
||
/** Name of the plug-in */ | ||
String value(); | ||
} |
23 changes: 23 additions & 0 deletions
23
...ent/cobigen-core-api/src/main/java/com/devonfw/cobigen/api/annotation/ReaderPriority.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,23 @@ | ||
package com.devonfw.cobigen.api.annotation; | ||
|
||
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; | ||
|
||
import com.devonfw.cobigen.api.extension.Priority; | ||
import com.devonfw.cobigen.api.extension.TriggerInterpreter; | ||
|
||
/** | ||
* The priority to take into account when try reading an input. This annotation is meant to be set on | ||
* {@link TriggerInterpreter} classes | ||
*/ | ||
@Retention(RetentionPolicy.RUNTIME) | ||
@Target({ ElementType.TYPE }) | ||
@Inherited | ||
public @interface ReaderPriority { | ||
|
||
/** The input readers priority */ | ||
Priority value() default Priority.LOW; | ||
} |
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
36 changes: 36 additions & 0 deletions
36
...ore-parent/cobigen-core-api/src/main/java/com/devonfw/cobigen/api/extension/Priority.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,36 @@ | ||
package com.devonfw.cobigen.api.extension; | ||
|
||
/** | ||
* Priorities an input reader is ranked with in case | ||
* {@link InputReader#isMostLikelyReadable(java.nio.file.Path)} is returning true for multiple plug-ins | ||
* available. | ||
*/ | ||
public enum Priority { | ||
|
||
/** Standard devonfw plug-ins + meta-language readers (i.e. XML) */ | ||
LOW((byte) 3), | ||
|
||
/** For example language specific readers like specific XML languages */ | ||
MEDIUM((byte) 2), | ||
|
||
/** Highest priority for custom use cases */ | ||
HIGH((byte) 1); | ||
|
||
/** The rank */ | ||
private byte rank; | ||
|
||
/** | ||
* @param rank | ||
* the rank | ||
*/ | ||
private Priority(byte rank) { | ||
this.rank = rank; | ||
} | ||
|
||
/** | ||
* @return the rank for sorting the priorities | ||
*/ | ||
public byte getRank() { | ||
return rank; | ||
} | ||
} |
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.