@Test public void testGetTemplateParameterSubstitutionPrimitiveType() { Classifier clazzifier = prepareMocks(); when(dataTypeUtils.isPrimitiveType(Mockito.anyString())).thenReturn( true); when(clazzifier.getName()).thenReturn("Data::datatype::Integer"); when(clazzifier.getQualifiedName()).thenReturn( "Data::datatype::de::test::Integer"); List<String> results = umlHelper.getTemplateParameterSubstitution(type); assertEquals("Data::datatype::Integer", results.get(0)); }
public List<String> getTemplateParameterSubstitution(Type type) { List<String> results = new ArrayList<String>(); logger.log(Level.FINE, "getTemplateParameterSubstitution: " + type.getQualifiedName() + " - " + type.getTemplateParameter()); EList<Element> elements = type.allOwnedElements(); for (Element element : elements) { if (element instanceof TemplateBinding) { TemplateBinding templateBinding = (TemplateBinding) element; EList<TemplateParameterSubstitution> subs = templateBinding .getParameterSubstitutions(); for (TemplateParameterSubstitution templateParameterSubstitution : subs) { ParameterableElement paramElement = templateParameterSubstitution .getActual(); if (paramElement instanceof Classifier) { Classifier clazzifier = (Classifier) paramElement; if (!dataTypeUtils .isPrimitiveType(clazzifier.getName()) && !dataTypeUtils.isJavaType(clazzifier .getName())) { results.add(clazzifier.getQualifiedName()); } else { results.add(clazzifier.getName()); } } } } } return results; }
UmlHelper { public List<String> getTemplateParameterSubstitution(Type type) { List<String> results = new ArrayList<String>(); logger.log(Level.FINE, "getTemplateParameterSubstitution: " + type.getQualifiedName() + " - " + type.getTemplateParameter()); EList<Element> elements = type.allOwnedElements(); for (Element element : elements) { if (element instanceof TemplateBinding) { TemplateBinding templateBinding = (TemplateBinding) element; EList<TemplateParameterSubstitution> subs = templateBinding .getParameterSubstitutions(); for (TemplateParameterSubstitution templateParameterSubstitution : subs) { ParameterableElement paramElement = templateParameterSubstitution .getActual(); if (paramElement instanceof Classifier) { Classifier clazzifier = (Classifier) paramElement; if (!dataTypeUtils .isPrimitiveType(clazzifier.getName()) && !dataTypeUtils.isJavaType(clazzifier .getName())) { results.add(clazzifier.getQualifiedName()); } else { results.add(clazzifier.getName()); } } } } } return results; } }
UmlHelper { public List<String> getTemplateParameterSubstitution(Type type) { List<String> results = new ArrayList<String>(); logger.log(Level.FINE, "getTemplateParameterSubstitution: " + type.getQualifiedName() + " - " + type.getTemplateParameter()); EList<Element> elements = type.allOwnedElements(); for (Element element : elements) { if (element instanceof TemplateBinding) { TemplateBinding templateBinding = (TemplateBinding) element; EList<TemplateParameterSubstitution> subs = templateBinding .getParameterSubstitutions(); for (TemplateParameterSubstitution templateParameterSubstitution : subs) { ParameterableElement paramElement = templateParameterSubstitution .getActual(); if (paramElement instanceof Classifier) { Classifier clazzifier = (Classifier) paramElement; if (!dataTypeUtils .isPrimitiveType(clazzifier.getName()) && !dataTypeUtils.isJavaType(clazzifier .getName())) { results.add(clazzifier.getQualifiedName()); } else { results.add(clazzifier.getName()); } } } } } return results; }  }
UmlHelper { public List<String> getTemplateParameterSubstitution(Type type) { List<String> results = new ArrayList<String>(); logger.log(Level.FINE, "getTemplateParameterSubstitution: " + type.getQualifiedName() + " - " + type.getTemplateParameter()); EList<Element> elements = type.allOwnedElements(); for (Element element : elements) { if (element instanceof TemplateBinding) { TemplateBinding templateBinding = (TemplateBinding) element; EList<TemplateParameterSubstitution> subs = templateBinding .getParameterSubstitutions(); for (TemplateParameterSubstitution templateParameterSubstitution : subs) { ParameterableElement paramElement = templateParameterSubstitution .getActual(); if (paramElement instanceof Classifier) { Classifier clazzifier = (Classifier) paramElement; if (!dataTypeUtils .isPrimitiveType(clazzifier.getName()) && !dataTypeUtils.isJavaType(clazzifier .getName())) { results.add(clazzifier.getQualifiedName()); } else { results.add(clazzifier.getName()); } } } } } return results; }  void log(Object o); void log(Object o, String logMsg); String getFQNPackageName(Type type); String getFQNPackagePath(Type type); String getFQNComponentName(Type type); String getFQNComponentPath(Type type); String getXmiId(EObject eObject); EList<Property> getAllAttributes(Classifier classifier); EList<Operation> getAllOperations(Classifier classifier); @SuppressWarnings("unchecked") EList<Dependency> getAllDependencies(NamedElement element); @SuppressWarnings("unchecked") EList<Association> getAllAssociations(Classifier classifier); @SuppressWarnings({ "rawtypes", "unchecked" }) String formatComment(Element element, String prefix,
			String propertyFileName); boolean createAnnotationSourceKey(String propertyFileName); @SuppressWarnings({ "rawtypes", "unchecked" }) String formatParameterComment(Parameter parameter, String prefix,
			String annotation, String propertyFileName); String getDefaultValue(Property property); EList<String> convertStringToList(String theString, String delimiter); List<String> getTemplateParameterSubstitution(Type type); Map<String, String> checkParameterizedTypeForTemplateParameterSubstitution(
			Type type); }
