org.yaoqiang.bpmn.model.elementsCategoryValue Maven / Gradle / Ivy
package org.yaoqiang.bpmn.model.elements.artifacts;
import java.util.ArrayList;
import java.util.List;
import org.yaoqiang.bpmn.model.BPMNModelUtils;
import org.yaoqiang.bpmn.model.elements.XMLAttribute;
import org.yaoqiang.bpmn.model.elements.XMLElement;
import org.yaoqiang.bpmn.model.elements.core.foundation.BaseElement;
/**
* CategoryValue
*
* @author Shi Yaoqiang([email protected])
*/
public class CategoryValue extends BaseElement {
private static final long serialVersionUID = -165137552363414885L;
List categorizedFlowElements = new ArrayList();
public CategoryValue(CategoryValues parent) {
super(parent, "categoryValue");
}
protected void fillStructure() {
XMLAttribute attrValue = new XMLAttribute(this, "value");
super.fillStructure();
add(attrValue);
}
public CategoryValues getParent() {
return (CategoryValues) parent;
}
public final String getValue() {
return get("value").toValue();
}
public final void setValue(String value) {
set("value", value);
}
public List getCategorizedFlowElements() {
return getCategorizedFlowElements(true);
}
public List getCategorizedFlowElements(boolean refresh) {
if (refresh) {
categorizedFlowElements.clear();
categorizedFlowElements.addAll(BPMNModelUtils.getCategorizedFlowElements(this));
}
return categorizedFlowElements;
}
public final void setCategorizedFlowElements(List flowElements) {
categorizedFlowElements.clear();
categorizedFlowElements.addAll(flowElements);
}
public String toString() {
Category category = getParent().getParent();
if (category.getName().length() == 0) {
return getValue();
} else {
return category.getName() + ":" + getValue();
}
}
}