String unknownQNameConstant = null;
for (EnumConstantDeclaration enumConstant : enumConstants) {
XmlUnknownQNameEnumValue unknownQNameEnumValue = enumConstant.getAnnotation(XmlUnknownQNameEnumValue.class);
if (unknownQNameEnumValue != null) {
if (unknownQNameConstant != null) {
throw new ValidationException(enumConstant.getPosition(), getQualifiedName() + ": no more than two constants can be annotated with @XmlUnknownQNameEnumValue.");
}
unknownQNameConstant = enumConstant.getSimpleName();
continue;
}
String ns = namespace;
String localPart = enumConstant.getSimpleName();
XmlQNameEnumValue enumValueInfo = enumConstant.getAnnotation(XmlQNameEnumValue.class);
if (enumValueInfo != null) {
if (enumValueInfo.exclude()) {
continue;
}
if (!"##default".equals(enumValueInfo.namespace())) {
ns = enumValueInfo.namespace();
}
if (!"##default".equals(enumValueInfo.localPart())) {
localPart = enumValueInfo.localPart();
}
}
QName qname = new QName(ns, localPart);
if (!enumValues.add(qname)) {
throw new ValidationException(enumConstant.getPosition(), getQualifiedName() + ": duplicate qname enum value: " + qname);
}
enumValueMap.put(enumConstant.getSimpleName(), qname);
}