Here you can find the source of getAttributeName(Field field)
static String getAttributeName(Field field)
//package com.java2s; //License from project: Apache License import java.lang.reflect.Field; import javax.xml.bind.annotation.XmlAttribute; public class Main { private static final String DEFAULT_NAME = "##default"; static String getAttributeName(Field field) { XmlAttribute attribute = (XmlAttribute) field .getAnnotation(XmlAttribute.class); return !DEFAULT_NAME.equals(attribute.name()) ? attribute.name() : field.getName();//from www . ja v a 2 s . co m } }