org.conqat.engine.commons.findings.location.ILineAdjuster Maven / Gradle / Ivy
package org.conqat.engine.commons.findings.location;
import java.util.Set;
import org.conqat.lib.commons.region.LineBasedRegion;
/** Adjustes the location of a single line. */
public interface ILineAdjuster {
/**
* Adjusts the location of a single line. This only respects the token part of a
* line, i.e. leading and trailing whitespace of a line will be ignored. This
* method is robust w.r.t lines numbers that are out of the range of the
* original text. In case of such an invalid line, the line is logged as error
* to the given logger and null
is returned.
*
* @param line
* the one-based line number of be adjusted.
* @param invalidLines
* used for collecting invalid lines.
*
* @return the one-based lines encoded as a region, as a line may map to
* multiple lines after changing. This may also return null, if no
* non-empty lines could be found that correspond to the input line
* after adjustment.
*/
LineBasedRegion adjustLine(int line, Set invalidLines);
/** Returns the line count of the original text */
int getOriginalLineCount();
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy