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

fr.vergne.parsing.samples.xml.layer.Fields Maven / Gradle / Ivy

There is a newer version: 2.4
Show newest version
package fr.vergne.parsing.samples.xml.layer;

import java.util.NoSuchElementException;

import fr.vergne.parsing.layer.standard.Loop;

public class Fields extends Loop {

	public Fields() {
		super(new Generator() {

			@Override
			public Field generates() {
				return new Field();
			}
		});
	}

	public Field getField(String name) {
		for (Field field : this) {
			if (field.getName().getContent().equals(name)) {
				return field;
			} else {
				// continue searching
			}
		}
		throw new NoSuchElementException("No " + name
				+ " field has been found.");
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy