Java XML Attribute Get getAttributeName(Field field)

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

Description

get Attribute Name

License

Apache License

Declaration

static String getAttributeName(Field field) 

Method Source Code

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

import java.lang.reflect.Field;

import javax.xml.bind.annotation.XmlAttribute;

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

    static String getAttributeName(Field field) {
        XmlAttribute attribute = (XmlAttribute) field
                .getAnnotation(XmlAttribute.class);
        return !DEFAULT_NAME.equals(attribute.name()) ? attribute.name()
                : field.getName();//from www  . ja  v a 2  s  .  co  m
    }
}

Related

  1. getAttributeList(NamedNodeMap attributeMap)
  2. getAttributeMap(final Node node)
  3. getAttributeMap(NamedNodeMap nodeMap)
  4. getAttributeMap(XMLEvent evt)
  5. getAttributeMap(XMLStreamReader xmlStreamReader)
  6. getAttributeNames(Element el)
  7. getAttributeNames(Element element)
  8. getAttributeNames(final Element e)
  9. getAttributeNode(Node sNode, String attribName)