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

cn.sylinx.hbatis.ext.ifblock.IF Maven / Gradle / Ivy

There is a newer version: 2.0.0.RELEASE
Show newest version
package cn.sylinx.hbatis.ext.ifblock;

import java.util.ArrayList;
import java.util.List;

public class IF implements PreNode {

	private int index;

	private int nextIndex;

	private String condition;

	private List ifEndBlockList = new ArrayList();;

	private String contentPattern;

	/**
	 * ELSIF or ELSE
	 */
	private FollowNode followNode;

	public String getNodeName() {
		return "#IF";
	}
	
	public String toString() {
		StringBuilder sb = new StringBuilder();
		sb.append("{");
		sb.append("IF NODE(");
		sb.append("index:").append(index).append(",");
		sb.append("nextIndex:").append(nextIndex).append(",");
		sb.append("condition:").append(condition).append(",");
		sb.append("contentPattern:").append(contentPattern).append(",");
		sb.append("followNode:").append(followNode).append(",");
		sb.append("ifEndBlockList:").append("[");
		for (IfEndBlock item : ifEndBlockList) {
			sb.append(item.toString()).append(",");
		}
		sb.append("]");
		sb.append(")");
		sb.append("}");

		return sb.toString();
	}

	public List getIfEndBlockList() {
		return ifEndBlockList;
	}

	public int getNextIndex() {
		return nextIndex;
	}

	public void setNextIndex(int nextIndex) {
		this.nextIndex = nextIndex;
	}

	public int getIndex() {
		return index;
	}

	public void setIndex(int index) {
		this.index = index;
	}

	public void addIfEndBlock(IfEndBlock ifEndBlock) {
		ifEndBlockList.add(ifEndBlock);
	}

	public String getCondition() {
		return condition;
	}

	public void setCondition(String condition) {
		this.condition = condition;
	}

	public String getContentPattern() {
		return contentPattern;
	}

	public void setContentPattern(String contentPattern) {
		this.contentPattern = contentPattern;
	}

	public FollowNode getFollowNode() {
		return followNode;
	}

	public void setFollowNode(FollowNode followNode) {
		this.followNode = followNode;
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy