org.clawiz.ui.common.metadata.data.view.grid.column.LocalGridColumnPrototype Maven / Gradle / Ivy
The newest version!
package org.clawiz.ui.common.metadata.data.view.grid.column;
import org.clawiz.core.common.system.exchange.annotation.ExchangeElement;
import java.lang.SuppressWarnings;
import org.clawiz.core.common.system.session.Session;
import org.clawiz.core.common.metadata.node.MetadataNodeReferencesList;
public class LocalGridColumnPrototype extends org.clawiz.ui.common.metadata.data.view.grid.column.AbstractGridColumn {
@ExchangeElement
private org.clawiz.core.common.metadata.data.common.valuetype.AbstractValueType valueType;
public LocalGridColumn withName(String value) {
setName(value);
return (LocalGridColumn) this;
}
public org.clawiz.core.common.metadata.data.common.valuetype.AbstractValueType getValueType() {
return this.valueType;
}
public void setValueType(org.clawiz.core.common.metadata.data.common.valuetype.AbstractValueType value) {
this.valueType = value;
}
public LocalGridColumn withValueType(org.clawiz.core.common.metadata.data.common.valuetype.AbstractValueType value) {
setValueType(value);
return (LocalGridColumn) this;
}
public T createValueType(Class nodeClass) {
if ( getValueType() != null ) {
throwException("Cannot create already defined value of '?' for '?'", "valueType", this.getFullName());
}
org.clawiz.core.common.metadata.data.common.valuetype.AbstractValueType value = createChildNode(nodeClass, "valueType");
setValueType(value);
return (T) value;
}
public org.clawiz.core.common.metadata.data.common.valuetype.AbstractValueType createValueType() {
return createValueType(org.clawiz.core.common.metadata.data.common.valuetype.AbstractValueType.class);
}
@SuppressWarnings("Duplicates")
public void prepare(Session session) {
super.prepare(session);
if ( isInPrepare() ) { return; }
setInPrepare(true);
if ( getValueType() != null ) {
getValueType().prepare(session);
}
setInPrepare(false);
}
public void fillReferences(MetadataNodeReferencesList references) {
super.fillReferences(references);
references.add(getValueType());
}
}