functions.JEAFDeprecated.ext Maven / Gradle / Ivy
import JMM;
import uml;
extension java::GeneratorCommons;
extension functions::Javadoc;
cached boolean isJEAFDeprecated(Element element) :
element.isStereotypeApplied("JEAFDeprecated");
cached JEAFDeprecated asDeprecated(Element element):
(JEAFDeprecated) element;
cached String getDeprecationDescription(NamedElement element):
if element.isJEAFDeprecated()
then element.getStereotypeValue("JEAFDeprecated", "description")
else "";
cached String getDeprecationDescriptionForMarkup(NamedElement element):
element.getDeprecationDescription().replaceAll("\n", "
");
cached String getDeprecationDescriptionForJavadoc(NamedElement element):
element.getDeprecationDescription().convertCommentForJavadoc();
cached String getDeprecatedSince(NamedElement element):
if element.isJEAFDeprecated()
then element.getStereotypeValue("JEAFDeprecated", "since")
else "";
cached String getDeprecationRemoval(NamedElement element):
if element.isJEAFDeprecated()
then element.getStereotypeValue("JEAFDeprecated", "removedWith")
else "";
cached boolean isDeprecationComplete(NamedElement element):
element.getDeprecationDescription().length > 0 && element.getDeprecatedSince().length > 0 && element.getDeprecationRemoval().length > 0;
cached boolean hasDeprecationDetails(NamedElement element):
element.getDeprecatedSince().length > 0 || element.getDeprecationRemoval().length > 0;
cached boolean hasMeaningfulDeprecationInfo(NamedElement element):
element.getDeprecationDescription().length > 0 || element.getDeprecatedSince().length > 0 || element.getDeprecationRemoval().length > 0;
cached boolean generateBackwardCompatibility(Element deprecated):
deprecated.getStereotypeValueAsBoolean("JEAFDeprecated", "generateBackwardCompatibility", false);
cached String getSuccessorName(Element deprecated):
deprecated.getStereotypeValue("JEAFDeprecated", "successorName");
cached Property getSuccessorAsProperty(Property property):
property.owner.allOwnedElements().typeSelect(Property).selectFirst(e|e.name == property.getSuccessorName());
cached boolean hasPropertyWithBckwardCompatibility(Class class):
class.allOwnedElements().typeSelect(Property).select(e|e.generateBackwardCompatibility()).size > 0;
//cached boolean isSuccessorOfSameType(Property property):
// property.owner.getall