FileDocCategorySizeDatePackage
Writer.javaAPI DocExample3083Tue Dec 08 01:21:00 GMT 1998oisoft.togetherx.scripts.Rose98Export

Writer

public class Writer extends Object
author
Eugene Belyaev
version
2.1.0

Fields Summary
private PrintWriter
stream
private int
indent
Constructors Summary
public Writer(String path)


	    
	
		try {
			Reporter.Info( "filename: " + path );
		  	stream = new PrintWriter( new FileOutputStream( path ) );
			stream.flush();
			stream.print( "# @Rose98Export.Writer, version 06/18/98\n" );
			stream.print( "# Copyright (c) 1998 by Object International Software\n" );
			stream.print( "# Model generated on " + new java.util.Date() + "\n" );
		}
		catch ( java.io.IOException e )	{
			System.err.println( "Couldn't create PrintWriter for " + path );
		}
	
Methods Summary
public voidadvance()

		indent++;
	
public voidclose()

		if( stream != null ) stream.close();
	
public voidcloseObject()

		out(")");
	
private java.lang.StringinternalTab()

		String s = "";
		for( int i = 0; i < indent; i++ ) {
			s += "\t";
		}
		return s;
	
public booleanisString(java.lang.String s)

		if ( s!=null && s.indexOf('\"")>=0 )
			return true;
		//if( s.startsWith("\"") && s.endsWith("\"") ) return true;
		return false;
	
public java.lang.StringmakeBooleanString(boolean b)

		if(b) return "TRUE";
		return "FALSE";
	
public java.lang.StringmakeLongString(java.lang.String s)
!!! needs correction

		String res = "\n|";
		if( s != null )	{
			for( int i = 0; i < s.length(); i++ ) {
				if( s.charAt(i) == '\n" ) res += "\n|";
				else res += s.charAt(i);
			}
		}
		return res;
	
public java.lang.StringmakeRose98StyleQualifiedName(java.lang.String s)
Replaces the '.' with '::' in s

param
s String to convert

		String result = "";

		for( int i = 0; i < s.length(); i++ ) {
			if( s.charAt(i) == '." ) result += "::";
			else result += s.charAt(i);
		}
		return result;
	
public java.lang.StringmakeStateString(java.lang.String s)

		String result = "";

		for( int i = 0; i < s.length(); i++ ) {
			if( s.charAt(i) == '." ) result += ":";
			else result += s.charAt(i);
		}
		return result;
	
public java.lang.StringmakeString(java.lang.String s)

		if( s != null )	return "\"" + s + "\"";
		return "\"\"";
	
public java.lang.StringmakeString()

		return makeString(null);
	
public voidnewline()

		out("");
	
public voidout(java.lang.String outstring)

		if( stream != null ) stream.print( internalTab() + outstring + "\n" );
	
public voidprintln(java.lang.String s)

		stream.print( s + "\n" );
	
public java.lang.StringreplaceQuotationMarks(java.lang.String s)

		String result = "";

		for( int i = 0; i < s.length(); i++ ) {
			if( s.charAt(i) == '\"" ) result += "'";
			else result += s.charAt(i);
		}
		return result;
	
public voidretreat()

		indent--;
	
public java.lang.Stringtab()

		return "\t";