UmlHelper { public List<String> getTemplateParameterSubstitution(Type type) { List<String> results = new ArrayList<String>(); logger.log(Level.FINE, "getTemplateParameterSubstitution: " + type.getQualifiedName() + " - " + type.getTemplateParameter()); EList<Element> elements = type.allOwnedElements(); for (Element element : elements) { if (element instanceof TemplateBinding) { TemplateBinding templateBinding = (TemplateBinding) element; EList<TemplateParameterSubstitution> subs = templateBinding .getParameterSubstitutions(); for (TemplateParameterSubstitution templateParameterSubstitution : subs) { ParameterableElement paramElement = templateParameterSubstitution .getActual(); if (paramElement instanceof Classifier) { Classifier clazzifier = (Classifier) paramElement; if (!dataTypeUtils .isPrimitiveType(clazzifier.getName()) && !dataTypeUtils.isJavaType(clazzifier .getName())) { results.add(clazzifier.getQualifiedName()); } else { results.add(clazzifier.getName()); } } } } } return results; }  void log(Object o); void log(Object o, String logMsg); String getFQNPackageName(Type type); String getFQNPackagePath(Type type); String getFQNComponentName(Type type); String getFQNComponentPath(Type type); String getXmiId(EObject eObject); EList<Property> getAllAttributes(Classifier classifier); EList<Operation> getAllOperations(Classifier classifier); @SuppressWarnings("unchecked") EList<Dependency> getAllDependencies(NamedElement element); @SuppressWarnings("unchecked") EList<Association> getAllAssociations(Classifier classifier); @SuppressWarnings({ "rawtypes", "unchecked" }) String formatComment(Element element, String prefix,
			String propertyFileName); boolean createAnnotationSourceKey(String propertyFileName); @SuppressWarnings({ "rawtypes", "unchecked" }) String formatParameterComment(Parameter parameter, String prefix,
			String annotation, String propertyFileName); String getDefaultValue(Property property); EList<String> convertStringToList(String theString, String delimiter); List<String> getTemplateParameterSubstitution(Type type); Map<String, String> checkParameterizedTypeForTemplateParameterSubstitution(
			Type type);  }