org.andromda.metafacades.emf.uml22.AttributeLinkFacadeLogic Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of andromda-metafacades-emf-uml22 Show documentation
Show all versions of andromda-metafacades-emf-uml22 Show documentation
The Eclipse EMF UML2 v2.X metafacades. This is the set of EMF UML2 2.X metafacades
implementations. These implement the common UML metafacades for .uml model files.
The newest version!
// license-header java merge-point
//
// Attention: generated code (by MetafacadeLogic.vsl) - do not modify!
//
package org.andromda.metafacades.emf.uml22;
import java.util.Collection;
import java.util.List;
import org.andromda.core.metafacade.MetafacadeBase;
import org.andromda.core.metafacade.ModelValidationMessage;
import org.andromda.metafacades.uml.AttributeFacade;
import org.andromda.metafacades.uml.AttributeLinkFacade;
import org.andromda.metafacades.uml.InstanceFacade;
import org.apache.log4j.Logger;
/**
*
* A representation of the model object 'Slot'. A slot specifies
* that an entity modeled by an instance specification has a value
* or values for a specific structural feature.
*
* MetafacadeLogic for AttributeLinkFacade
*
* @see AttributeLinkFacade
*/
public abstract class AttributeLinkFacadeLogic
extends ModelElementFacadeLogicImpl
implements AttributeLinkFacade
{
/**
* The underlying UML object
* @see AttributeLink
*/
protected AttributeLink metaObject;
/** Create Metafacade implementation instance using the MetafacadeFactory from the context
* @param metaObjectIn
* @param context
*/
protected AttributeLinkFacadeLogic(AttributeLink metaObjectIn, String context)
{
super(metaObjectIn, getContext(context));
this.metaObject = metaObjectIn;
}
/**
* The logger instance.
*/
private static final Logger logger = Logger.getLogger(AttributeLinkFacadeLogic.class);
/**
* Gets the context for this metafacade logic instance.
* @param context String. Set to AttributeLinkFacade if null
* @return context String
*/
private static String getContext(String context)
{
if (context == null)
{
context = "org.andromda.metafacades.uml.AttributeLinkFacade";
}
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 AttributeLinkFacade
*/
public boolean isAttributeLinkFacadeMetaType()
{
return true;
}
// ------------- associations ------------------
private AttributeFacade __getAttribute1r;
private boolean __getAttribute1rSet = false;
/**
*
* @return (AttributeFacade)handleGetAttribute()
*/
public final AttributeFacade getAttribute()
{
AttributeFacade getAttribute1r = this.__getAttribute1r;
if (!this.__getAttribute1rSet)
{
// attributeLinkFacade has no pre constraints
Object result = handleGetAttribute();
MetafacadeBase shieldedResult = this.shieldedElement(result);
try
{
getAttribute1r = (AttributeFacade)shieldedResult;
}
catch (ClassCastException ex)
{
// Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn
AttributeLinkFacadeLogic.logger.warn("incorrect metafacade cast for AttributeLinkFacadeLogic.getAttribute AttributeFacade " + result + ": " + shieldedResult);
}
// attributeLinkFacade has no post constraints
this.__getAttribute1r = getAttribute1r;
if (isMetafacadePropertyCachingEnabled())
{
this.__getAttribute1rSet = true;
}
}
return getAttribute1r;
}
/**
* UML Specific type is transformed by shieldedElements to AndroMDA Metafacade type
* @return Object
*/
protected abstract Object handleGetAttribute();
private InstanceFacade __getInstance2r;
private boolean __getInstance2rSet = false;
/**
*
* Returns those slots that map onto attributes.
*
* @return (InstanceFacade)handleGetInstance()
*/
public final InstanceFacade getInstance()
{
InstanceFacade getInstance2r = this.__getInstance2r;
if (!this.__getInstance2rSet)
{
// attributeLinks has no pre constraints
Object result = handleGetInstance();
MetafacadeBase shieldedResult = this.shieldedElement(result);
try
{
getInstance2r = (InstanceFacade)shieldedResult;
}
catch (ClassCastException ex)
{
// Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn
AttributeLinkFacadeLogic.logger.warn("incorrect metafacade cast for AttributeLinkFacadeLogic.getInstance InstanceFacade " + result + ": " + shieldedResult);
}
// attributeLinks has no post constraints
this.__getInstance2r = getInstance2r;
if (isMetafacadePropertyCachingEnabled())
{
this.__getInstance2rSet = true;
}
}
return getInstance2r;
}
/**
* UML Specific type is transformed by shieldedElements to AndroMDA Metafacade type
* @return Object
*/
protected abstract Object handleGetInstance();
private InstanceFacade __getValue3r;
private boolean __getValue3rSet = false;
/**
*
* @return (InstanceFacade)handleGetValue()
*/
public final InstanceFacade getValue()
{
InstanceFacade getValue3r = this.__getValue3r;
if (!this.__getValue3rSet)
{
// attributeLinkFacade has no pre constraints
Object result = handleGetValue();
MetafacadeBase shieldedResult = this.shieldedElement(result);
try
{
getValue3r = (InstanceFacade)shieldedResult;
}
catch (ClassCastException ex)
{
// Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn
AttributeLinkFacadeLogic.logger.warn("incorrect metafacade cast for AttributeLinkFacadeLogic.getValue InstanceFacade " + result + ": " + shieldedResult);
}
// attributeLinkFacade has no post constraints
this.__getValue3r = getValue3r;
if (isMetafacadePropertyCachingEnabled())
{
this.__getValue3rSet = true;
}
}
return getValue3r;
}
/**
* UML Specific type is transformed by shieldedElements to AndroMDA Metafacade type
* @return Object
*/
protected abstract Object handleGetValue();
private Collection __getValues4r;
private boolean __getValues4rSet = false;
/**
*
* All slots for this instance, this includes the ones that map
* onto attributes and the ones that map onto association ends. In
* fact, this feature holds the collection of both
* InstanceFacade.attributeLinks and InstanceFacade.linkEnds.
*
* @return (Collection)handleGetValues()
*/
public final Collection getValues()
{
Collection getValues4r = this.__getValues4r;
if (!this.__getValues4rSet)
{
// slots has no pre constraints
Collection result = handleGetValues();
List shieldedResult = this.shieldedElements(result);
try
{
getValues4r = (Collection)shieldedResult;
}
catch (ClassCastException ex)
{
// Bad things happen if the metafacade type mapping in metafacades.xml is wrong - Warn
AttributeLinkFacadeLogic.logger.warn("incorrect metafacade cast for AttributeLinkFacadeLogic.getValues Collection " + result + ": " + shieldedResult);
}
// slots has no post constraints
this.__getValues4r = getValues4r;
if (isMetafacadePropertyCachingEnabled())
{
this.__getValues4rSet = true;
}
}
return getValues4r;
}
/**
* UML Specific type is returned in Collection, transformed by shieldedElements to AndroMDA Metafacade type
* @return Collection
*/
protected abstract Collection handleGetValues();
/**
* @param validationMessages Collection
* @see ModelElementFacadeLogicImpl#validateInvariants(Collection validationMessages)
*/
@Override
public void validateInvariants(Collection validationMessages)
{
super.validateInvariants(validationMessages);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy