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

net.anotheria.anodoc.query2.string.StringMatchingInfo Maven / Gradle / Ivy

package net.anotheria.anodoc.query2.string;

import net.anotheria.anodoc.query2.MatchingInfo;
import net.anotheria.util.CharacterEntityCoder;

public class StringMatchingInfo implements MatchingInfo{
	/**
	 * Part of the string prior to the matched part.
	 */
	private String pre;
	/**
	 * Part of the string past matched part.
	 */
	private String post;
	/**
	 * Matched part.
	 */
	private String match;
	/**
	 * Creates a new StringMatchingInfo.
	 */
	public StringMatchingInfo(){
		
	}
	
	/**
	 * Creates a new StringMatchingInfo.
	 */
	public StringMatchingInfo(String aPre, String aMatch, String aPost){
		pre = aPre;
		match = aMatch;
		post = aPost;
	}
	
	public String getMatch() {
		return match;
	}



	public void setMatch(String match) {
		this.match = match;
	}



	public String getPost() {
		return post;
	}



	public void setPost(String post) {
		this.post = post;
	}



	public String getPre() {
		return pre;
	}



	public void setPre(String pre) {
		this.pre = pre;
	}



	@Override public String toHtml(){
		String ret = "";
		ret += ""+CharacterEntityCoder.htmlEncodeString(pre)+"";
		ret += ""+CharacterEntityCoder.htmlEncodeString(match)+"";
		ret += ""+CharacterEntityCoder.htmlEncodeString(post)+"";
		return ret;
	}
	
	@Override public String toString(){
		return toHtml();
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy