Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Copyright (c) 2003, 2007 s IT Solutions AT Spardat GmbH . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html Contributors: s IT Solutions AT Spardat GmbH - initial API and implementation /
 
 
 /*
  * Created on : 04.2003
  * Created by : s3595
  */
 package at.spardat.xma.boot.comp.data;
 
 
Encapsulates application description data

Author(s):
s3595 Chris Sch�fer (CGS)
Version:
$Id: XMAApp.java 2902 2008-11-12 13:59:09Z gub $
 
 public class XMAApp {

    
application descriptor remote url
 
     private XMA_URI applicationDescrURI;

    
application components of type XMAComponents
 
     public HashMap components_;

    
common, shared resources for this application
 
     public HashMap res_;

    
referenced plugin implemenation descriptions of type XMAPluginImpl
 
     public HashMap pluginimpl_;

    
this application needs an implementation for these plugin�s
 
     public ArrayList pluginspec_;

    
holds the description of SWT needed by the application
 
 
     private void init() {
          = new HashMap(10);
                 = new HashMap(25);
          = new HashMap(10);
          = new ArrayList(10);
 
     }
 
     public XMAApp( ) {
        init();
     }

    
Return all resources of this XMAApp in one HashMap. This are all resources described in the corresponding xma-appl.xml file. This contains the top level resources, the resources of all components, the rescources of all pluginimpls and the resources of an optional swt-description.
 
     public HashMap getAllResources() {
         return getAllResources(false);
     }

    
Return all resources of this XMAApp to be downloaded. If fdm=true, this are all resources described in the corresponding xma-appl.xml file. If fdm=false, the resources declared in components are omitted unless they have the fmdLoad flag set to true. Top level resources, the rescources of all pluginimpls and the resources of an optional swt-description are contained anyway.
 
     public HashMap getAllResources(boolean fdm) {
 
         HashMap map = new HashMap.size() + .size()*3 + .size()*2 );
 
         map.putAll);
        for (Iterator iter = .values().iterator(); iter.hasNext();) {
            XMAComponent element = (XMAComponent)iter.next();
            HashMap res = element.getRes();
            if(fdm) {
                for(Iterator it=res.keySet().iterator();it.hasNext();) {
                    String key = (String)it.next();
                    XMAResource resource = (XMAResource)res.get(key);
                    if(resource.isFdmload()) {
                        map.put(keyresource);
                    }
                }
            } else {
                map.putAll(res);
            }
        }
        for (Iterator iter = .values().iterator(); iter.hasNext();) {
            XMAPluginImpl element = (XMAPluginImpl)iter.next();
            HashMap res = element.getRes();
            map.putAll(res);
        }
        if(!=null) {
            map.putAll(.getResources());
        }
        return map;
    }
    public void writeXMLPrintStream ps ) {
       ps.println. );
       ps.println();
       ps.println();
       for (Iterator iter = .values().iterator(); iter.hasNext();) {
           XMAComponent element = (XMAComponent)iter.next();
           element.writeXML(ps);
           ps.println();
       }
       for (Iterator iter = .values().iterator(); iter.hasNext();) {
           XMAResource element = (XMAResource)iter.next();
           ps.print("   "); //$NON-NLS-1$
           element.writeXML(ps);
           ps.println();
       }
       ps.println();
       for (Iterator iter = .iterator(); iter.hasNext();) {
           XMAPluginSpec element = (XMAPluginSpec)iter.next();
           ps.print("   "); //$NON-NLS-1$
           element.writeXML(ps);
           ps.println();
       }
       ps.println();
       for (Iterator iter = .values().iterator(); iter.hasNext();) {
           XMAPluginImpl element = (XMAPluginImpl)iter.next();
           ps.print("   "); //$NON-NLS-1$
           element.writeXML(ps);
           ps.println();
       }
       if(!=null) {
           ps.print("   "); //$NON-NLS-1$
           .writeXML(ps);
           ps.println();
       }
    }
    public XMAComponent getComponentString name ) {
        return (XMAComponent)this..get(name);
    }
    public void addComponentXMAComponent c ) {
       this..putc.getName_(), c);
    }
    public void addResourceXMAResource r ) {
       this..putr.getHref_(), r);
    }
    public void addPluginImplXMAPluginImpl pi ) {
       this..putpi.getStrImplements_(), pi);
    }
    public void addPluginSpecXMAPluginSpec in ) {
       this..add(in);
    }
    public XMAPluginImpl getPluginImplString strName ) {
       return (XMAPluginImpl)this..getstrName );
    }

    

Returns:
String
    public String getName_() {
        return .getApplication();
    }

    

Returns:
HashMap
    public HashMap getRes() {
        return ;
    }

    

Parameters:
map
Returns:
void
    public void setRes(HashMap map) {
         = map;
    }

    

Returns:
XMA_URI allication uri
    public XMA_URI getApplicationDescrURI() {
        return ;
    }

    

Parameters:
xma_uri
    public void setApplicationDescrURI(XMA_URI xma_uri) {
         = xma_uri;
    }
        return ;
    }
    public void setSwtDescription(XMASWTDescription swtDescription) {
        this. = swtDescription;
    }
New to GrepCode? Check out our FAQ X