![JAR search and dependency download from the Maven repository](/logo.png)
panda.tool.codegen.bean.InputField Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of panda-tool Show documentation
Show all versions of panda-tool Show documentation
Panda Tool contains some commonly used tools and source code generator for Panda Mvc. Can generate Entity/Query/Dao/Action class, Freemarker (HTML) template file.
package panda.tool.codegen.bean;
import java.util.LinkedList;
import java.util.List;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
/**
*
* Java class for InputField complex type.
*
* The following schema fragment specifies the expected content contained within this class.
*
*
* <complexType name="InputField">
* <complexContent>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="header" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="1" minOccurs="0"/>
* <element name="content" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="1" minOccurs="0"/>
* <element name="editTag" type="{panda.tool.codegen}Tag" minOccurs="0"/>
* <element name="viewTag" type="{panda.tool.codegen}Tag" minOccurs="0"/>
* <element name="footer" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="1" minOccurs="0"/>
* <element name="validator" type="{panda.tool.codegen}Validator" maxOccurs="unbounded" minOccurs="0"/>
* </sequence>
* <attribute name="display" default="true" type="{http://www.w3.org/2001/XMLSchema}boolean" />
* <attribute name="tooltip" type="{http://www.w3.org/2001/XMLSchema}string" />
* <attribute name="label" type="{http://www.w3.org/2001/XMLSchema}string" />
* <attribute name="actionField" default="true" type="{http://www.w3.org/2001/XMLSchema}boolean" />
* <attribute name="required" type="{http://www.w3.org/2001/XMLSchema}boolean" />
* <attribute name="requiredrefer" type="{http://www.w3.org/2001/XMLSchema}boolean" />
* <attribute name="requiredvalidate" type="{http://www.w3.org/2001/XMLSchema}boolean" />
* <attribute name="order" type="{http://www.w3.org/2001/XMLSchema}int" />
* <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
* </restriction>
* </complexContent>
* </complexType>
*
*/
@XmlAccessorType(XmlAccessType.NONE)
@XmlType(name = "InputField")
public class InputField implements Comparable {
@XmlElement
private String header;
@XmlElement
private String content;
@XmlElement
private Tag editTag;
@XmlElement
private Tag viewTag;
@XmlElement
private String footer;
@XmlElement(name = "validator")
private List validatorList;
@XmlAttribute
private Boolean display;
@XmlAttribute
private String tooltip;
@XmlAttribute
private String label;
@XmlAttribute
private Boolean actionField = false;
@XmlAttribute
private Boolean required;
@XmlAttribute
private String requiredrefer;
@XmlAttribute
private Boolean requiredvalidate = true;
@XmlAttribute
private Integer order;
@XmlAttribute(required = true)
private String name;
/**
* Constructor
*/
public InputField() {
}
/**
* Constructor - copy properties from source
*
* @param ifd source input field
*/
public InputField(InputField ifd) {
this.header = ifd.header;
this.footer = ifd.footer;
this.content = ifd.content;
this.display = ifd.display;
this.tooltip = ifd.tooltip;
this.label = ifd.label;
this.actionField = ifd.actionField;
this.required = ifd.required;
this.requiredrefer = ifd.requiredrefer;
this.requiredvalidate = ifd.requiredvalidate;
this.order = ifd.order;
this.name = ifd.name;
this.content = ifd.content;
if (ifd.editTag != null) {
this.editTag = new Tag(ifd.editTag);
}
if (ifd.viewTag != null) {
this.viewTag = new Tag(ifd.viewTag);
}
validatorList = new LinkedList();
for (Validator v : ifd.getValidatorList()) {
validatorList.add(new Validator(v));
}
}
/**
* extend input field
*
* @param src source input field
* @param parent extend input field
* @return input field
*/
public static InputField extend(InputField src, InputField parent) {
InputField me = new InputField(parent);
if (src.header != null) {
me.header = src.header;
}
if (src.footer != null) {
me.footer = src.footer;
}
if (src.content != null) {
me.content = src.content;
}
if (src.display != null) {
me.display = src.display;
}
if (src.tooltip != null) {
me.tooltip = src.tooltip;
}
if (src.label != null) {
me.label = src.label;
}
if (src.actionField != null) {
me.actionField = src.actionField;
}
if (src.required != null) {
me.required = src.required;
}
if (src.requiredrefer != null) {
me.requiredrefer = src.requiredrefer;
}
if (src.requiredvalidate != null) {
me.requiredvalidate = src.requiredvalidate;
}
if (src.order != null) {
me.order = src.order;
}
if (src.name != null) {
me.name = src.name;
}
if (src.content != null) {
me.content = src.content;
}
if (src.editTag != null) {
me.editTag = new Tag(src.editTag);
}
if (src.viewTag != null) {
me.viewTag = new Tag(src.viewTag);
}
me.getValidatorList().addAll(src.getValidatorList());
return me;
}
/**
* @return the header
*/
public String getHeader() {
return header;
}
/**
* @param header the header to set
*/
public void setHeader(String header) {
this.header = header;
}
/**
* @return the footer
*/
public String getFooter() {
return footer;
}
/**
* @param footer the footer to set
*/
public void setFooter(String footer) {
this.footer = footer;
}
/**
* @return the content
*/
public String getContent() {
return content;
}
/**
* @param content the content to set
*/
public void setContent(String content) {
this.content = content;
}
/**
* @return the editTag
*/
public Tag getEditTag() {
return editTag;
}
/**
* @param editTag the editTag to set
*/
public void setEditTag(Tag editTag) {
this.editTag = editTag;
}
/**
* @return the viewTag
*/
public Tag getViewTag() {
return viewTag;
}
/**
* @param viewTag the viewTag to set
*/
public void setViewTag(Tag viewTag) {
this.viewTag = viewTag;
}
/**
* @return the validatorList
*/
public List getValidatorList() {
if (validatorList == null) {
validatorList = new LinkedList();
}
return this.validatorList;
}
/**
* @return the display
*/
public Boolean getDisplay() {
return display;
}
/**
* @param display the display to set
*/
public void setDisplay(Boolean display) {
this.display = display;
}
/**
* @return the tooltip
*/
public String getTooltip() {
return tooltip;
}
/**
* @param tooltip the tooltip to set
*/
public void setTooltip(String tooltip) {
this.tooltip = tooltip;
}
/**
* @return the label
*/
public String getLabel() {
return label;
}
/**
* @param label the label to set
*/
public void setLabel(String label) {
this.label = label;
}
/**
* @return the actionField
*/
public Boolean getActionField() {
return actionField;
}
/**
* @param actionField the actionField to set
*/
public void setActionField(Boolean actionField) {
this.actionField = actionField;
}
/**
* @return the required
*/
public Boolean getRequired() {
return required;
}
/**
* @param required the required to set
*/
public void setRequired(Boolean required) {
this.required = required;
}
/**
* @return the requiredrefer
*/
public String getRequiredrefer() {
return requiredrefer;
}
/**
* @param requiredrefer the requiredrefer to set
*/
public void setRequiredrefer(String requiredrefer) {
this.requiredrefer = requiredrefer;
}
/**
* @return the requiredvalidate
*/
public Boolean getRequiredvalidate() {
return requiredvalidate;
}
/**
* @param requiredvalidate the requiredvalidate to set
*/
public void setRequiredvalidate(Boolean requiredvalidate) {
this.requiredvalidate = requiredvalidate;
}
/**
* @return the order
*/
public Integer getOrder() {
return order;
}
/**
* @param order the order to set
*/
public void setOrder(Integer order) {
this.order = order;
}
/**
* @return the name
*/
public String getName() {
return name;
}
/**
* Gets the value of the uname property.
*
* @return possible object is {@link String }
*/
public String getUname() {
return EntityProperty.upname(name);
}
/**
* @param name the name to set
*/
public void setName(String name) {
this.name = name;
}
protected int compareByName(InputField o) {
int i = this.name.compareTo(o.name);
return i == 0 ? this.hashCode() - o.hashCode() : i;
}
/**
* @param o compare target
* @return -1/0/1
*/
public int compareTo(InputField o) {
if (this == o) {
return 0;
}
if (this.order == null && o.order == null) {
return compareByName(o);
}
if (this.order == null) {
return -1;
}
if (o.order == null) {
return 1;
}
int i = this.order.compareTo(o.order);
return i == 0 ? compareByName(o) : i;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy