eu.mihosoft.vmf.vmftext.grammar.impl.ReadOnlyCustomRuleImpl Maven / Gradle / Ivy
The newest version!
package eu.mihosoft.vmf.vmftext.grammar.impl;
// vmf imports
//import eu.mihosoft.vmf.runtime.core.*;
//import eu.mihosoft.vmf.runtime.core.internal.*;
import eu.mihosoft.vcollections.*;
import eu.mihosoft.vmf.vmftext.grammar.*;
import java.beans.PropertyChangeListener;
// property types imports
// interface
/**
* An read-only representation of the model object {@code eu.mihosoft.vmf.vmftext.grammar.CustomRule}.
*/
@SuppressWarnings("deprecation")
class ReadOnlyCustomRuleImpl implements ReadOnlyCustomRule, eu.mihosoft.vmf.runtime.core.internal.VObjectInternal, VCloneableInternal {
private final CustomRule mutableObject;
// Read-only view for collection properties
// - properties with collection type (model & non-model collections)
// - we don't allow/provide setters for collection properties
public ReadOnlyCustomRuleImpl(CustomRule mutableObject) {
this.mutableObject = mutableObject;
}
@Override
// property type is a model-type
public ReadOnlyGrammarModel getModel() {
if(this.mutableObject.getModel()!=null) {
return this.mutableObject.getModel().asReadOnly();
} else {
return null;
}
}
@Override
public java.lang.String getText() {
return this.mutableObject.getText();
}
// end for each property
@Override
public void addPropertyChangeListener(PropertyChangeListener l) {
((eu.mihosoft.vmf.runtime.core.internal.VObjectInternal)this.mutableObject).addPropertyChangeListener(l);
}
@Override
public void removePropertyChangeListener(PropertyChangeListener l) {
((eu.mihosoft.vmf.runtime.core.internal.VObjectInternal)this.mutableObject).removePropertyChangeListener(l);
}
@Override
public String toString() {
return this.mutableObject.toString();
}
@Override
public boolean equals(Object o) {
return this.mutableObject.equals(o);
}
@Override
public int hashCode() {
return this.mutableObject.hashCode();
}
@Override
public CustomRule _vmf_getMutableObject() {
return this.mutableObject;
}
@Override
public ReadOnlyCustomRuleImpl asReadOnly() {
return this;
}
// --------------------------------------------------------------------
// --- Cloning
// --------------------------------------------------------------------
@Override
public ReadOnlyCustomRule clone() {
return this.mutableObject.clone().asReadOnly();
}
@Override
public CustomRule asModifiable() {
return this.mutableObject.clone();
}
@Override
public CustomRule _vmf_deepCopy(
java.util.IdentityHashMap