Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HSEARCH-3438 Uniform marker mapping reference annotation
- Loading branch information
Showing
9 changed files
with
71 additions
and
52 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
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
37 changes: 0 additions & 37 deletions
37
...va/org/hibernate/search/mapper/pojo/bridge/declaration/MarkerMappingBuilderReference.java
This file was deleted.
Oops, something went wrong.
50 changes: 50 additions & 0 deletions
50
...o/src/main/java/org/hibernate/search/mapper/pojo/bridge/declaration/MarkerMappingRef.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,50 @@ | ||
/* | ||
* Hibernate Search, full-text search for your domain model | ||
* | ||
* License: GNU Lesser General Public License (LGPL), version 2.1 or later | ||
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>. | ||
*/ | ||
package org.hibernate.search.mapper.pojo.bridge.declaration; | ||
|
||
import java.lang.annotation.Annotation; | ||
import java.lang.annotation.Documented; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
import org.hibernate.search.mapper.pojo.bridge.mapping.AnnotationMarkerBuilder; | ||
import org.hibernate.search.mapper.pojo.bridge.mapping.MarkerBuilder; | ||
|
||
/** | ||
* Reference a marker mapping builder in a {@link MarkerMapping}. | ||
* <p> | ||
* Reference can be obtained using either a name or a type. | ||
* <p> | ||
* Each time the mapped annotation is encountered, an instance of the marker mapping builder will be created. | ||
* The builder will be passed the annotation through its {@link AnnotationMarkerBuilder#initialize(Annotation)} method, | ||
* and then the marker will be retrieved by calling {@link MarkerBuilder#build(org.hibernate.search.mapper.pojo.bridge.mapping.MarkerBuildContext)}. | ||
* <p> | ||
* Marker mapped this way can be parameterized: | ||
* the marker mapping will be able to take any attribute of the mapped annotation into account | ||
* in its {@link AnnotationMarkerBuilder#initialize(Annotation)} method. | ||
* | ||
* @author Yoann Rodiere | ||
*/ | ||
@Documented | ||
@Target({}) // Only used as a component in other annotations | ||
@Retention(RetentionPolicy.RUNTIME) | ||
public @interface MarkerMappingRef { | ||
|
||
String builderName() default ""; | ||
|
||
Class<? extends AnnotationMarkerBuilder<?>> builderType() default UndefinedBuilderImplementationType.class; | ||
|
||
/** | ||
* Class used as a marker for the default value of the {@link #builderType()} attribute. | ||
*/ | ||
abstract class UndefinedBuilderImplementationType implements AnnotationMarkerBuilder<Annotation> { | ||
private UndefinedBuilderImplementationType() { | ||
} | ||
} | ||
} | ||
|
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