Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import javax.xml.bind.annotation.XmlRootElement;

public class Main {
    private static final String DEFAULT_NAME = "##default";

    static String getRootElementName(Class<?> clazz) {
        XmlRootElement element = (XmlRootElement) clazz.getAnnotation(XmlRootElement.class);
        return !DEFAULT_NAME.equals(element.name()) ? element.name() : clazz.getSimpleName();
    }
}