/** * @see org.andromda.metafacades.uml.GeneralizableElementFacade#findTaggedValue(String, boolean) */ @Override protected Object handleFindTaggedValue(final String tagName, boolean follow) { Object value = this.findTaggedValue(tagName); if (value == null) { for (GeneralizableElementFacade element = this.getGeneralization(); value == null && element != null; element = element.getGeneralization()) { value = element.findTaggedValue(tagName, follow); } } return value; }
/** * @see org.andromda.metafacades.uml.GeneralizableElementFacade#getAllGeneralizations() */ @Override protected Collection<GeneralizableElementFacade> handleGetAllGeneralizations() { final Collection<GeneralizableElementFacade> generalizations = new ArrayList<GeneralizableElementFacade>(); for (GeneralizableElementFacade element : this.getGeneralizations()) { generalizations.add(element); generalizations.addAll(element.getAllGeneralizations()); } return generalizations; }
/** * @see org.andromda.cartridges.meta.metafacades.MetafacadeGeneralization#getGetterNameVisibility() */ @Override protected String handleGetGetterNameVisibility() { String visibility = "private"; GeneralizableElementFacade child = this.getChild(); if (child != null) { // if we have more than one generalization for the metafacade // then we expose the super facade accessors. Collection<GeneralizableElementFacade> generalizations = child.getGeneralizations(); if ((generalizations != null) && (generalizations.size() > 1)) { visibility = "protected"; } } return visibility; }
entity = entity.getGeneralization()) sourceDependencies.addAll(entity.getSourceDependencies());
if (spec.getName().equals(type.getName() + "Impl")) rtn = '(' + type.getName() + ")new " + spec.getFullyQualifiedName() + "()"; for (GeneralizableElementFacade spec : generalization.getSpecializations()) if (spec.getName().equals(type.getName() + "Impl")) rtn = '(' + type.getName() + ")new " + spec.getFullyQualifiedName() + "Impl()";
/** * @see EJB3EntityFacadeLogic#handleGetRoot() */ protected Object handleGetRoot() { GeneralizableElementFacade generalization = this; for ( ; generalization.getGeneralization() != null && generalization instanceof EJB3EntityFacade; generalization = generalization.getGeneralization()) ; return generalization; }
/** * @see org.andromda.cartridges.meta.metafacades.MetafacadeGeneralization#getGetterName() */ @Override protected String handleGetGetterName() { String name = this.getName(); if (StringUtils.isBlank(name)) { if (this.getParent() != null) { name = this.getParent().getName(); } } name = StringUtils.capitalize(name); return "get" + name; }
/** * @see org.andromda.metafacades.uml.GeneralizableElementFacade#getGeneralizationList() */ @Override protected String handleGetGeneralizationList() { final StringBuilder list = new StringBuilder(); if (this.getGeneralizations() != null) { for (final Iterator<GeneralizableElementFacade> iterator = this.getGeneralizations().iterator(); iterator.hasNext();) { final GeneralizableElementFacade element = iterator.next(); list.append(element.getFullyQualifiedName()); if (iterator.hasNext()) { list.append(", "); } } } return list.toString(); }
/** * @see org.andromda.metafacades.uml.GeneralizableElementFacade#getAllSpecializations() */ @Override protected Collection<GeneralizableElementFacade> handleGetAllSpecializations() { final Set<GeneralizableElementFacade> allSpecializations = new LinkedHashSet<GeneralizableElementFacade>(); if (this.getSpecializations() != null) { allSpecializations.addAll(this.getSpecializations()); for (final Iterator iterator = this.getSpecializations().iterator(); iterator.hasNext();) { final GeneralizableElementFacade element = (GeneralizableElementFacade)iterator.next(); allSpecializations.addAll(element.getAllSpecializations()); } } return allSpecializations; }
/** * @param stereotypes * @return specializations */ protected Collection<ValueObjectLogic> handleGetTypeSpecializations(final String stereotypes) { final Collection<ValueObjectLogic> specializations = new TreeSet<ValueObjectLogic>(); final String[] stereotypeList = stereotypes.split(",", -1); for (GeneralizableElementFacade classifier : this.getAllSpecializations()) { if (classifier instanceof ValueObjectLogic) { for (int i=0; i<stereotypeList.length; i++) { if (classifier.hasStereotype(stereotypeList[i]) && !specializations.contains(classifier)) { specializations.add((ValueObjectLogic) classifier); } } } } return specializations; } }
/** * @see EJB3EntityFacadeLogic#handleGetValueObjectReferences(boolean) */ protected Collection<DependencyFacade> handleGetValueObjectReferences(boolean follow) { final Collection<DependencyFacade> sourceDependencies = new ArrayList<DependencyFacade>(this.getSourceDependencies()); if (follow) { for (GeneralizableElementFacade entity = this.getGeneralization(); entity != null; entity = entity.getGeneralization()) { sourceDependencies.addAll(entity.getSourceDependencies()); } } Collection<DependencyFacade> valueDependencies = new ArrayList<DependencyFacade>(); for (DependencyFacade dependency : sourceDependencies) { Object targetElement = dependency.getTargetElement(); if (targetElement instanceof ClassifierFacade) { ClassifierFacade element = (ClassifierFacade)targetElement; if (element.isDataType() || element instanceof ValueObject || element instanceof EnumerationFacade) { valueDependencies.add(dependency); } } } return valueDependencies; }
if (spec.getName().equals(type.getName() + "Impl")) rtn = '(' + type.getName() + ")new " + spec.getFullyQualifiedName() + "()"; for (GeneralizableElementFacade spec : generalization.getSpecializations()) if (spec.getName().equals(type.getName() + "Impl")) rtn = '(' + type.getName() + ")new " + spec.getFullyQualifiedName() + "Impl()";
/** * @return Object Root * @see org.andromda.cartridges.spring.metafacades.SpringEntity#getRoot() */ protected Object handleGetRoot() { GeneralizableElementFacade generalization = this; while(generalization.getGeneralization() != null && generalization instanceof SpringEntity) { generalization = generalization.getGeneralization(); } return generalization; }
/** * @see org.andromda.cartridges.meta.metafacades.MetafacadeGeneralization#getGetterName() */ @Override protected String handleGetGetterName() { String name = this.getName(); if (StringUtils.isBlank(name)) { if (this.getParent() != null) { name = this.getParent().getName(); } } name = StringUtils.capitalize(name); return "get" + name; }
/** * @see org.andromda.metafacades.uml.GeneralizableElementFacade#getGeneralizationList() */ @Override protected String handleGetGeneralizationList() { final StringBuilder list = new StringBuilder(); if (this.getGeneralizations() != null) { for (final Iterator<GeneralizableElementFacade> iterator = this.getGeneralizations().iterator(); iterator.hasNext();) { final GeneralizableElementFacade element = iterator.next(); list.append(element.getFullyQualifiedName()); if (iterator.hasNext()) { list.append(", "); } } } return list.toString(); }
/** * @see org.andromda.metafacades.uml.GeneralizableElementFacade#getAllSpecializations() */ @Override protected Set<GeneralizableElementFacade> handleGetAllSpecializations() { final Set<GeneralizableElementFacade> allSpecializations = new LinkedHashSet<GeneralizableElementFacade>(); if (this.getSpecializations() != null) { allSpecializations.addAll(this.getSpecializations()); for (GeneralizableElementFacade element : this.getSpecializations()) { allSpecializations.addAll(element.getAllSpecializations()); } } return allSpecializations; }
/** * @param stereotypes * @return specializations */ protected Collection<ValueObjectLogic> handleGetTypeSpecializations(final String stereotypes) { final Collection<ValueObjectLogic> specializations = new TreeSet<ValueObjectLogic>(); final String[] stereotypeList = stereotypes.split(",", -1); for (GeneralizableElementFacade classifier : this.getAllSpecializations()) { if (classifier instanceof ValueObjectLogic) { for (int i=0; i<stereotypeList.length; i++) { if (classifier.hasStereotype(stereotypeList[i]) && !specializations.contains(classifier)) { specializations.add((ValueObjectLogic) classifier); } } } } return specializations; } }
for ( GeneralizableElementFacade parent = this.getGeneralization(); parent != null; parent = parent.getGeneralization()) allSourceDependencies.addAll(parent.getSourceDependencies());
/** * @see org.andromda.metafacades.emf.uml22.GeneralizableElementFacadeLogic#handleFindTaggedValue(String, boolean) */ @Override protected Object handleFindTaggedValue( final String tagName, final boolean follow) { Object value = this.findTaggedValue(tagName); if (value == null && follow) { for (GeneralizableElementFacade element = this.getGeneralization(); element != null; element = element.getGeneralization()) { value = element.findTaggedValue( tagName, follow); if (value != null) { break; } } } return value; }
/** * @see org.andromda.metafacades.emf.uml22.GeneralizableElementFacadeLogic#handleGetGeneralizationRoot() */ @Override protected GeneralizableElementFacade handleGetGeneralizationRoot() { GeneralizableElementFacade generalizableElement = (GeneralizableElementFacade)THIS(); while (generalizableElement.getGeneralization() != null) { generalizableElement = generalizableElement.getGeneralization(); } return generalizableElement; } }