Package org.eclipse.bpel.common.extension.model

Examples of org.eclipse.bpel.common.extension.model.Extension


       *
       * @returns the next element in the iteration.
       * @exception NoSuchElementException iteration has no more elements.
       */
      public Object next() {
        Extension object = (Extension)fieldListIterator.next();
        if (object == null)
          return new Entry(null, null);
        return new Entry(object.getExtendedObject(),object.getExtensionObject());
      }
View Full Code Here


       *
       * @returns the next element in the iteration.
       * @exception NoSuchElementException iteration has no more elements.
       */
      public Object next() {
        Extension object = (Extension)fieldListIterator.next();
        if (object == null)
          return null;
        return object.getExtendedObject();
      }
View Full Code Here

       *
       * @returns the next element in the iteration.
       * @exception NoSuchElementException iteration has no more elements.
       */
      public Object next() {
        Extension object = (Extension)fieldListIterator.next();
        if (object == null)
          return null;
        return object.getExtensionObject();
      }
View Full Code Here

        Object result = caseExtensionMap(extensionMap);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case ExtensionmodelPackage.EXTENSION: {
        Extension extension = (Extension)theEObject;
        Object result = caseExtension(extension);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      default: return defaultCase(theEObject);
View Full Code Here

      case Notification.SET :  // either the extendedObject or extensionObject was changed.
     
        // need to eliminate this extension object from the ExtensionMap.  If, both the extendedObject
        // and extensionObjects are null and the Extension is cointained by the ExtensionMap then
        // remove it form the list. 
        Extension extension = (Extension) notification.getNotifier();
       
        if(extension.getExtendedObject() == null && extension.getExtensionObject() == null &&
             extension.eContainer() != null){

          ExtensionMap extensionSet = (ExtensionMap)extension.eContainer();
         
          if(extensionSet != null && extensionSet.getExtensions().contains(extension))
            extensionSet.getExtensions().remove(extension);
        }
             
        // If the extendedObject is not null set it to null now     
        if (extension.getExtendedObject() != null)
          extension.setExtendedObject(null);
       
        //  If the extensionObject is not null set it to null now 
        if (extension.getExtensionObject() != null)
          extension.setExtensionObject(null);
       
        break;
       
      default :
        break;
View Full Code Here

            extensionList = new BasicEList();
            extensionList.add(notification.getOldValue());
          }
           
          for (Iterator iter = extensionList.iterator(); iter.hasNext();) {
            Extension extension = (Extension) iter.next();
           
            EObject extendedObject = extension.getExtendedObject();
           
            // if the exended EObject had an adapter, remove it.
            if(extendedObject != null){
              EList adapters = extendedObject.eAdapters();
              EList removeAdapterList = new BasicEList();             
              for (Iterator iter2 = adapters.iterator();iter2.hasNext();) {
                Adapter adapter = (Adapter) iter2.next();
               
                if((adapter instanceof ExtendedObjectUserAdapter && ((ExtendedObjectUserAdapter)adapter).getNamespace().equals(((ExtensionMap)getTarget()).getNamespace()))||
                    adapter instanceof ExtendedObjectAdapter && ((ExtendedObjectAdapter)adapter).getNamespace().equals(((ExtensionMap)getTarget()).getNamespace())){
                  removeAdapterList.add(adapter)
                }
              } 
                
                 for (Iterator iter2 = removeAdapterList.iterator(); iter2.hasNext();) {
                   Adapter adapter = (Adapter) iter2.next();
                   try{
                     ((ExtendedObjectAdapter)adapter).setExtension(null);
                   }catch(ClassCastException e){}
                   extendedObject.eAdapters().remove(adapter);
              }
            }
           
            // Set the Extension attributes to null.
            if (!(notification.getNotifier() instanceof Extension)){
              if(extension.getExtendedObject() != null)
                extension.setExtendedObject(null);
           
              if(extension.getExtensionObject() != null
                extension.setExtensionObject(null);
            }
             
          }
          break;
 
View Full Code Here

   
    EObject originalObject = null;
   
    if(extendedObject != null && extensionObject!= null){
           
      Extension extension = getExtensionObject((EObject)extendedObject);
     
      if(extension!= null)
        originalObject = extension.getExtensionObject()
      else {
        extension = ExtensionmodelFactory.eINSTANCE.createExtension();
        getExtensions().add(extension);
      }

      extension.setExtendedObject((EObject)extendedObject);
      extension.setExtensionObject((EObject)extensionObject);
           
      ExtensionmodelAdapterFactory adapterFactory = new ExtensionmodelAdapterFactory();
     
      ExtendedObjectAdapter extAdptr = (ExtendedObjectAdapter) adapterFactory.createExtendedObjectAdapter();
     
View Full Code Here

   */
  public Object remove(Object extendedObject) {
    if(extendedObject == null)
      return null;
    else{
      Extension extensionObject = getExtensionObject((EObject)extendedObject);
      if(getExtensions().contains(extensionObject)){
        Object oldExtension = extensionObject.getExtensionObject();
        getExtensions().remove(extensionObject);
        if (eNotificationRequired())
          eNotify(new ExtensionModelNotificationImpl(this, Notification.REMOVE, ExtensionModelNotification.EXTENSION_MAP_REMOVE, extendedObject, oldExtension));
      }
     
      // Remove adapter if one exists
      removeAdapters((EObject) extendedObject);
       
      if(extensionObject != null)
        return extensionObject.getExtensionObject();
      else
        return null;
    }
  }
View Full Code Here

   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @customized
   */
  private Extension getExtensionObject(EObject extendedObject) {
    Extension extension = null;

    if(extendedObject!=null){
   
      // First check if the is an adapted associated with this object.
      // If there is, the adapter points to the Extension object.  Return this
      // object.
      EList adapterList = extendedObject.eAdapters();
         
      for (Iterator iter = adapterList.iterator(); iter.hasNext();) {
        Adapter element = (Adapter) iter.next();
        if(element instanceof ExtendedObjectAdapter && ((ExtendedObjectAdapter)element).getNamespace().equals(getNamespace())){
          extension = ((ExtendedObjectAdapter)element).getExtension();
          break;
        }
      }
         
      // Was the extension found though the adapter?  Not if it's null.
      // There is no adapter associated with this bject so we must search the
      // Extension list.  Once the Extension is found, associate an adapter with this
      // object to improve performance in future queries.
      if(extension == null){
         
        EList extensionList = getExtensions();
           
        for (Iterator iter = extensionList.iterator(); iter.hasNext();) {
          Extension ext = (Extension) iter.next();
         
          if (ext.getExtendedObject() != null && ext.getExtendedObject().equals(extendedObject)){
            extension = ext;
           
            ExtensionmodelAdapterFactory adapterFactory = new ExtensionmodelAdapterFactory();
       
            ExtendedObjectAdapter extAdptr = (ExtendedObjectAdapter) adapterFactory.createExtendedObjectAdapter();
View Full Code Here

     if(!buildMap)
       return null;
    
    Map map = new HashMap();
    for (Iterator iter = getExtensions().iterator(); iter.hasNext();) {
      Extension element = (Extension) iter.next();
      map.put(element.getExtendedObject(), element.getExtensionObject());       
    }   
    return map;
   }
View Full Code Here

TOP

Related Classes of org.eclipse.bpel.common.extension.model.Extension

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.