package com.jxml.quick.config;
import com.jxml.quick.*;
import com.jxml.protocol.*;
import org.xml.sax.*;
import java.io.*;
import java.util.*;

public class RequiredItem implements Item
{
	public String name;
	public String fieldLength;

	public void eval(Map properties, List args, ClassLoader cl)
	{
		String pattern="-" + name;
		int i,s;
		s=args.size();
		for(i=0;i<s;i++)
		{
			if((args.get(i)).equals(pattern))
			{
				properties.put(name,args.get(i+1));
				args.remove(i+1);
				args.remove(i);
				return;
			}	
		}
		if (properties.containsKey(name))
			return;
		String message="Missing parameter: "+name;
		throw new IllegalArgumentException(message);
	}
}