private static void writeAnnotationAttributes(final Collection<AnnotationAttribute> annotationAttributes, final Map<String, String> predefinedNamespaces, ArrayList<String> setNamespaces, final XMLStreamWriter xmlStreamWriter) throws XMLStreamException { if (annotationAttributes != null) { if (setNamespaces == null) { setNamespaces = new ArrayList<String>(); } for (AnnotationAttribute annotationAttribute : annotationAttributes) { if (annotationAttribute.getNamespace() != null) { xmlStreamWriter.writeAttribute(annotationAttribute.getPrefix(), annotationAttribute.getNamespace(), annotationAttribute.getName(), annotationAttribute.getText()); if (setNamespaces.contains(annotationAttribute.getNamespace()) == false && predefinedNamespaces.containsValue(annotationAttribute.getNamespace()) == false) { xmlStreamWriter.writeNamespace(annotationAttribute.getPrefix(), annotationAttribute.getNamespace()); setNamespaces.add(annotationAttribute.getNamespace()); } } else { xmlStreamWriter.writeAttribute(annotationAttribute.getName(), annotationAttribute.getText()); } } } }
private static void writeAnnotationAttributes(final Collection<AnnotationAttribute> annotationAttributes, final Map<String, String> predefinedNamespaces, ArrayList<String> setNamespaces, final XMLStreamWriter xmlStreamWriter) throws XMLStreamException { if (annotationAttributes != null) { if (setNamespaces == null) { setNamespaces = new ArrayList<String>(); } for (AnnotationAttribute annotationAttribute : annotationAttributes) { if (annotationAttribute.getNamespace() != null) { xmlStreamWriter.writeAttribute(annotationAttribute.getPrefix(), annotationAttribute.getNamespace(), annotationAttribute.getName(), annotationAttribute.getText()); if (setNamespaces.contains(annotationAttribute.getNamespace()) == false && predefinedNamespaces.containsValue(annotationAttribute.getNamespace()) == false) { xmlStreamWriter.writeNamespace(annotationAttribute.getPrefix(), annotationAttribute.getNamespace()); setNamespaces.add(annotationAttribute.getNamespace()); } } else { xmlStreamWriter.writeAttribute(annotationAttribute.getName(), annotationAttribute.getText()); } } } }
private static void writeAnnotationAttributes(final Collection<AnnotationAttribute> annotationAttributes, final Map<String, String> predefinedNamespaces, ArrayList<String> setNamespaces, final XMLStreamWriter xmlStreamWriter) throws XMLStreamException { if (annotationAttributes != null) { if (setNamespaces == null) { setNamespaces = new ArrayList<String>(); } for (AnnotationAttribute annotationAttribute : annotationAttributes) { if (annotationAttribute.getNamespace() != null) { xmlStreamWriter.writeAttribute(annotationAttribute.getPrefix(), annotationAttribute.getNamespace(), annotationAttribute.getName(), annotationAttribute.getText()); if (setNamespaces.contains(annotationAttribute.getNamespace()) == false && predefinedNamespaces.containsValue(annotationAttribute.getNamespace()) == false) { xmlStreamWriter.writeNamespace(annotationAttribute.getPrefix(), annotationAttribute.getNamespace()); setNamespaces.add(annotationAttribute.getNamespace()); } } else { xmlStreamWriter.writeAttribute(annotationAttribute.getName(), annotationAttribute.getText()); } } } }