/*
 * @(#)RWarningException.java
 *
 * Copyright 2001 Nomura Research Institute, LTD. All rights reserved.
 *
 * RID-X : アナライザ等で処理を継続したいときにthrowされる例外クラス
 *
 * @author  Intelligent Technology Inc.
 * @version 1.01 2002/02/21
 */
package	jp.co.nri.rid.analyzer;
import jp.co.nri.rid.error.*;

/**
 * 警告を知らせる例外クラス
 */

public class RWarningException extends Exception{
    private StringBuffer	warnings;
    private RidMessage		messages;
	public RWarningException(){
		super();
		warnings	= new StringBuffer();
		messages	= new RidMessage();
	}
    public RWarningException(String code ,String text){
		super();
		warnings	= new StringBuffer();
		messages	= new RidMessage();
		add(code ,text);
	}
    public String	getMessage(){ return warnings.toString(); }
    public void		add(String code ,String text){ warnings.append(messages.Warning(code,text)+"\n"); }
    public void		add(RWarningException child){
		if(0>=child.length())	return;
		warnings.append(child.getMessage());
	}
    public int		length(){ return warnings.length(); }
}
