use of org.apache.tomcat.util.bcel.classfile.AnnotationElementValue in project tomcat by apache.
the class ContextConfig method processAnnotationWebInitParams.
protected Map<String, String> processAnnotationWebInitParams(ElementValue ev) {
Map<String, String> result = new HashMap<>();
if (ev instanceof ArrayElementValue) {
ElementValue[] arrayValues = ((ArrayElementValue) ev).getElementValuesArray();
for (ElementValue value : arrayValues) {
if (value instanceof AnnotationElementValue) {
List<ElementValuePair> evps = ((AnnotationElementValue) value).getAnnotationEntry().getElementValuePairs();
String initParamName = null;
String initParamValue = null;
for (ElementValuePair evp : evps) {
if ("name".equals(evp.getNameString())) {
initParamName = evp.getValue().stringifyValue();
} else if ("value".equals(evp.getNameString())) {
initParamValue = evp.getValue().stringifyValue();
} else {
// Ignore
}
}
result.put(initParamName, initParamValue);
}
}
}
return result;
}
Aggregations