All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.anotheria.asg.generator.parser.OptionsParser Maven / Gradle / Ivy

package net.anotheria.asg.generator.parser;

import java.util.List;

import org.jdom.Element;

import net.anotheria.asg.generator.GenerationOption;
import net.anotheria.asg.generator.GenerationOptions;

public final class OptionsParser {
	public static final GenerationOptions parseOptions(Element element){
		GenerationOptions ret = new GenerationOptions();
		
		if (element==null)
			return ret;
		
		@SuppressWarnings("unchecked")
		List options = (List)element.getChildren("option");
		
		for (Element option : options){
			ret.set(new GenerationOption(option.getAttributeValue("name"), option.getText()));
		}
		
		return ret;
	}
	
	/**
	 * Prevent instantiation.
	 */
	private OptionsParser(){
		
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy