//copyright=> http://www.jxml.com/mdsax/License.txt

package com.jxml.quick.dtd;

import com.wutka.dtd.DTDDecl;
import java.beans.*;

public class DTDDeclEditor extends PropertyEditorSupport 
{
		public void 
	setAsText(String text) throws java.lang.IllegalArgumentException 
	{
		DTDDecl i;
		if ("FIXED".equals(text))
			i=DTDDecl.FIXED;
		else if ("REQUIRED".equals(text))
			i=DTDDecl.REQUIRED;
		else if ("IMPLIED".equals(text))
			i=DTDDecl.IMPLIED;
		else if ("VALUE".equals(text))
			i=DTDDecl.VALUE;
		else
			throw new IllegalArgumentException("invalid DTDDecl: "+text);
		setValue(i);
	}

		public String
	getAsText()
	{
		return ((DTDDecl)getValue()).name;
	}
}
