com.linkare.zas.aspectj.utils.ZasXmlFileRequirementElement Maven / Gradle / Ivy
package com.linkare.zas.aspectj.utils;
import com.linkare.zas.exception.ElementNotFoundException;
/**
*
* @author Paulo Zenida - Linkare TI
*
*/
public enum ZasXmlFileRequirementElement {
ABSTRACT_ACCESS_MODES("abstract-access-modes"),
UNAUTHORIZED_ACCESS_IMPLEMENTOR_CLASS("unauthorized-access-implementor-class"),
TYPE("type"),
DECIDER_CLASS("decider-class"),
DECIDER_CLASSES("decider-classes"),
TRUSTS("trusts"),
TRUSTED_CLASS("trusted-class"),
ACCESS_CONTROL_INHERITED("access-control-inherited"),
FORCED("forced"),
INVOKERS("invokers"),
INVOKERS_INHERITED("invokers-inherited"),
INVOKER("invoker"),
DEPTH("depth");
private String name;
private ZasXmlFileRequirementElement(final String name) {
this.name = name;
}
public static ZasXmlFileRequirementElement convertToEnum(final String element) {
for (ZasXmlFileRequirementElement requirementElement : values()) {
if (requirementElement.name.equals(element))
return requirementElement;
}
throw new ElementNotFoundException("Element " + element + " not found.");
}
public static String getName(final ZasXmlFileRequirementElement element) {
return element.name;
}
}