Package org.eclipse.uml2

Examples of org.eclipse.uml2.Property


      if ( level01.getDataItems()[i] instanceof ElementaryDataItem ) {
        ElementaryDataItem edi = (ElementaryDataItem)level01.getDataItems()[i];
        String attrName = edi.getDataName();
        DataField dataField = (DataField)edi.interpret();
        if (dataField != null) {
          Property attr = (Property)attrs.get(attrName);
          Type type = dataField.getType() == Integer.class ? integerType : stringType;
          if (attr == null) {
            String timestampFormat = "";
            String dateFormat = "";
            String length = "" + dataField.getLength();
            String fraction = "" + dataField.getFraction();
            System.out.println("INFO [jIvalo]  - Adding new attribute: " + attrName);
            Property newAttr = addAttribute(c, attrName, type, timestampFormat, dateFormat, length, fraction);
          }
          else {
            System.out.println("INFO [jIvalo]  - Updating new attribute: " + attrName);
            attr.setType(type);
            setTagValue(attr, "length", "" + dataField.getLength());
            setTagValue(attr, "fraction", "" + dataField.getFraction());
            attrs.remove(attrName);
          }
        }
      }
      else if ( level01.getDataItems()[i] instanceof GroupDataItem ) {
        GroupDataItem gdi = (GroupDataItem)level01.getDataItems()[i];
        String className = c.getName() + "_" + gdi.getDataName();
        Class cl = getClass(p, className);
        if (cl == null) {
          addClass(p, className);
          System.out.println("INFO [jIvalo] Added class: " + className);
          cl = getClass(p, className);
        }
        else {
          System.out.println("INFO [jIvalo] Updating existing class: " + className);
        }
       
        if (cl != null) {
          addAttributes(gdi, p, cl, model);
   
          Property newAttr = null;
          if ( level01.getDataItems()[i] instanceof GroupDataItemOccurs ) {
            GroupDataItemOccurs gdio = (GroupDataItemOccurs)level01.getDataItems()[i];
            newAttr = c.createOwnedAttribute(className,p.getOwnedType(cl.getName()),gdio.getOccurs(),gdio.getOccurs());
          }
          else {
            newAttr = c.createOwnedAttribute(className,p.getOwnedType(cl.getName()),1,1);
          }
          if (newAttr != null) {
            newAttr.setVisibility(VisibilityKind.PUBLIC_LITERAL);
            addStereotype(newAttr, jIvaloAttributeStereotype);
            setTagValue(newAttr, "timestampFormat", "");
            setTagValue(newAttr, "dateFormat", "");
            setTagValue(newAttr, "length", "0");
            setTagValue(newAttr, "fraction", "0");
View Full Code Here


    cobolResourceDir = Namespaces.instance().getNamespace(namespace).getProperty("cobolResourceDir").getValue();
    targetPackage = Namespaces.instance().getNamespace(namespace).getProperty("targetPackage").getValue();
   
    jIvaloPackage = getPackage(jIvaloPackageName, model);
    jIvaloClass = getClass(jIvaloPackage, jIvaloClassName);
    Property attribute1 = getAttribute(jIvaloClass, "string");
    stringType = attribute1.getType();
    Property attribute2 = getAttribute(jIvaloClass, "integer");
    integerType = attribute2.getType();

    jIvaloClassStereotype = getStereotype(jIvaloClass, jIvaloClassSteroetypeName);
    jIvaloAttributeStereotype = getStereotype(attribute1, jIvaloAttrSteroetypeName);

  }
View Full Code Here

    Repositories.instance().getImplementation(encoding).writeModel(element,
        outputLocation, xmiVersion);
  }

  private Property addAttribute(Class c, String name, Type type, String timestampFormat, String dateFormat, String length, String fraction) {
    Property p = c.createOwnedAttribute(name, type, 1, 1);
    p.setVisibility(VisibilityKind.PUBLIC_LITERAL);
    setTagValue(p, "timestampFormat", timestampFormat);
    setTagValue(p, "dateFormat", dateFormat);
    setTagValue(p, "length", length);
    setTagValue(p, "fraction", fraction);
    return p;
View Full Code Here

    {
        Collection regions = this.metaObject.getRegions();
        Collection transitions = new LinkedList();
        for (Iterator it = regions.iterator(); it.hasNext();)
        {
            Region region = (Region)it.next();
            transitions.addAll(region.getTransitions());
        }
        return transitions;
    }
View Full Code Here

    {
        Collection regions = this.metaObject.getRegions();
        Collection subvertices = new LinkedList();
        for (Iterator it = regions.iterator(); it.hasNext();)
        {
            Region region = (Region)it.next();
            subvertices.addAll(region.getSubvertices());
        }
        return this.filter(
            subvertices,
            collectionFilter);
    }
View Full Code Here

    protected java.lang.Object handleGetStateMachineContext()
    {
        // TODO: What should this method return ?
      // As I've seen in uml1.4 impl, it should return the statemachine which this element is the context for.
      // Let's say for UML2: Return the owner if the latter is a StateMachine
      StateMachine stateMachine = null;
        Element owner = this.metaObject.getOwner();
        if(owner instanceof StateMachine)
        {
          stateMachine = (StateMachine) owner;
        }
View Full Code Here

    /**
     * @see org.andromda.metafacades.uml.UseCaseFacade#getFirstActivityGraph()
     */
    protected java.lang.Object handleGetFirstActivityGraph()
    {
        StateMachine activityGraph = null;
        Collection behaviors = new ArrayList();
        behaviors.addAll(this.metaObject.getOwnedBehaviors()); // For MD11.5
        behaviors.addAll(this.metaObject.getOwnedStateMachines()); // For RSM
        for (final Iterator iterator = behaviors.iterator(); iterator.hasNext() && activityGraph == null;)
        {
View Full Code Here

                if (visibility.equalsIgnoreCase("protected"))
                {
                    kind = VisibilityKind.PROTECTED_LITERAL;
                }
                property.setVisibility(kind);
                Stereotype stereotype =
                    UmlUtilities.findApplicableStereotype(
                        property,
                        UMLProfile.STEREOTYPE_IDENTIFIER);
                if (stereotype == null)
                {
View Full Code Here

        final List names = new ArrayList();
        if (stereotypes != null)
        {
            for (final Iterator iterator = stereotypes.iterator(); iterator.hasNext();)
            {
                final Stereotype stereotype = (Stereotype)iterator.next();
                names.add(stereotype.getName());
            }
        }
        return names;
    }
View Full Code Here

                implements Predicate
            {
                public boolean evaluate(Object object)
                {
                    boolean valid;
                    Stereotype stereotype = (Stereotype)object;
                    String name = StringUtils.trimToEmpty(stereotype.getName());
                    valid = stereotypeName.equals(name);
                    for (Iterator itStereo = stereotype.allParents().iterator(); !valid && itStereo.hasNext();)
                    {
                        Stereotype currentStereotype = (Stereotype)itStereo.next();
                        valid = StringUtils.trimToEmpty(currentStereotype.getName()).equals(stereotypeName);
                    }
                    return valid;
                }
            }
            hasStereotype =
View Full Code Here

TOP

Related Classes of org.eclipse.uml2.Property

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.