Project

General

Profile

Revision 4c4eace6

ID4c4eace63e8c67047df0e4d1262dcafdb6670d03
Parent 6348072d
Child 5d89c869

Added by Andreas Kohlbecker 2 months ago

ref #9134 documenting SearchReplace

View differences:

cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/media/MediaUriTransformation.java
13 13
 * A {@link SearchReplace} rule can be mediate an identity transformation of is URI part
14 14
 * in which case the rule just acts as a filter.
15 15
 *
16
 * <p>
17
 * <b>CHANGING THIS CLASS MAY BREAK DESERIALIZATION OF EXISTING CDM PREFERENCES</b>
18
 *
16 19
 * @author a.kohlbecker
17 20
 * @since Jul 8, 2020
18 21
 */
cdmlib-services/src/main/java/eu/etaxonomy/cdm/api/service/media/SearchReplace.java
10 10

  
11 11
import java.util.regex.Pattern;
12 12

  
13
/**
14
 * Defines a search and replace operation for the
15
 * {@link MediaUriTransformation}. The search pattern is a regular expression.
16
 * Internally the search regex is compiled into a caches regex pattern when it
17
 * is requested by calling # {@link #searchPattern}.
18
 * <p>
19
 * <b>CHANGING THIS CLASS MAY BREAK DESERIALIZATION OF EXISTING CDM PREFERENCES.</b>
20
 *
21
 * @author a.kohlbecker
22
 * @since Aug 19, 2020
23
 */
13 24
public class SearchReplace {
14 25

  
15 26
    private String replace;
......
19 30
    public SearchReplace() {
20 31
    }
21 32

  
33
    /**
34
     * @param search
35
     *            the regular expressions to used as search pattern
36
     * @param replace
37
     *            The replacement string
38
     */
22 39
    public SearchReplace(String search, String replace) {
23 40
        this.search = search;
24 41
        this.replace = replace;
25 42
    }
26 43

  
44
    /**
45
     * Get the regular expressions used as search pattern
46
     */
27 47
    public String getSearch() {
28 48
        return search;
29 49
    }
30 50

  
51
    /**
52
     *
53
     * @return The replacement string
54
     */
31 55
    public String getReplace() {
32 56
        return replace;
33 57
    }

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)