/** * @param modelElement non-null model element * @return the qualified name of the meta object (MOF element (class) of the metamodel), that describes * the provided model element */ public static ClassName constructQualifiedMetaObjectName(RefObject modelElement) { return (ClassName) constructQualifiedElementName( (ModelElement) modelElement.refMetaObject() ); }
/** * This method constructs the name of the metaclass of the model element provided. * @param element is the non-null object to find metaclass of * @return the non-null metaclass name * @throws JmiException if the metaclass name is not a valid one */ public static String getMetaClassName(RefObject element) throws JmiException { assert element != null : "Expected a non-null model element"; return constructQualifiedName((ModelElement) element.refMetaObject()); }
public Key(RefObject forObject, int level, int valuesHash) { assert forObject != null : "Expected a non-null model element to represent"; this.level = level; this.className = ((GeneralizableElement) forObject.refMetaObject()).getName(); this.valuesHash = valuesHash; this.hash = (Hash.hash(className)<<4) + (valuesHash<<2)+level; }
metaClass = (MofClass) element.refMetaObject();
String thisClassName; superClass = (GeneralizableElement) forObject.refMetaObject(); thisClassName = superClass.getName();
metaClass = (MofClass) element.refMetaObject();
/** * @param convertedValue not null * @param target not null */ private void setValue(Object convertedValue, RefObject target) { Object targetValue; try { targetValue = target.refGetValue(targetName); if ( targetValue instanceof Collection ) { if ( convertedValue instanceof Collection ) { ((Collection) targetValue).addAll((Collection) convertedValue); } else { ((Collection) targetValue).add( convertedValue ); } } else { target.refSetValue( targetName, convertedValue ); } } catch (Exception ex) { throw new IllegalArgumentException( "Setting '"+targetName+"' to value: '" +PRINT_MODEL_ELEMENT.execute( convertedValue ) +"' on target object " +PRINT_MODEL_ELEMENT.execute( target ) + " instance of " +PRINT_MODEL_ELEMENT.execute( target.refMetaObject() )+" failed with: ", ex); } }
+PRINT_MODEL_ELEMENT.execute( source ) + " instance of " +PRINT_MODEL_ELEMENT.execute( source.refMetaObject() )+" failed with: ", ex );