@XmlElementRefs({ @XmlElementRef(name = "blueMod", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class), @XmlElementRef(name = "lumMod", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class), @XmlElementRef(name = "red", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class), @XmlElementRef(name = "greenMod", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class), @XmlElementRef(name = "sat", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class), @XmlElementRef(name = "lum", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class), @XmlElementRef(name = "tint", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class), @XmlElementRef(name = "hueOff", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class), @XmlElementRef(name = "redMod", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class), @XmlElementRef(name = "invGamma", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class), @XmlElementRef(name = "shade", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class), @XmlElementRef(name = "hue", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class), @XmlElementRef(name = "blueOff", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class), @XmlElementRef(name = "alphaMod", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class), @XmlElementRef(name = "comp", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class), @XmlElementRef(name = "satOff", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class), @XmlElementRef(name = "hueMod", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class), @XmlElementRef(name = "gamma", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class), @XmlElementRef(name = "satMod", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class), @XmlElementRef(name = "green", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class), @XmlElementRef(name = "lumOff", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class), @XmlElementRef(name = "redOff", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class), @XmlElementRef(name = "blue", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class), @XmlElementRef(name = "inv", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class), @XmlElementRef(name = "gray", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class), @XmlElementRef(name = "alphaOff", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class), @XmlElementRef(name = "greenOff", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class), @XmlElementRef(name = "alpha", namespace = "http://schemas.openxmlformats.org/drawingml/2006/main", type = JAXBElement.class)
public String name() { return core.name(); }
public String namespace() { return core.namespace(); }
@XmlRootElement(name = "command") @XmlType(propOrder = { "parameters", "implementation", "pattern" }) public class OServerCommandConfiguration { @XmlAttribute(required = true) public String pattern; @XmlAttribute(required = true) public String implementation; @XmlAttribute(required = false) public boolean stateful; @XmlElementWrapper(required = false) @XmlElementRef(type = OServerEntryConfiguration.class) public OServerEntryConfiguration[] parameters; }
/** * @author <a href="mailto:bill@burkecentral.com">Bill Burke</a> * @version $Revision: 2 $ */ @XmlRootElement(name = "registry") @XmlAccessorType(XmlAccessType.FIELD) public class RegistryData { @XmlElementRef private Set<RegistryEntry> entries = new TreeSet<RegistryEntry>(); public Set<RegistryEntry> getEntries() { return entries; } }
@XmlElementRefs({ @XmlElementRef(name = "phase-plugin", type = PhasePluginDescription.class) }) public List<PluginDescription> getPluginDescriptions() { return pluginDescriptions; } }
return _combineNames(attribute.name(), attribute.namespace(), defaultName); boolean hasAName = (elementRef != null); if (hasAName) { if (!MARKER_FOR_DEFAULT.equals(elementRef.name())) { return _combineNames(elementRef.name(), elementRef.namespace(), defaultName); String name = rootElement.name(); if (!MARKER_FOR_DEFAULT.equals(name)) { return _combineNames(name, rootElement.namespace(), defaultName);
/** * @return the tables */ @XmlElementRef(name="table") public List<TableModel> getTables() { return tables; }
if (elemRefs != null) { result = new ArrayList<NamedType>(); for (XmlElementRef elemRef : elemRefs.value()) { Class<?> refType = elemRef.type(); String name = elemRef.name(); if (name == null || MARKER_FOR_DEFAULT.equals(name)) { XmlRootElement rootElement = (XmlRootElement) refType.getAnnotation(XmlRootElement.class); if (rootElement != null) { name = rootElement.name();
protected static String getTypeName(Annotation[] annotations, String dflt) { String name = null; for (Annotation a : annotations) { if (a.annotationType() == XmlAttribute.class) { name = ((XmlAttribute)a).name(); } else if (a.annotationType() == XmlElement.class) { name = ((XmlElement)a).name(); } else if (a.annotationType() == XmlElementRef.class) { name = ((XmlElementRef)a).name(); } else if (a.annotationType() == XmlElementWrapper.class) { name = ((XmlElementWrapper)a).name(); // break the loop as we don't want name to be overwritten by XmlElement break; } else if (a.annotationType() == XmlType.class) { name = ((XmlType)a).name(); } else if (a.annotationType() == XmlTransient.class) { // transient type return null; } } if (DEFAULT_NAME.equals(name)) { return dflt; } return name; }
XmlElementRef[] elementRefChoices = xmlElementRefs.value(); if (elementRefChoices.length == 0) { xmlElementRefs = null; if (xmlElementRefs != null) { choices = new ArrayList<ElementRef>(); for (XmlElementRef elementRef : xmlElementRefs.value()) { choices.add(new ElementRef((MemberDeclaration) getDelegate(), getTypeDefinition(), elementRef)); this.ref = new QName(xmlElementRef.namespace(), xmlElementRef.name());
boolean res = false; XmlElementRefs refs = field.getAnnotation(XmlElementRefs.class); for(XmlElementRef ref : refs.value()) { QName refQname = new QName(ref.namespace(), ref.name()); if(refQname.equals(child.getXmlObject().getXmlObjectQName())){ if(ref.type().equals(JAXBElement.class)) { res = true; break;
/** * Get the name of the field by looking at the XmlElement annotation. * * @param jaxbClass * @param fieldName * @return * @throws NoSuchFieldException */ private static QName getXmlElementRefOrElementQName(Class<?> jaxbClass, Field field) throws NoSuchFieldException { XmlElementRef xmlElementRef = (XmlElementRef)getAnnotation(field, XmlElementRef.class); if (xmlElementRef != null) { return new QName(xmlElementRef.namespace(), xmlElementRef.name()); } XmlElement xmlElement = (XmlElement)getAnnotation(field, XmlElement.class); // If XmlElement does not exist, default to using the field name if (xmlElement == null || xmlElement.name().equals("##default")) { return new QName("", field.getName()); } return new QName(xmlElement.namespace(), xmlElement.name()); }
Messages.MUTUALLY_EXCLUSIVE_ANNOTATIONS.format( nav().getClassName(parent.getClazz())+'#'+seed.getName(), ref.annotationType().getName(), refs.annotationType().getName()), ref, refs )); ann = refs.value(); else { if(ref!=null) getEffectiveNamespaceFor(r), r.name()), this )); Messages.MUTUALLY_EXCLUSIVE_ANNOTATIONS.format( nav().getClassName(parent.getClazz())+'#'+seed.getName(), ref.annotationType().getName(), refs.annotationType().getName()), ref, refs )); getEffectiveNamespaceFor(r), r.name()), this ));
static QName guessQNameFromJaxbElementCollectionField(AbstractJaxbModelObject child, Field field) { if (field.isAnnotationPresent(XmlElementRef.class)) { XmlElementRef ref = field.getAnnotation(XmlElementRef.class); if (ref.type().equals(JAXBElement.class)) { Type fieldType = field.getGenericType(); Type[] listTypes = ((ParameterizedType) fieldType).getActualTypeArguments(); assert listTypes.length > 0; Type jaxbeltType = listTypes[0]; if (jaxbeltType instanceof ParameterizedType && ((ParameterizedType) jaxbeltType).getRawType().equals(JAXBElement.class)) {// JAXBElement Type[] types = ((ParameterizedType) jaxbeltType).getActualTypeArguments(); assert types.length > 0; if (types[0].equals(Object.class)) { return new QName(ref.namespace(), ref.name()); } else { return null; } } } } return null; }
private static String getOverridenNameOrName(Field attributeField) { String attributeName = attributeField.getName(); if (attributeField.isAnnotationPresent(XmlAttribute.class)) { attributeName = attributeField.getAnnotation(XmlAttribute.class) .name(); } if (attributeField.isAnnotationPresent(XmlElement.class)) { attributeName = attributeField.getAnnotation(XmlElement.class) .name(); } if (attributeField.isAnnotationPresent(XmlElementRef.class)) { attributeName = attributeField.getAnnotation(XmlElementRef.class) .name(); } if (JAXB_ATTRIBUTE_NAME_DEFAULT.equals(attributeName)) { attributeName = attributeField.getName(); } return attributeName; }
@XmlRootElement(name = "socket") @XmlType(propOrder = { "parameters", "implementation", "name" }) public class OServerSocketFactoryConfiguration { public OServerSocketFactoryConfiguration() { } public OServerSocketFactoryConfiguration(String name, String implementation) { this.name = name; this.implementation = implementation; } @XmlAttribute(required = true) public String name; @XmlAttribute(required = true) public String implementation; @XmlElementWrapper @XmlElementRef(type = OServerParameterConfiguration.class) public OServerParameterConfiguration[] parameters; }
return _combineNames(attribute.name(), attribute.namespace(), defaultName); boolean hasAName = (elementRef != null); if (hasAName) { if (!MARKER_FOR_DEFAULT.equals(elementRef.name())) { return _combineNames(elementRef.name(), elementRef.namespace(), defaultName); String name = rootElement.name(); if (!MARKER_FOR_DEFAULT.equals(name)) { return _combineNames(name, rootElement.namespace(), defaultName);
XmlElementRef[] elementRefChoices = xmlElementRefs.value(); if (elementRefChoices.length == 0) { xmlElementRefs = null; if (xmlElementRefs != null) { choices = new ArrayList<ElementRef>(); for (XmlElementRef elementRef : xmlElementRefs.value()) { choices.add(new ElementRef(getDelegate(), getTypeDefinition(), elementRef, context)); QName refQname = new QName(xmlElementRef.namespace(), xmlElementRef.name()); List<? extends TypeMirror> elementTypeArguments = ((DecoratedDeclaredType) accessorType).getTypeArguments(); DecoratedTypeMirror elementOf = elementTypeArguments == null || elementTypeArguments.size() != 1 ? TypeMirrorUtils.objectType(context.getContext().getProcessingEnvironment()) : (DecoratedTypeMirror) elementTypeArguments.get(0);
/** * Get the name of the field by looking at the XmlElement annotation. * * @param jaxbClass * @param fieldName * @return * @throws NoSuchFieldException */ private static QName getXmlElementRefOrElementQName(Class<?> jaxbClass, Field field) throws NoSuchFieldException { XmlElementRef xmlElementRef = (XmlElementRef)getAnnotation(field, XmlElementRef.class); if (xmlElementRef != null) { return new QName(xmlElementRef.namespace(), xmlElementRef.name()); } XmlElement xmlElement = (XmlElement)getAnnotation(field, XmlElement.class); // If XmlElement does not exist, default to using the field name if (xmlElement == null || xmlElement.name().equals("##default")) { return new QName("", field.getName()); } return new QName(xmlElement.namespace(), xmlElement.name()); }