![JAR search and dependency download from the Maven repository](/logo.png)
org.jvnet.jaxb.annox.parser.value.XEnumAnnotationValueParser Maven / Gradle / Ivy
The newest version!
package org.jvnet.jaxb.annox.parser.value;
import org.jvnet.jaxb.annox.model.annotation.value.XAnnotationValue;
import org.jvnet.jaxb.annox.model.annotation.value.XEnumAnnotationValue;
import org.jvnet.jaxb.annox.parser.exception.ValueParseException;
import org.jvnet.jaxb.annox.parser.java.visitor.EnumExpressionVisitor;
import org.jvnet.jaxb.annox.parser.java.visitor.ExpressionVisitor;
public class XEnumAnnotationValueParser extends
XAnnotationValueParser, Enum>> {
@Override
public XAnnotationValue> parse(String value, Class> type)
throws ValueParseException {
@SuppressWarnings({ "unchecked", "rawtypes" })
final Class extends Enum> enumClass = (Class extends Enum>) type;
@SuppressWarnings({ "rawtypes", "unchecked" })
final XAnnotationValue> annotationValue = new XEnumAnnotationValue(
Enum.valueOf(enumClass, value));
return annotationValue;
}
@Override
public XAnnotationValue> construct(Enum> value, Class> type) {
@SuppressWarnings({ "unchecked", "rawtypes" })
final XAnnotationValue> annotationValue = new XEnumAnnotationValue(
value);
return annotationValue;
}
@Override
public ExpressionVisitor>> createExpressionVisitor(
Class> type) {
return new EnumExpressionVisitor(type);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy