
io.ciera.tool.sql.architecture.expression.impl.CreationImpl Maven / Gradle / Ivy
package io.ciera.tool.sql.architecture.expression.impl;
import io.ciera.runtime.instanceloading.AttributeChangedDelta;
import io.ciera.runtime.instanceloading.InstanceCreatedDelta;
import io.ciera.runtime.summit.application.IRunContext;
import io.ciera.runtime.summit.classes.IInstanceIdentifier;
import io.ciera.runtime.summit.classes.InstanceIdentifier;
import io.ciera.runtime.summit.classes.ModelInstance;
import io.ciera.runtime.summit.exceptions.EmptyInstanceException;
import io.ciera.runtime.summit.exceptions.InstancePopulationException;
import io.ciera.runtime.summit.exceptions.XtumlException;
import io.ciera.runtime.summit.types.IWhere;
import io.ciera.runtime.summit.types.IXtumlType;
import io.ciera.runtime.summit.types.StringUtil;
import io.ciera.runtime.summit.types.UniqueId;
import io.ciera.tool.Sql;
import io.ciera.tool.sql.architecture.classes.ModelInst;
import io.ciera.tool.sql.architecture.classes.impl.ModelInstImpl;
import io.ciera.tool.sql.architecture.expression.Creation;
import io.ciera.tool.sql.architecture.expression.Expression;
import io.ciera.tool.sql.architecture.expression.impl.ExpressionImpl;
public class CreationImpl extends ModelInstance implements Creation {
public static final String KEY_LETTERS = "Creation";
public static final Creation EMPTY_CREATION = new EmptyCreation();
private Sql context;
// constructors
private CreationImpl( Sql context ) {
this.context = context;
ref_parent_name = "";
ref_parent_package = "";
ref_name = "";
ref_block_number = "";
ref_statement_number = "";
ref_expression_number = "";
ref_class_name = "";
ref_class_package = "";
ref_comp_name = "";
ref_comp_package = "";
R776_is_a_Expression_inst = ExpressionImpl.EMPTY_EXPRESSION;
R780_creates_ModelInst_inst = ModelInstImpl.EMPTY_MODELINST;
}
private CreationImpl( Sql context, UniqueId instanceId, String ref_parent_name, String ref_parent_package, String ref_name, String ref_block_number, String ref_statement_number, String ref_expression_number, String ref_class_name, String ref_class_package, String ref_comp_name, String ref_comp_package ) {
super(instanceId);
this.context = context;
this.ref_parent_name = ref_parent_name;
this.ref_parent_package = ref_parent_package;
this.ref_name = ref_name;
this.ref_block_number = ref_block_number;
this.ref_statement_number = ref_statement_number;
this.ref_expression_number = ref_expression_number;
this.ref_class_name = ref_class_name;
this.ref_class_package = ref_class_package;
this.ref_comp_name = ref_comp_name;
this.ref_comp_package = ref_comp_package;
R776_is_a_Expression_inst = ExpressionImpl.EMPTY_EXPRESSION;
R780_creates_ModelInst_inst = ModelInstImpl.EMPTY_MODELINST;
}
public static Creation create( Sql context ) throws XtumlException {
Creation newCreation = new CreationImpl( context );
if ( context.addInstance( newCreation ) ) {
newCreation.getRunContext().addChange(new InstanceCreatedDelta(newCreation, KEY_LETTERS));
return newCreation;
}
else throw new InstancePopulationException( "Instance already exists within this population." );
}
public static Creation create( Sql context, String ref_parent_name, String ref_parent_package, String ref_name, String ref_block_number, String ref_statement_number, String ref_expression_number, String ref_class_name, String ref_class_package, String ref_comp_name, String ref_comp_package ) throws XtumlException {
return create(context, UniqueId.random(), ref_parent_name, ref_parent_package, ref_name, ref_block_number, ref_statement_number, ref_expression_number, ref_class_name, ref_class_package, ref_comp_name, ref_comp_package);
}
public static Creation create( Sql context, UniqueId instanceId, String ref_parent_name, String ref_parent_package, String ref_name, String ref_block_number, String ref_statement_number, String ref_expression_number, String ref_class_name, String ref_class_package, String ref_comp_name, String ref_comp_package ) throws XtumlException {
Creation newCreation = new CreationImpl( context, instanceId, ref_parent_name, ref_parent_package, ref_name, ref_block_number, ref_statement_number, ref_expression_number, ref_class_name, ref_class_package, ref_comp_name, ref_comp_package );
if ( context.addInstance( newCreation ) ) {
return newCreation;
}
else throw new InstancePopulationException( "Instance already exists within this population." );
}
// attributes
private String ref_parent_name;
@Override
public void setParent_name(String ref_parent_name) throws XtumlException {
checkLiving();
if (StringUtil.inequality(ref_parent_name, this.ref_parent_name)) {
final String oldValue = this.ref_parent_name;
this.ref_parent_name = ref_parent_name;
getRunContext().addChange(new AttributeChangedDelta(this, KEY_LETTERS, "ref_parent_name", oldValue, this.ref_parent_name));
}
}
@Override
public String getParent_name() throws XtumlException {
checkLiving();
return ref_parent_name;
}
private String ref_parent_package;
@Override
public void setParent_package(String ref_parent_package) throws XtumlException {
checkLiving();
if (StringUtil.inequality(ref_parent_package, this.ref_parent_package)) {
final String oldValue = this.ref_parent_package;
this.ref_parent_package = ref_parent_package;
getRunContext().addChange(new AttributeChangedDelta(this, KEY_LETTERS, "ref_parent_package", oldValue, this.ref_parent_package));
}
}
@Override
public String getParent_package() throws XtumlException {
checkLiving();
return ref_parent_package;
}
private String ref_name;
@Override
public void setName(String ref_name) throws XtumlException {
checkLiving();
if (StringUtil.inequality(ref_name, this.ref_name)) {
final String oldValue = this.ref_name;
this.ref_name = ref_name;
getRunContext().addChange(new AttributeChangedDelta(this, KEY_LETTERS, "ref_name", oldValue, this.ref_name));
}
}
@Override
public String getName() throws XtumlException {
checkLiving();
return ref_name;
}
private String ref_block_number;
@Override
public void setBlock_number(String ref_block_number) throws XtumlException {
checkLiving();
if (StringUtil.inequality(ref_block_number, this.ref_block_number)) {
final String oldValue = this.ref_block_number;
this.ref_block_number = ref_block_number;
getRunContext().addChange(new AttributeChangedDelta(this, KEY_LETTERS, "ref_block_number", oldValue, this.ref_block_number));
}
}
@Override
public String getBlock_number() throws XtumlException {
checkLiving();
return ref_block_number;
}
private String ref_statement_number;
@Override
public String getStatement_number() throws XtumlException {
checkLiving();
return ref_statement_number;
}
@Override
public void setStatement_number(String ref_statement_number) throws XtumlException {
checkLiving();
if (StringUtil.inequality(ref_statement_number, this.ref_statement_number)) {
final String oldValue = this.ref_statement_number;
this.ref_statement_number = ref_statement_number;
getRunContext().addChange(new AttributeChangedDelta(this, KEY_LETTERS, "ref_statement_number", oldValue, this.ref_statement_number));
}
}
private String ref_expression_number;
@Override
public void setExpression_number(String ref_expression_number) throws XtumlException {
checkLiving();
if (StringUtil.inequality(ref_expression_number, this.ref_expression_number)) {
final String oldValue = this.ref_expression_number;
this.ref_expression_number = ref_expression_number;
getRunContext().addChange(new AttributeChangedDelta(this, KEY_LETTERS, "ref_expression_number", oldValue, this.ref_expression_number));
}
}
@Override
public String getExpression_number() throws XtumlException {
checkLiving();
return ref_expression_number;
}
private String ref_class_name;
@Override
public void setClass_name(String ref_class_name) throws XtumlException {
checkLiving();
if (StringUtil.inequality(ref_class_name, this.ref_class_name)) {
final String oldValue = this.ref_class_name;
this.ref_class_name = ref_class_name;
getRunContext().addChange(new AttributeChangedDelta(this, KEY_LETTERS, "ref_class_name", oldValue, this.ref_class_name));
}
}
@Override
public String getClass_name() throws XtumlException {
checkLiving();
return ref_class_name;
}
private String ref_class_package;
@Override
public String getClass_package() throws XtumlException {
checkLiving();
return ref_class_package;
}
@Override
public void setClass_package(String ref_class_package) throws XtumlException {
checkLiving();
if (StringUtil.inequality(ref_class_package, this.ref_class_package)) {
final String oldValue = this.ref_class_package;
this.ref_class_package = ref_class_package;
getRunContext().addChange(new AttributeChangedDelta(this, KEY_LETTERS, "ref_class_package", oldValue, this.ref_class_package));
}
}
private String ref_comp_name;
@Override
public String getComp_name() throws XtumlException {
checkLiving();
return ref_comp_name;
}
@Override
public void setComp_name(String ref_comp_name) throws XtumlException {
checkLiving();
if (StringUtil.inequality(ref_comp_name, this.ref_comp_name)) {
final String oldValue = this.ref_comp_name;
this.ref_comp_name = ref_comp_name;
getRunContext().addChange(new AttributeChangedDelta(this, KEY_LETTERS, "ref_comp_name", oldValue, this.ref_comp_name));
}
}
private String ref_comp_package;
@Override
public void setComp_package(String ref_comp_package) throws XtumlException {
checkLiving();
if (StringUtil.inequality(ref_comp_package, this.ref_comp_package)) {
final String oldValue = this.ref_comp_package;
this.ref_comp_package = ref_comp_package;
getRunContext().addChange(new AttributeChangedDelta(this, KEY_LETTERS, "ref_comp_package", oldValue, this.ref_comp_package));
}
}
@Override
public String getComp_package() throws XtumlException {
checkLiving();
return ref_comp_package;
}
// instance identifiers
@Override
public IInstanceIdentifier getId1() {
try {
return new InstanceIdentifier(getParent_name(), getParent_package(), getName(), getBlock_number(), getStatement_number(), getExpression_number());
}
catch ( XtumlException e ) {
getRunContext().getLog().error(e);
System.exit(1);
return null;
}
}
// operations
@Override
public void render() throws XtumlException {
context().T().include( "expression/t.creation.java", self() );
}
// static operations
// events
// selections
private Expression R776_is_a_Expression_inst;
@Override
public void setR776_is_a_Expression( Expression inst ) {
R776_is_a_Expression_inst = inst;
}
@Override
public Expression R776_is_a_Expression() throws XtumlException {
return R776_is_a_Expression_inst;
}
private ModelInst R780_creates_ModelInst_inst;
@Override
public void setR780_creates_ModelInst( ModelInst inst ) {
R780_creates_ModelInst_inst = inst;
}
@Override
public ModelInst R780_creates_ModelInst() throws XtumlException {
return R780_creates_ModelInst_inst;
}
@Override
public IRunContext getRunContext() {
return context().getRunContext();
}
@Override
public Sql context() {
return context;
}
@Override
public String getKeyLetters() {
return KEY_LETTERS;
}
@Override
public Creation self() {
return this;
}
@Override
public Creation oneWhere(IWhere condition) throws XtumlException {
if (null == condition) throw new XtumlException("Null condition passed to selection.");
if (condition.evaluate(this)) return this;
else return EMPTY_CREATION;
}
}
class EmptyCreation extends ModelInstance implements Creation {
// attributes
public void setParent_name( String ref_parent_name ) throws XtumlException {
throw new EmptyInstanceException( "Cannot set attribute of empty instance." );
}
public String getParent_name() throws XtumlException {
throw new EmptyInstanceException( "Cannot get attribute of empty instance." );
}
public void setParent_package( String ref_parent_package ) throws XtumlException {
throw new EmptyInstanceException( "Cannot set attribute of empty instance." );
}
public String getParent_package() throws XtumlException {
throw new EmptyInstanceException( "Cannot get attribute of empty instance." );
}
public void setName( String ref_name ) throws XtumlException {
throw new EmptyInstanceException( "Cannot set attribute of empty instance." );
}
public String getName() throws XtumlException {
throw new EmptyInstanceException( "Cannot get attribute of empty instance." );
}
public void setBlock_number( String ref_block_number ) throws XtumlException {
throw new EmptyInstanceException( "Cannot set attribute of empty instance." );
}
public String getBlock_number() throws XtumlException {
throw new EmptyInstanceException( "Cannot get attribute of empty instance." );
}
public String getStatement_number() throws XtumlException {
throw new EmptyInstanceException( "Cannot get attribute of empty instance." );
}
public void setStatement_number( String ref_statement_number ) throws XtumlException {
throw new EmptyInstanceException( "Cannot set attribute of empty instance." );
}
public void setExpression_number( String ref_expression_number ) throws XtumlException {
throw new EmptyInstanceException( "Cannot set attribute of empty instance." );
}
public String getExpression_number() throws XtumlException {
throw new EmptyInstanceException( "Cannot get attribute of empty instance." );
}
public void setClass_name( String ref_class_name ) throws XtumlException {
throw new EmptyInstanceException( "Cannot set attribute of empty instance." );
}
public String getClass_name() throws XtumlException {
throw new EmptyInstanceException( "Cannot get attribute of empty instance." );
}
public String getClass_package() throws XtumlException {
throw new EmptyInstanceException( "Cannot get attribute of empty instance." );
}
public void setClass_package( String ref_class_package ) throws XtumlException {
throw new EmptyInstanceException( "Cannot set attribute of empty instance." );
}
public String getComp_name() throws XtumlException {
throw new EmptyInstanceException( "Cannot get attribute of empty instance." );
}
public void setComp_name( String ref_comp_name ) throws XtumlException {
throw new EmptyInstanceException( "Cannot set attribute of empty instance." );
}
public void setComp_package( String ref_comp_package ) throws XtumlException {
throw new EmptyInstanceException( "Cannot set attribute of empty instance." );
}
public String getComp_package() throws XtumlException {
throw new EmptyInstanceException( "Cannot get attribute of empty instance." );
}
// operations
public void render() throws XtumlException {
throw new EmptyInstanceException( "Cannot invoke operation on empty instance." );
}
// selections
@Override
public Expression R776_is_a_Expression() {
return ExpressionImpl.EMPTY_EXPRESSION;
}
@Override
public ModelInst R780_creates_ModelInst() {
return ModelInstImpl.EMPTY_MODELINST;
}
@Override
public String getKeyLetters() {
return CreationImpl.KEY_LETTERS;
}
@Override
public Creation self() {
return this;
}
@Override
public boolean isEmpty() {
return true;
}
@Override
public Creation oneWhere(IWhere condition) throws XtumlException {
if (null == condition) throw new XtumlException("Null condition passed to selection.");
return CreationImpl.EMPTY_CREATION;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy