public String name() { return core.name(); }
/** * Puts definitions for XML element. * * @param element XmlElement * @param property property instance to be updated */ private static void applyElement(XmlElement element, Schema property) { if (element != null) { setName(element.namespace(), element.name(), property); } }
/** * Computes the tag name from a {@link XmlElement} by taking the defaulting into account. */ protected final QName calcXmlName(XmlElement e) { if(e!=null) return calcXmlName(e.namespace(),e.name()); else return calcXmlName("##default","##default"); }
public String name() { return core.name(); }
/** * Computes the tag name from a {@link XmlElement} by taking the defaulting into account. */ protected final QName calcXmlName(XmlElement e) { if(e!=null) return calcXmlName(e.namespace(),e.name()); else return calcXmlName("##default","##default"); }
if (annotation instanceof XmlElement) { XmlElement xmlElement = (XmlElement) annotation; if (xmlElement != null && xmlElement.name() != null && !"".equals(xmlElement.name()) && !"##default".equals(xmlElement.name())) { XML xml = items.getXml() != null ? items.getXml() : new XML(); xml.setName(xmlElement.name()); items.setXml(xml);
return _combineNames(element.name(), element.namespace(), defaultName);
/** * Returns the expandable annotation with the properly set value. The value is defined as the first valid point in the following list: * <ol> * <li>the value of the {@link Expandable} annotation if it is set</li> * <li>the name of an {@link XmlElement} if the annotation is present on the field and its name is not {@code ##default}</li> * <li>the name of the field</li> * <ol> * * @param field the field to look up the Expandable for * @return {@code null} if the field is null, {@code null} if the field doesn't have an expandable annotation, * an expandable annotation with a properly set value. */ Expandable getExpandable(final Field field) { if (field == null) { return null; } final Expandable expandable = field.getAnnotation(Expandable.class); if (expandable == null) { return null; } if (StringUtils.isNotEmpty(expandable.value())) { return expandable; } final XmlElement xmlElement = field.getAnnotation(XmlElement.class); if (xmlElement != null && StringUtils.isNotEmpty(xmlElement.name()) && !StringUtils.equals("##default", xmlElement.name())) { return new ExpandableWithValue(xmlElement.name()); } return new ExpandableWithValue(field.getName()); }
/** * Puts definitions for XML element. * * @param element XmlElement * @param property property instance to be updated */ private static void applyElement(XmlElement element, Schema property) { if (element != null) { setName(element.namespace(), element.name(), property); } }
result = new ArrayList<NamedType>(); for (XmlElement elem : elems.value()) { String name = elem.name(); if (MARKER_FOR_DEFAULT.equals(name)) name = null; result.add(new NamedType(elem.type(), name));
import java.lang.reflect.Method; ... Method m = product.getClass().getMethod("setName",String.class); XmlElement a = m.getAnnotation(XmlElement.class); String nameValue = a.name(); System.out.println(nameValue);
/** * Computes the tag name from a {@link XmlElement} by taking the defaulting into account. */ protected final QName calcXmlName(XmlElement e) { if(e!=null) return calcXmlName(e.namespace(),e.name()); else return calcXmlName("##default","##default"); }
static String resolveName(Field field) { if (!field.isAnnotationPresent(XmlElement.class)) { return field.getName(); } final XmlElement xmlElement = field.getAnnotation(XmlElement.class); String name = xmlElement.name(); return Objects.equals("##default", name) ? field.getName() : name; }
private CharArray getXmlElementName(final Field field){ CharArray xmlElementName; final XmlElement xmlElement = field.getAnnotation(XmlElement.class); if(xmlElement == null || "##default".equals(xmlElement.name())){ xmlElementName = new CharArray(field.getName()); } else { xmlElementName = new CharArray(xmlElement.name()); } _xmlElementNameCache.put(xmlElementName, xmlElementName); return xmlElementName; }
private String extractName(AccessibleObject object) { String name = null; XmlAttribute attr = object.getAnnotation(XmlAttribute.class); if (attr != null) name = attr.name(); else { XmlElement el = object.getAnnotation(XmlElement.class); if (el != null) name = el.name(); } return DEFAULT_NAME.equals(name) ? null : name; } }