eu.mihosoft.vmf.vmftext.grammar.impl.ReadOnlyRuleAnnotationImpl 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.RuleAnnotation}.
*/
@SuppressWarnings("deprecation")
class ReadOnlyRuleAnnotationImpl implements ReadOnlyRuleAnnotation, eu.mihosoft.vmf.runtime.core.internal.VObjectInternal, VCloneableInternal {
private final RuleAnnotation 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 ReadOnlyRuleAnnotationImpl(RuleAnnotation mutableObject) {
this.mutableObject = mutableObject;
}
@Override
// property type is a model-type
public ReadOnlyRuleClass getParent() {
if(this.mutableObject.getParent()!=null) {
return this.mutableObject.getParent().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 RuleAnnotation _vmf_getMutableObject() {
return this.mutableObject;
}
@Override
public ReadOnlyRuleAnnotationImpl asReadOnly() {
return this;
}
// --------------------------------------------------------------------
// --- Cloning
// --------------------------------------------------------------------
@Override
public ReadOnlyRuleAnnotation clone() {
return this.mutableObject.clone().asReadOnly();
}
@Override
public RuleAnnotation asModifiable() {
return this.mutableObject.clone();
}
@Override
public RuleAnnotation _vmf_deepCopy(
java.util.IdentityHashMap