Here you can find the source of getElementName(Object obj)
Parameter | Description |
---|---|
obj | the object |
private static String getElementName(Object obj)
//package com.java2s; /*/*from w w w . j a v a 2 s.c o m*/ * Copyright (c) 2014 eSOL Co.,Ltd. and Nagoya University * * This software is released under the MIT License. * http://opensource.org/licenses/mit-license.php */ import javax.xml.bind.annotation.XmlType; public class Main { /** * Returns the element name of the spedified object. * * @param obj * the object * @return XmlType.name() */ private static String getElementName(Object obj) { XmlType xmlType = obj.getClass().getAnnotation(XmlType.class); if (xmlType != null && xmlType.name() != null) { return xmlType.name(); } return null; } }