Here you can find the source of getElementName(Field field)
static String getElementName(Field field)
//package com.java2s; //License from project: Apache License import java.lang.reflect.Field; import javax.xml.bind.annotation.XmlElement; public class Main { private static final String DEFAULT_NAME = "##default"; static String getElementName(Field field) { XmlElement element = (XmlElement) field .getAnnotation(XmlElement.class); return !DEFAULT_NAME.equals(element.name()) ? element.name() : field.getName();/*w w w. j av a 2s. c o m*/ } }