public static boolean isBlacklisted(ExtensionAttribute attribute, List<ExtensionAttribute>... blackLists) { if (blackLists != null) { for (List<ExtensionAttribute> blackList : blackLists) { for (ExtensionAttribute blackAttribute : blackList) { if (blackAttribute.getName().equals(attribute.getName())) { if (blackAttribute.getNamespace() != null && attribute.getNamespace() != null && blackAttribute.getNamespace().equals(attribute.getNamespace())) return true; if (blackAttribute.getNamespace() == null && attribute.getNamespace() == null) return true; } } } } return false; }
if (attribute.getNamespacePrefix() == null) { if (attribute.getNamespace() == null) xtw.writeAttribute(attribute.getName(), attribute.getValue()); else { xtw.writeAttribute(attribute.getNamespace(), attribute.getName(), attribute.getValue()); xtw.writeNamespace(attribute.getNamespacePrefix(), attribute.getNamespace()); xtw.writeAttribute(attribute.getNamespacePrefix(), attribute.getNamespace(), attribute.getName(), attribute.getValue());
if (StringUtils.isNotEmpty(attribute.getName()) && attribute.getValue() != null) { if (StringUtils.isNotEmpty(attribute.getNamespace())) { if (StringUtils.isNotEmpty(attribute.getNamespacePrefix())) { xtw.writeAttribute(attribute.getNamespacePrefix(), attribute.getNamespace(), attribute.getName(), attribute.getValue()); } else { xtw.writeAttribute(attribute.getNamespace(), attribute.getName(), attribute.getValue()); xtw.writeAttribute(attribute.getName(), attribute.getValue());
public static boolean isBlacklisted(ExtensionAttribute attribute, List<ExtensionAttribute>... blackLists) { if (blackLists != null) { for (List<ExtensionAttribute> blackList : blackLists) { for (ExtensionAttribute blackAttribute : blackList) { if (blackAttribute.getName().equals(attribute.getName())) { if (blackAttribute.getNamespace() != null && attribute.getNamespace() != null && blackAttribute.getNamespace().equals(attribute.getNamespace())) return true; if (blackAttribute.getNamespace() == null && attribute.getNamespace() == null) return true; } } } } return false; } }
if (attribute.getNamespacePrefix() == null) { if (attribute.getNamespace() == null) xtw.writeAttribute(attribute.getName(), attribute.getValue()); else { xtw.writeAttribute(attribute.getNamespace(), attribute.getName(), attribute.getValue()); xtw.writeNamespace(attribute.getNamespacePrefix(), attribute.getNamespace()); xtw.writeAttribute(attribute.getNamespacePrefix(), attribute.getNamespace(), attribute.getName(), attribute.getValue());
if (StringUtils.isNotEmpty(attribute.getName()) && attribute.getValue() != null) { if (StringUtils.isNotEmpty(attribute.getNamespace())) { if (StringUtils.isNotEmpty(attribute.getNamespacePrefix())) { xtw.writeAttribute(attribute.getNamespacePrefix(), attribute.getNamespace(), attribute.getName(), attribute.getValue()); } else { xtw.writeAttribute(attribute.getNamespace(), attribute.getName(), attribute.getValue()); xtw.writeAttribute(attribute.getName(), attribute.getValue());