package org.gluu.oxtrust.util;

import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.validator.FacesValidator;
import javax.faces.validator.Validator;
import javax.faces.validator.ValidatorException;

import org.gluu.util.StringHelper;

@FacesValidator("gluuAttributeValidator")
public class GluuAttributeValidator implements Validator {
	@Override
	public void validate(FacesContext context, UIComponent comp, Object value) {
		String attributeValue = (String) value;
		if (StringHelper.isEmpty(attributeValue)) {
			FacesMessage message = new FacesMessage("Value is required");
			message.setSeverity(FacesMessage.SEVERITY_ERROR);
			throw new ValidatorException(message);
		}

	}

}

@@ -288,16 +288,67 @@
 ption;%0A%0A
+import org.gluu.model.attribute.AttributeDataType;%0A
 import o
@@ -574,16 +574,145 @@
 %09String 
+attributeValue;%0A%09%09if(value instanceof AttributeDataType) %7B%0A%09%09%09attributeValue=((AttributeDataType)value).getValue();%0A%09%09%7Delse %7B%0A%09%09%09
 attribut
@@ -732,24 +732,28 @@
 ing) value;%0A
+%09%09%7D%0A
 %09%09if (String

Fix validator