Java XML Element Root getRootElementName(Class clazz)

Here you can find the source of getRootElementName(Class clazz)

Description

get Root Element Name

License

Apache License

Declaration

static String getRootElementName(Class<?> clazz) 

Method Source Code

//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();
    }//from  w  ww.  ja va 2  s  . c  om
}

Related

  1. getRootElement(final String respuestaPost)
  2. getRootElement(final XMLEventReader bufferedXmlEventReader)
  3. getRootElement(String elementName, String namespace, String prefix)
  4. getRootElement(String location)
  5. getRootElementFromString(String payload)
  6. getRootElementPosition(String buf, Element root)
  7. getRootFaceletElement(Document document)
  8. getRootFromPom(File pomFile)
  9. getRootFromString(String str)