1 /* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * See LICENSE.txt included in this distribution for the specific 9 * language governing permissions and limitations under the License. 10 * 11 * When distributing Covered Code, include this CDDL HEADER in each 12 * file and include the License file at LICENSE.txt. 13 * If applicable, add the following below this CDDL HEADER, with the 14 * fields enclosed by brackets "[]" replaced with your own identifying 15 * information: Portions Copyright [yyyy] [name of copyright owner] 16 * 17 * CDDL HEADER END 18 */ 19 20 /* 21 * Copyright (c) 2017, 2020, Chris Fraire <cfraire@me.com>. 22 */ 23 package org.opengrok.indexer.analysis; 24 25 /** 26 * Represents an event raised when a symbol matcher matches a path-like string 27 * that would not be published as a symbol. 28 */ 29 public class PathlikeMatchedEvent { 30 31 private final Object source; 32 private final String str; 33 private final char sep; 34 private final boolean canonicalize; 35 private final long start; 36 private final long end; 37 38 /** 39 * Initializes an immutable instance of {@link PathlikeMatchedEvent}. 40 * @param source the event source 41 * @param str the path text string 42 * @param sep the path separator 43 * @param canonicalize a value indicating whether the path should be 44 * canonicalized 45 * @param start the text start position 46 * @param end the text end position 47 */ PathlikeMatchedEvent(Object source, String str, char sep, boolean canonicalize, long start, long end)48 public PathlikeMatchedEvent(Object source, String str, char sep, 49 boolean canonicalize, long start, long end) { 50 this.source = source; 51 this.str = str; 52 this.sep = sep; 53 this.canonicalize = canonicalize; 54 this.start = start; 55 this.end = end; 56 } 57 58 /** 59 * Gets the event source. 60 * @return the initial value 61 */ getSource()62 public Object getSource() { 63 return source; 64 } 65 66 /** 67 * Gets the path text string. 68 * @return the initial value 69 */ getStr()70 public String getStr() { 71 return str; 72 } 73 74 /** 75 * Gets the text start position. 76 * @return the initial value 77 */ getStart()78 public long getStart() { 79 return start; 80 } 81 82 /** 83 * Gets the text end position. 84 * @return the initial value 85 */ getEnd()86 public long getEnd() { 87 return end; 88 } 89 90 /** 91 * Gets the path separator. 92 * @return the initial value 93 */ getSep()94 public char getSep() { 95 return sep; 96 } 97 98 /** 99 * Gets a value indicating whether the path should be canonicalized. 100 * @return the initial value 101 */ getCanonicalize()102 public boolean getCanonicalize() { 103 return canonicalize; 104 } 105 } 106