Package org.eclipse.uml2.uml

Examples of org.eclipse.uml2.uml.Type


    // Empty the list first
    constructorParameterNames.clear();

    EList<Property> constructorProperties = clazz.getAttributes();
    for (Property constructorProperty : constructorProperties) {
      Type constructorType = constructorProperty.getType();
      // Save the variable declaration for later use
      constructorParameterNames.add(constructorProperty.getName());

      logger.log(
          Level.FINE,
          "Class: " + clazz.getName() + " - "
              + "Constructor property: "
              + constructorProperty.getName() + " - "
              + "Constructor property Upper: "
              + constructorProperty.getUpper() + " - "
              + "Constructor property Lower: "
              + constructorProperty.getLower());

      String contructorUmlTypeName = constructorType.getName();
      String constructorUmlQualifiedTypeName = constructorType
          .getQualifiedName();

      // Check whether primitive or array type or simple type?
      org.eclipse.jdt.core.dom.Type constructorChosenType = jdtHelper
          .getChosenType(ast, contructorUmlTypeName,
View Full Code Here


              enumLiteral);
          if (slot != null) {
            // We found a slot with the same name
            Property property = (Property) slot
                .getDefiningFeature();
            Type type = property.getType();
            chooseLiteralTypeAndAddToEnumConstantArguments(ast, ec,
                slot, type);
          } else {
            // We didn't find the slot with the same name as in the
            // constructor
View Full Code Here

  private void getSlotsNotIntelligent(AST ast,
      EnumerationLiteral enumLiteral, EnumConstantDeclaration ec) {
    EList<Slot> slots = enumLiteral.getSlots();
    for (Slot slot : slots) {
      Property property = (Property) slot.getDefiningFeature();
      Type type = property.getType();
      chooseLiteralTypeAndAddToEnumConstantArguments(ast, ec, slot, type);
    }
  }
View Full Code Here

    EList<Slot> slots = mock(EList.class);
    Iterator<Slot> slotIter = mock(Iterator.class);
    Slot slot = mock(Slot.class);

    Property property = mock(Property.class);
    Type type = mock(Type.class);

    EList<ValueSpecification> valueSpecifications = mock(EList.class);
    Iterator<ValueSpecification> valueSpecificationIter = mock(Iterator.class);
    ValueSpecification valueSpecification = mock(ValueSpecification.class);

    when(enumeration.getOwnedLiterals()).thenReturn(enumLiterals);
    when(enumLiterals.iterator()).thenReturn(enumIter);
    when(enumIter.hasNext()).thenReturn(true).thenReturn(false);
    when(enumIter.next()).thenReturn(enumLiteral);
    when(enumLiteral.getName()).thenReturn("Home");

    when(enumLiteral.getSlots()).thenReturn(slots);
    when(slots.iterator()).thenReturn(slotIter);
    when(slotIter.hasNext()).thenReturn(true).thenReturn(false);
    when(slotIter.next()).thenReturn(slot);
    when(slot.getDefiningFeature()).thenReturn(property);

    when(property.getType()).thenReturn(type);
    when(type.getName()).thenReturn("Integer");

    when(slot.getValues()).thenReturn(valueSpecifications);
    when(valueSpecifications.iterator()).thenReturn(valueSpecificationIter);
    when(valueSpecificationIter.hasNext()).thenReturn(true).thenReturn(
        false);
View Full Code Here

    EList<Slot> slots = mock(EList.class);
    Iterator<Slot> slotIter = mock(Iterator.class);
    Slot slot = mock(Slot.class);

    Property property = mock(Property.class);
    Type type = mock(Type.class);

    EList<ValueSpecification> valueSpecifications = mock(EList.class);
    Iterator<ValueSpecification> valueSpecificationIter = mock(Iterator.class);
    ValueSpecification valueSpecification = mock(ValueSpecification.class);

    when(enumeration.getOwnedLiterals()).thenReturn(enumLiterals);
    when(enumLiterals.iterator()).thenReturn(enumIter);
    when(enumIter.hasNext()).thenReturn(true).thenReturn(false);
    when(enumIter.next()).thenReturn(enumLiteral);
    when(enumLiteral.getName()).thenReturn("Home");

    when(enumLiteral.getSlots()).thenReturn(slots);
    when(slots.iterator()).thenReturn(slotIter);
    when(slotIter.hasNext()).thenReturn(true).thenReturn(false);
    when(slotIter.next()).thenReturn(slot);
    when(slot.getDefiningFeature()).thenReturn(property);

    when(property.getType()).thenReturn(type);
    when(type.getName()).thenReturn("String");

    when(slot.getValues()).thenReturn(valueSpecifications);
    when(valueSpecifications.iterator()).thenReturn(valueSpecificationIter);
    when(valueSpecificationIter.hasNext()).thenReturn(true).thenReturn(
        false);
View Full Code Here

    EList<Slot> slots = mock(EList.class);
    Iterator<Slot> slotIter = mock(Iterator.class);
    Slot slot = mock(Slot.class);

    Property property = mock(Property.class);
    Type type = mock(Type.class);

    EList<ValueSpecification> valueSpecifications = mock(EList.class);
    Iterator<ValueSpecification> valueSpecificationIter = mock(Iterator.class);
    ValueSpecification valueSpecification = mock(ValueSpecification.class);

    when(enumeration.getOwnedLiterals()).thenReturn(enumLiterals);
    when(enumLiterals.iterator()).thenReturn(enumIter);
    when(enumIter.hasNext()).thenReturn(true).thenReturn(false);
    when(enumIter.next()).thenReturn(enumLiteral);
    when(enumLiteral.getName()).thenReturn("Home");

    when(enumLiteral.getSlots()).thenReturn(slots);
    when(slots.iterator()).thenReturn(slotIter);
    when(slotIter.hasNext()).thenReturn(true).thenReturn(false);
    when(slotIter.next()).thenReturn(slot);
    when(slot.getDefiningFeature()).thenReturn(property);

    when(property.getType()).thenReturn(type);
    when(type.getName()).thenReturn("Long");

    when(slot.getValues()).thenReturn(valueSpecifications);
    when(valueSpecifications.iterator()).thenReturn(valueSpecificationIter);
    when(valueSpecificationIter.hasNext()).thenReturn(true).thenReturn(
        false);
View Full Code Here

    EList<Slot> slots = mock(EList.class);
    Iterator<Slot> slotIter = mock(Iterator.class);
    Slot slot = mock(Slot.class);

    Property property = mock(Property.class);
    Type type = mock(Type.class);

    EList<ValueSpecification> valueSpecifications = mock(EList.class);
    Iterator<ValueSpecification> valueSpecificationIter = mock(Iterator.class);
    ValueSpecification valueSpecification = mock(ValueSpecification.class);

    when(enumeration.getOwnedLiterals()).thenReturn(enumLiterals);
    when(enumLiterals.iterator()).thenReturn(enumIter);
    when(enumIter.hasNext()).thenReturn(true).thenReturn(false);
    when(enumIter.next()).thenReturn(enumLiteral);
    when(enumLiteral.getName()).thenReturn("Home");

    when(enumLiteral.getSlots()).thenReturn(slots);
    when(slots.iterator()).thenReturn(slotIter);
    when(slotIter.hasNext()).thenReturn(true).thenReturn(false);
    when(slotIter.next()).thenReturn(slot);
    when(slot.getDefiningFeature()).thenReturn(property);

    when(property.getType()).thenReturn(type);
    when(type.getName()).thenReturn("boolean");

    when(slot.getValues()).thenReturn(valueSpecifications);
    when(valueSpecifications.iterator()).thenReturn(valueSpecificationIter);
    when(valueSpecificationIter.hasNext()).thenReturn(true).thenReturn(
        false);
View Full Code Here

    EnumDeclaration ed = enumGenerator.generateEnum(clazz, ast, cu);

    EList<Property> properties = mock(EList.class);
    Iterator<Property> propertyIter = mock(Iterator.class);
    Property property = mock(Property.class);
    Type type = mock(Type.class);
    String name = "type";

    EList<Comment> comments = mock(EList.class,
        Answers.RETURNS_DEEP_STUBS.get());

    when(clazz.getAttributes()).thenReturn(properties);
    when(properties.iterator()).thenReturn(propertyIter);
    when(propertyIter.hasNext()).thenReturn(true).thenReturn(false);
    when(propertyIter.next()).thenReturn(property);
    when(property.getType()).thenReturn(type);
    when(property.getName()).thenReturn(name);
    when(property.getUpper()).thenReturn(1);
    when(property.getLower()).thenReturn(1);
    when(property.getOwnedComments()).thenReturn(comments);
    when(type.getName()).thenReturn("String");
    when(type.getQualifiedName()).thenReturn("String");

    enumGenerator.generateGetterMethod(clazz, ast, ed);

    assertEquals(
        "public enum Company {; public String getType(){\n  return type;\n}\n}\n",
View Full Code Here

    EnumDeclaration ed = enumGenerator.generateEnum(clazz, ast, cu);

    EList<Property> properties = mock(EList.class);
    Iterator<Property> propertyIter = mock(Iterator.class);
    Property property = mock(Property.class);
    Type type = mock(Type.class);
    String name = "type";

    EList<Comment> comments = mock(EList.class,
        Answers.RETURNS_DEEP_STUBS.get());

    when(clazz.getAttributes()).thenReturn(properties);
    when(properties.iterator()).thenReturn(propertyIter);
    when(propertyIter.hasNext()).thenReturn(true).thenReturn(false);
    when(propertyIter.next()).thenReturn(property);
    when(property.getType()).thenReturn(type);
    when(property.getName()).thenReturn(name);
    when(property.getUpper()).thenReturn(1);
    when(property.getLower()).thenReturn(1);
    when(property.getOwnedComments()).thenReturn(comments);
    when(type.getName()).thenReturn("Data::String");
    when(type.getQualifiedName()).thenReturn("Data::String");

    enumGenerator.generateGetterMethod(clazz, ast, ed);

    assertEquals(
        "public enum Company {; public Data.String getType(){\n  return type;\n}\n}\n",
View Full Code Here

    EnumDeclaration ed = enumGenerator.generateEnum(clazz, ast, cu);

    EList<Property> properties = mock(EList.class);
    Iterator<Property> propertyIter = mock(Iterator.class);
    Property property = mock(Property.class);
    Type type = mock(Type.class);
    String name = "type";

    EList<Comment> comments = mock(EList.class,
        Answers.RETURNS_DEEP_STUBS.get());

    when(clazz.getAttributes()).thenReturn(properties);
    when(properties.iterator()).thenReturn(propertyIter);
    when(propertyIter.hasNext()).thenReturn(true).thenReturn(false);
    when(propertyIter.next()).thenReturn(property);
    when(property.getType()).thenReturn(type);
    when(property.getName()).thenReturn(name);
    when(property.getUpper()).thenReturn(1);
    when(property.getLower()).thenReturn(1);
    when(property.getOwnedComments()).thenReturn(comments);
    when(type.getName()).thenReturn("Data::String");
    when(type.getQualifiedName()).thenReturn("Data::String");

    enumGenerator.generateGetterMethod(clazz, ast, ed, "Data");

    assertEquals(
        "public enum Company {; public String getType(){\n  return type;\n}\n}\n",
View Full Code Here

TOP

Related Classes of org.eclipse.uml2.uml.Type

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.