org.andromda.metafacades.uml14.ValueObjectLogic Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of andromda-metafacades-uml14 Show documentation
Show all versions of andromda-metafacades-uml14 Show documentation
The UML 1.4 metafacades. This is the set of UML 1.4 metafacades
implementations. These implement the common UML metafacades.
The newest version!
// license-header java merge-point
//
// Attention: generated code (by MetafacadeLogic.vsl) - do not modify!
//
package org.andromda.metafacades.uml14;
import java.util.Collection;
import java.util.List;
import org.andromda.core.metafacade.ModelValidationMessage;
import org.andromda.metafacades.uml.ValueObject;
import org.apache.log4j.Logger;
import org.omg.uml.foundation.core.Classifier;
/**
*
* Represents a value object, a Classifier whose unique value is
* determined only by its attributes.
*
* MetafacadeLogic for ValueObject
*
* @see ValueObject
*/
public abstract class ValueObjectLogic
extends ClassifierFacadeLogicImpl
implements ValueObject
{
/**
* The underlying UML object
* @see Object
*/
protected Object metaObject;
/** Create Metafacade implementation instance using the MetafacadeFactory from the context
* @param metaObjectIn
* @param context
*/
protected ValueObjectLogic(Object metaObjectIn, String context)
{
super((Classifier)metaObjectIn, getContext(context));
this.metaObject = metaObjectIn;
}
/**
* The logger instance.
*/
private static final Logger logger = Logger.getLogger(ValueObjectLogic.class);
/**
* Gets the context for this metafacade logic instance.
* @param context String. Set to ValueObject if null
* @return context String
*/
private static String getContext(String context)
{
if (context == null)
{
context = "org.andromda.metafacades.uml.ValueObject";
}
return context;
}
/** Reset context only for non-root metafacades
* @param context
*/
@Override
public void resetMetafacadeContext(String context)
{
if (!this.contextRoot) // reset context only for non-root metafacades
{
context = getContext(context); // to have same value as in original constructor call
setMetafacadeContext (context);
}
}
/**
* @return boolean true always
* @see ValueObject
*/
public boolean isValueObjectMetaType()
{
return true;
}
// ------------- associations ------------------
private Collection __getTypeSpecializations1r;
private boolean __getTypeSpecializations1rSet = false;
/**
*
* @return (Collection)handleGetTypeSpecializations()
*/
public final Collection getTypeSpecializations()
{
Collection getTypeSpecializations1r = this.__getTypeSpecializations1r;
if (!this.__getTypeSpecializations1rSet)
{
// valueObject has no pre constraints
Collection result = handleGetTypeSpecializations();
List shieldedResult = this.shieldedElements(result);
try
{
getTypeSpecializations1r = (Collection)shieldedResult;
}
catch (ClassCastException ex)
{
// Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn
ValueObjectLogic.logger.warn("incorrect metafacade cast for ValueObjectLogic.getTypeSpecializations Collection " + result + ": " + shieldedResult);
}
// valueObject has no post constraints
this.__getTypeSpecializations1r = getTypeSpecializations1r;
if (isMetafacadePropertyCachingEnabled())
{
this.__getTypeSpecializations1rSet = true;
}
}
return getTypeSpecializations1r;
}
/**
* UML Specific type is returned in Collection, transformed by shieldedElements to AndroMDA Metafacade type
* @return Collection
*/
protected abstract Collection handleGetTypeSpecializations();
/**
* @param validationMessages Collection
* @see ClassifierFacadeLogicImpl#validateInvariants(Collection validationMessages)
*/
@Override
public void validateInvariants(Collection validationMessages)
{
super.validateInvariants(validationMessages);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy