Java XML Element Get getElementName(Field field)

Here you can find the source of getElementName(Field field)

Description

get Element Name

License

Apache License

Declaration

static String getElementName(Field field) 

Method Source Code

//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*/
    }
}

Related

  1. getElementName(Class claz)
  2. getElementName(Class clazz)
  3. getElementName(Element element)
  4. getElementName(Element element)
  5. getElementName(Element element)
  6. getElementName(Object obj)
  7. getElementNameSansNamespace(Element element)
  8. getElementNamespaces(Element element, Set namespaces)
  9. getElementNamespaceURI(Element element)