Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.lang.reflect.Field;
import javax.xml.bind.annotation.XmlAttribute;

public class Main {
    public static String getAttributeName(Field field, XmlAttribute xmlAttribute) {
        String name = xmlAttribute.name();
        if ("##default".equals(name)) {
            name = null;
        }

        if (name == null) {
            name = field.getName();
        }

        return name;
    }
}