// Path: src/main/java/de/jformchecker/criteria/ValidationResult.java
// public class ValidationResult {
// 
// 	boolean isValid = false;
// 	
// 	// caching:
// 	private static ValidationResult okResult =  new ValidationResult(true, "", null, null);
// 
// 	public boolean isValid() {
// 		return isValid;
// 	}
// 
// 	public String getMessage() {
// 		return message;
// 	}
// 
// 	public Object[] getErrorVals() {
// 		return errorVals;
// 	}
// 
// 	String message;
// 	String translatedMessage;
// 	Object[] errorVals;
// 
// 	public ValidationResult(boolean isValid, String message, Object[] errorVals, String translatedMessage) {
// 		this.isValid = isValid;
// 		this.message = message;
// 		this.errorVals = errorVals;
// 		this.translatedMessage = translatedMessage;
// 	}
// 
// 	// factory methods
// 	public static ValidationResult of_(boolean isValid, String message, Object... errorVals) {
// 		return new ValidationResult(isValid, message, errorVals, null);
// 	}
// 
// 	public static ValidationResult fail(String message, Object... errorVals) {
// 		return new ValidationResult(false, message, errorVals, null);
// 	}
// 
// 	public static ValidationResult failWithTranslated(String message, Object... errorVals) {
// 		return new ValidationResult(false, null, errorVals, message);
// 	}
// 
// 	public static ValidationResult failWithTranslated(String message) {
// 		return new ValidationResult(false, null, new Object[0], message);
// 	}
// 	
// 	public static ValidationResult ok() {
// 		// RFE: Could return always the same object! will reduce memory
// 		// footprint!
// 		return okResult;
// 	}
// 
// 	public String getTranslatedMessage() {
// 		return translatedMessage;
// 	}
// 
// }


import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import de.jformchecker.criteria.ValidationResult;
	// input-element via a macro!
	public String getElement(String name) {
		return formBuilder.generateHtmlForElement(fc.firstRun, fc.config.getProperties(), form.getElement(name), this.form.isHtml5Validation());
	}
	
	public List<String> getElementNames() {
		List<String> elementNames = new ArrayList<>();
		form.elements.forEach((elem) -> elementNames.add(elem.getName()));
		return elementNames;
	}

	public String getInput(String name) {
		return form.getElement(name).getInputTag();
	}

	public String getInput(String name, Map<String, String> map) {
		return form.getElement(name).getInputTag(map);
	}
	
	
	public String getType(String name) {
		return form.getElement(name).getType();
	}

	
	public boolean isError(String name) {
		return !formBuilder.getErrors(form.getElement(name), fc.firstRun).isValid();
	}

	public String getError(String name) {
// Path: src/main/java/de/jformchecker/criteria/ValidationResult.java
// public class ValidationResult {
// 
// 	boolean isValid = false;
// 	
// 	// caching:
// 	private static ValidationResult okResult =  new ValidationResult(true, "", null, null);
// 
// 	public boolean isValid() {
// 		return isValid;
// 	}
// 
// 	public String getMessage() {
// 		return message;
// 	}
// 
// 	public Object[] getErrorVals() {
// 		return errorVals;
// 	}
// 
// 	String message;
// 	String translatedMessage;
// 	Object[] errorVals;
// 
// 	public ValidationResult(boolean isValid, String message, Object[] errorVals, String translatedMessage) {
// 		this.isValid = isValid;
// 		this.message = message;
// 		this.errorVals = errorVals;
// 		this.translatedMessage = translatedMessage;
// 	}
// 
// 	// factory methods
// 	public static ValidationResult of_(boolean isValid, String message, Object... errorVals) {
// 		return new ValidationResult(isValid, message, errorVals, null);
// 	}
// 
// 	public static ValidationResult fail(String message, Object... errorVals) {
// 		return new ValidationResult(false, message, errorVals, null);
// 	}
// 
// 	public static ValidationResult failWithTranslated(String message, Object... errorVals) {
// 		return new ValidationResult(false, null, errorVals, message);
// 	}
// 
// 	public static ValidationResult failWithTranslated(String message) {
// 		return new ValidationResult(false, null, new Object[0], message);
// 	}
// 	
// 	public static ValidationResult ok() {
// 		// RFE: Could return always the same object! will reduce memory
// 		// footprint!
// 		return okResult;
// 	}
// 
// 	public String getTranslatedMessage() {
// 		return translatedMessage;
// 	}
// 
// }


// Path: src/main/java/de/jformchecker/View.java
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import de.jformchecker.criteria.ValidationResult;

	// input-element via a macro!
	public String getElement(String name) {
		return formBuilder.generateHtmlForElement(fc.firstRun, fc.config.getProperties(), form.getElement(name), this.form.isHtml5Validation());
	}
	
	public List<String> getElementNames() {
		List<String> elementNames = new ArrayList<>();
		form.elements.forEach((elem) -> elementNames.add(elem.getName()));
		return elementNames;
	}

	public String getInput(String name) {
		return form.getElement(name).getInputTag();
	}

	public String getInput(String name, Map<String, String> map) {
		return form.getElement(name).getInputTag(map);
	}
	
	
	public String getType(String name) {
		return form.getElement(name).getType();
	}

	
	public boolean isError(String name) {
		return !formBuilder.getErrors(form.getElement(name), fc.firstRun).isValid();
	}

	public String getError(String name) {
		ValidationResult vr = formBuilder.getErrors(form.getElement(name), fc.firstRun);