net.anotheria.anodoc.query2.string.StringMatchingInfo Maven / Gradle / Ivy
The newest version!
package net.anotheria.anodoc.query2.string;
import net.anotheria.anodoc.query2.MatchingInfo;
import net.anotheria.util.CharacterEntityCoder;
/**
* StringMatchingInfo class.
*
* @author another
* @version $Id: $Id
*/
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.
*
* @param aPre a {@link java.lang.String} object.
* @param aMatch a {@link java.lang.String} object.
* @param aPost a {@link java.lang.String} object.
*/
public StringMatchingInfo(String aPre, String aMatch, String aPost){
pre = aPre;
match = aMatch;
post = aPost;
}
/**
* Getter for the field match
.
*
* @return a {@link java.lang.String} object.
*/
public String getMatch() {
return match;
}
/**
* Setter for the field match
.
*
* @param match a {@link java.lang.String} object.
*/
public void setMatch(String match) {
this.match = match;
}
/**
* Getter for the field post
.
*
* @return a {@link java.lang.String} object.
*/
public String getPost() {
return post;
}
/**
* Setter for the field post
.
*
* @param post a {@link java.lang.String} object.
*/
public void setPost(String post) {
this.post = post;
}
/**
* Getter for the field pre
.
*
* @return a {@link java.lang.String} object.
*/
public String getPre() {
return pre;
}
/**
* Setter for the field pre
.
*
* @param pre a {@link java.lang.String} object.
*/
public void setPre(String pre) {
this.pre = pre;
}
/** {@inheritDoc} */
@Override public String toHtml(){
String ret = "";
ret += ""+CharacterEntityCoder.htmlEncodeString(pre)+"";
ret += ""+CharacterEntityCoder.htmlEncodeString(match)+"";
ret += ""+CharacterEntityCoder.htmlEncodeString(post)+"";
return ret;
}
/** {@inheritDoc} */
@Override public String toString(){
return toHtml();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy