All Downloads are FREE. Search and download functionalities are using the official Maven repository.

at.spardat.xma.boot.comp.data.XMAPluginImpl Maven / Gradle / Ivy

There is a newer version: 1.16.0
Show newest version
/*******************************************************************************
 * 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 : 16.06.2003
 * Created by : s3595
 */
package at.spardat.xma.boot.comp.data;

import java.io.PrintStream;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;

import at.spardat.xma.boot.comp.DTDStatics;

/**
 * XMAPluginImpl
 *
 * @author s3595 Chris Sch?fer (CGS)
 * @version $Id: XMAPluginImpl.java 2084 2007-11-27 14:53:31Z s3460 $
 *
 */
public class XMAPluginImpl {

    private String implClient_;
    private String implServer_;
    private String strImplements_;

    public  HashMap res_;

    /** shared resources needed by this component */
    private ArrayList resourceLinks_;


    public XMAPluginImpl( String implClient, String implServer, String strImplements) {

        res_           = new HashMap(10);
        resourceLinks_ = new ArrayList();

        implClient_ = implClient;
        implServer_ = implServer;
        strImplements_ = strImplements;
    }

    public void writeXML( PrintStream ps ) {

       ps.print( DTDStatics.OPEN + DTDStatics.PLUGIN_IMPL );
        ps.print( DTDStatics.SP + DTDStatics.PLUGIN_IMPL_IMPLEMENTS + DTDStatics.QUOTE + strImplements_ + DTDStatics.E_QUOTE );

        if( implClient_!=null)
          ps.print( DTDStatics.SP + DTDStatics.PLUGIN_IMPL_CLIENT + DTDStatics.QUOTE + implClient_ + DTDStatics.E_QUOTE );
        if( implServer_!=null)
          ps.print( DTDStatics.SP + DTDStatics.PLUGIN_IMPL_SERVER + DTDStatics.QUOTE + implServer_ + DTDStatics.E_QUOTE );
        ps.print( DTDStatics.SP + DTDStatics.CLOSE );
        ps.println();

        for (Iterator iter = res_.values().iterator(); iter.hasNext();) {
            XMAResource element = (XMAResource)iter.next();
            ps.print("   "); //$NON-NLS-1$
            element.writeXML(ps);
            ps.println();
        }

        for (Iterator iter = resourceLinks_.iterator(); iter.hasNext();) {
            XMAResourceLink element = (XMAResourceLink)iter.next();
            ps.print("   ");             //$NON-NLS-1$
            element.writeXML(ps);
            ps.println();
         }

       ps.println( DTDStatics.OPEN + DTDStatics.CLOSE_CHAR + DTDStatics.PLUGIN_IMPL + DTDStatics.CLOSE );
    }


    public void addResourceLink( XMAResourceLink r ) {
       this.resourceLinks_.add(r);
    }

    /**
     * @return ArrayList resource links of required shared resources
     */
    public ArrayList getResourceLinks() {
        return resourceLinks_;
    }

    public void addResource( XMAResource r ) {
       this.res_.put( r.getHref_(), r);
    }

    /**
     * @return String
     */
    public String getImplClient_() {
        return implClient_;
    }

    /**
     * @return String
     */
    public String getImplServer_() {
        return implServer_;
    }

    /**
     * @return String
     */
    public String getStrImplements_() {
        return strImplements_;
    }

    /**
     * @param string
     */
    public void setImplClient_(String string) {
        implClient_ = string;
    }

    /**
     * @param string
     */
    public void setImplServer_(String string) {
        implServer_ = string;
    }

    /**
     * @param string
     */
    public void setStrImplements_(String string) {
        strImplements_ = string;
    }

    /**
     * @return HashMap
     */
    public HashMap getRes() {
        return res_;
    }

    /**
     * @param map
     */
    public void setRes(HashMap map) {
        res_ = map;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy