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

package com.jxml.quick.dtd;

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

public class DTDCardinalEditor extends PropertyEditorSupport 
{
		public void 
	setAsText(String text) throws java.lang.IllegalArgumentException 
	{
		DTDCardinal i;
		if ("NONE".equals(text))
			i=DTDCardinal.NONE;
		else if ("ONEMANY".equals(text))
			i=DTDCardinal.ONEMANY;
		else if ("OPTIONAL".equals(text))
			i=DTDCardinal.OPTIONAL;
		else if ("ZEROMANY".equals(text))
			i=DTDCardinal.ZEROMANY;
		else
			throw new IllegalArgumentException("invalid DTDCardinal: "+text);
		setValue(i);
	}

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