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

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

/*******************************************************************************
 * 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
 *******************************************************************************/

/*
 * @(#) $Id: SWTPreinstall.java 2084 2007-11-27 14:53:31Z s3460 $
 */

package at.spardat.xma.boot.comp.data;

import java.io.PrintStream;

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

/**
 * This class represents the preinstall tag from xma-app.xml.
 * It contains a version number, specifing the version of swt to use if allready installed.
 * @author s2877
 */
public class SWTPreinstall {

    /** version of swt to use if allready installed */
    private String version;

    /** Constructor, sets the version */
    SWTPreinstall(String version) {
        this.version=version;
    }

    /**
     * write this object to a xml print stream.
     *
     * @param ps the PrintStream to write to
     */
    public void writeXML( PrintStream ps ) {
        ps.print( DTDStatics.OPEN + DTDStatics.PREINSTALL );
        ps.print( DTDStatics.SP + DTDStatics.PREINSTALL_VERSION + DTDStatics.QUOTE + this.version + DTDStatics.E_QUOTE );
        ps.print( DTDStatics.SP + DTDStatics.CLOSE_SIMPLES );
    }

    /** returns the version string */
    public String getVersion() {
        return version;
    }

    /** sets the version string */
    public void setVersion(String version) {
        this.version = version;
    }

    /** Converts the given version string to its directory representation.
     *  It simply replaces all dots with underscores. */
    public static String toDirName(String version) {
        return version.replace('.','_');
    }

    /** Returns the version string in its directory representation.
     *  All dots are replaced by underscores. */
    public String getVersionDir() {
        return version.replace('.','_');
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy