Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2009, 2013 Andrew Gvozdev (Quoin Inc.).
 * 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:
 *     Andrew Gvozdev (Quoin Inc.)
 *******************************************************************************/

public class Main {
    private static String LINE_SEPARATOR = System.getProperty("line.separator");

    /**
     * <b>Do not use outside of CDT.</b> This method is a workaround for {@link javax.xml.transform.Transformer}
     * not being able to specify the line separator. This method replaces a string generated by
     * {@link javax.xml.transform.Transformer} which contains the system line.separator with the line separators
     * from an existing file or the preferences if it's a new file.
     *
     * @param string - the string to be replaced
     * @param lineSeparator - line separator to be used in the string
     * 
     * @noreference This method is not intended to be referenced by clients.
     *    This is an internal method which ideally should be made private.
     */
    public static String replaceLineSeparatorInternal(String string, String lineSeparator) {
        string = string.replace(LINE_SEPARATOR, lineSeparator);
        return string;
    }
}