All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.altova.text.flex.SplitAtDelimiterLineBasedMultiple Maven / Gradle / Ivy

////////////////////////////////////////////////////////////////////////
//
// SplitAtDelimiterLineBasedMultiple.java
//
// This file was generated by MapForce 2017sp2.
//
// YOU SHOULD NOT MODIFY THIS FILE, BECAUSE IT WILL BE
// OVERWRITTEN WHEN YOU RE-RUN CODE GENERATION.
//
// Refer to the MapForce Documentation for further details.
// http://www.altova.com/mapforce
//
////////////////////////////////////////////////////////////////////////

package com.altova.text.flex;

public class SplitAtDelimiterLineBasedMultiple extends SplitAtDelimiterLineBased {
	public SplitAtDelimiterLineBasedMultiple(String delimiter) {
		super(delimiter, false);
	}
	
	public Range split(Range range) {
		SplitLines splitAtFirstLine = new SplitLines(1);
		boolean firstLine = true;
		Range result = new Range(range);
		while (true)
		{
			Range line = splitAtFirstLine.split(range);
			if (!line.isValid())
			{
				result.end = line.start;
				break;
			}
			if (line.toString().indexOf(delimiter) >= 0)
			{
				if (!firstLine)
				{
					result.end = line.start;
					break;
				}
			}
			firstLine = false;
		}
		range.start = result.end;
		return result;
	}
	
	public void appendDelimiter(Appender output) {}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy