Package org.eclipse.uml2.uml

Examples of org.eclipse.uml2.uml.Property


      }
   
      if (oVar != null) {
        // nothing - variables do not have fixed values
      } else if (oPropExp.getElement() instanceof Property) {
        Property oProp = (Property) oPropExp.getElement();
        if (oProp.getDefaultValue() == null) {
          // if only a boolean element is referenced, then the meaning is "= true"
          return true;
        } else {
          String sValue = oProp.getDefaultValue().stringValue();
          return Boolean.parseBoolean(sValue);
        }
      }
      if (oPropExp.getElement() instanceof EReferenceImpl) {
        EReferenceImpl oRef = (EReferenceImpl) oPropExp.getElement();
View Full Code Here


   
      if (oVar != null) {
        // nothing - variables do not have fixed values
      }
      else if (oPropExp.getElement() instanceof Property) {
        Property oProp = (Property) oPropExp.getElement();
        if (oProp.getDefaultValue() == null) {
          throw new Exception("error in getValue() for property "
              + oProp.getName());
        } else {
          String sValue = oProp.getDefaultValue().stringValue();
          return sValue;
        }
      }
      else if (oPropExp.getElement() instanceof EReferenceImpl) {
        EReferenceImpl oRef = (EReferenceImpl) oPropExp.getElement();
View Full Code Here

   
      if (oVar != null) {
        // nothing - variables do not have fixed values
      }
      else if (oPropExp.getElement() instanceof Property) {
        Property oProp = (Property) oPropExp.getElement();
        if (oProp.getDefaultValue() == null) {
          throw new Exception("error in getValue() for property "
              + oProp.getName());
        } else {
          String sValue = oProp.getDefaultValue().stringValue();
          return sValue;
        }
      }
      else if (oPropExp.getElement() instanceof EReferenceImpl) {
        EReferenceImpl oRef = (EReferenceImpl) oPropExp.getElement();
View Full Code Here

   */
  public static void main(String[] args) throws Exception {
    readCmdArgs(args);
    Model model = (Model) load(inFile).get(0);
    Class umlClass = (Class) model.getOwnedMembers().get(0).getOwnedElements().get(0);
    Property umlProperty = (Property) umlClass.getOwnedAttributes().get(0);
   
    //initialize OCL stuff
    OCL ocl = OCL.newInstance();
    Helper helper = ocl.createOCLHelper();
    out(OCL.initialize(OCLParser.RESOURCE_SET));
View Full Code Here

    // references from system attributes to the corresponding getter operations
    AttributeGetterReferencer oAttrOpRef = m_oTCGHelper.getAttributeGetterReferencer();
   
    if(in_oAtomExp.getOclReference() instanceof PropertyCallExp)
    {
      Property oPropReference = (Property)(((PropertyCallExp)in_oAtomExp.getOclReference()).getReferredProperty());
      VariableExp oVarExp = TestCaseGraphHelper.getVariable(in_oAtomExp.getOclReference());
      if(oVarExp != null)
      {
        boolean bFoundMatchingParameterInstance = false;
        for(EventParameterInstance oParameterInstance : TCGParameterHelperClass.
            findTransitionInstanceDefiningTheCurrentEvent(in_oTransitionInstance).getParameterInstances())
        {
          if(oParameterInstance.getParameter().getReference().equals(oPropReference))
          {
            in_oFormattedOutput.append(
                TCGParameterHelperClass.
                getFullParameterInstanceAttributeName(oParameterInstance));
            if(oParameterInstance.getParameter().getValueType() instanceof TypedElement) {
              TypedElement oVT = (TypedElement)oParameterInstance.getParameter().getValueType();
              in_oFormattedOutput.append(getTypeNameAccessFunction(oVT.getType().getName()));
            }
            bFoundMatchingParameterInstance = true;
          }
        }
        // found no actually used parameter instance for the property reference
        // -> search for parameter
        if(bFoundMatchingParameterInstance == false)
        {
          String sPropName = TestCaseGraphHelper.getFullPropertyName(oPropReference, oVarExp.getType());
          in_oFormattedOutput.append(oVarExp.getName()
              + TCGParameterHelperClass.findTransitionInstanceDefiningTheCurrentEvent(
                  in_oTransitionInstance).getName() + "."
              + sPropName);
          in_oFormattedOutput.append(getTypeNameAccessFunction(oVarExp.getType().getName()));
        }
      }
      else
      {
        // TODO unvollst�ndige Ausgabebehandlung -> inwiefern?
        // get getter operation
        String sPropName = oPropReference.getName();
        Operation oOp = oAttrOpRef.get(oPropReference);
        if(oOp != null) {
          sPropName = oOp.getName() + "()";
        }
        in_oFormattedOutput.append(m_sObjectName + "." + sPropName);
        in_oFormattedOutput.append(getTypeNameAccessFunction(oPropReference.getType().getName()));
      }
    }   
    else if(in_oAtomExp.getOclReference() instanceof VariableExp)
    {
      for(EventParameterInstance oParameterInstance : TCGParameterHelperClass.
View Full Code Here

        if(toBeAdd.getType() != null && !AllVariables.contains(toBeAdd))
          AllVariables.add(toBeAdd);   
      }
    }
    else if (tcgOCLAtomConstraint.getElement() instanceof Property) {  //class property
      Property oProp = (Property) tcgOCLAtomConstraint.getElement();

      //Add property
      TCGVariable toBeAdd = new TCGVariable();
      if(oProp.getDefaultValue() != null)
        toBeAdd.setInitialValue(oProp.getDefaultValue().stringValue());
      toBeAdd.setName(oProp.getName());
      toBeAdd.setType(typeOfProperty(oProp.getType()));
      toBeAdd.setIsParameter(false);
      if(toBeAdd.getType() != null && !AllVariables.contains(toBeAdd))
        AllVariables.add(toBeAdd);
    }   
  }
View Full Code Here

   * Edit part for which a handler must be found
   * @return Handler corresponding to the given edit part
   */
  public IElementHandling findHandler(EditPart p) {
    Class classSel = null;
    Property propSel = null;
    Operation opSel = null;
    Package packSel = null;
    String name = new String();
    // We get the underlying UML element in its specialized form
    if(p.getModel() instanceof Node) {
View Full Code Here

   * <!-- begin-user-doc --> <!-- end-user-doc -->
   *
   * @generated
   */
  public void setItemProperty(Property newItemProperty) {
    Property oldItemProperty = itemProperty;
    itemProperty = newItemProperty;
    if(eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, PortandflowsPackage.ITEM_FLOW__ITEM_PROPERTY, oldItemProperty, itemProperty));
  }
View Full Code Here

   * <!-- begin-user-doc --> <!-- end-user-doc -->
   *
   * @generated
   */
  public void setBase_Property(Property newBase_Property) {
    Property oldBase_Property = base_Property;
    base_Property = newBase_Property;
    if(eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, BlocksPackage.DISTRIBUTED_PROPERTY__BASE_PROPERTY, oldBase_Property, base_Property));
  }
View Full Code Here

   * <!-- begin-user-doc --> <!-- end-user-doc -->
   *
   * @generated
   */
  public void setBase_Property(Property newBase_Property) {
    Property oldBase_Property = base_Property;
    base_Property = newBase_Property;
    if(eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, BlocksPackage.PARTICIPANT_PROPERTY__BASE_PROPERTY, oldBase_Property, base_Property));
  }
View Full Code Here

TOP

Related Classes of org.eclipse.uml2.uml.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.