mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-09 00:59:39 +02:00
Add more QNAME fields to extension element classes
This commit is contained in:
parent
36c7521ca2
commit
961882ff7f
8 changed files with 56 additions and 22 deletions
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
*
|
||||
* Copyright © 2017 Paul Schaub
|
||||
* Copyright © 2017 Paul Schaub, 2021 Florian Schmaus
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -18,6 +18,8 @@ package org.jivesoftware.smackx.hashes.element;
|
|||
|
||||
import static org.jivesoftware.smack.util.Objects.requireNonNull;
|
||||
|
||||
import javax.xml.namespace.QName;
|
||||
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smack.util.XmlStringBuilder;
|
||||
import org.jivesoftware.smack.util.stringencoder.Base64;
|
||||
|
@ -34,6 +36,8 @@ public class HashElement implements ExtensionElement {
|
|||
public static final String ELEMENT = "hash";
|
||||
public static final String ATTR_ALGO = "algo";
|
||||
|
||||
public static final QName QNAME = new QName(HashManager.NAMESPACE.V2.toString(), ELEMENT);
|
||||
|
||||
private final HashManager.ALGORITHM algorithm;
|
||||
private final byte[] hash;
|
||||
private final String hashB64;
|
||||
|
@ -89,7 +93,12 @@ public class HashElement implements ExtensionElement {
|
|||
|
||||
@Override
|
||||
public String getElementName() {
|
||||
return ELEMENT;
|
||||
return QNAME.getLocalPart();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNamespace() {
|
||||
return QNAME.getNamespaceURI();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -102,11 +111,6 @@ public class HashElement implements ExtensionElement {
|
|||
return sb;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNamespace() {
|
||||
return HashManager.NAMESPACE.V2.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object other) {
|
||||
if (other == null || !(other instanceof HashElement)) {
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/**
|
||||
*
|
||||
* Copyright 2014 Andriy Tsykholyas, 2015 Florian Schmaus
|
||||
* Copyright 2014 Andriy Tsykholyas, 2015-2021 Florian Schmaus
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -16,6 +16,8 @@
|
|||
*/
|
||||
package org.jivesoftware.smackx.hoxt.packet;
|
||||
|
||||
import javax.xml.namespace.QName;
|
||||
|
||||
import org.jivesoftware.smack.packet.ExtensionElement;
|
||||
import org.jivesoftware.smack.util.Objects;
|
||||
import org.jivesoftware.smack.util.XmlStringBuilder;
|
||||
|
@ -36,6 +38,8 @@ public class Base64BinaryChunk implements ExtensionElement {
|
|||
public static final String ATTRIBUTE_LAST = "last";
|
||||
public static final String ATTRIBUTE_NR = "nr";
|
||||
|
||||
public static final QName QNAME = new QName(HOXTManager.NAMESPACE, ELEMENT_CHUNK);
|
||||
|
||||
private final String streamId;
|
||||
private final boolean last;
|
||||
private final String text;
|
||||
|
@ -108,12 +112,12 @@ public class Base64BinaryChunk implements ExtensionElement {
|
|||
|
||||
@Override
|
||||
public String getElementName() {
|
||||
return ELEMENT_CHUNK;
|
||||
return QNAME.getLocalPart();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getNamespace() {
|
||||
return HOXTManager.NAMESPACE;
|
||||
return QNAME.getNamespaceURI();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -16,9 +16,12 @@
|
|||
*/
|
||||
package org.jivesoftware.smackx.message_markup.element;
|
||||
|
||||
import javax.xml.namespace.QName;
|
||||
|
||||
public class BlockQuoteElement extends MarkupElement.BlockLevelMarkupElement {
|
||||
|
||||
public static final String ELEMENT = "bquote";
|
||||
public static final QName QNAME = new QName(MarkupElement.NAMESPACE, ELEMENT);
|
||||
|
||||
/**
|
||||
* Create a new Block Quote element.
|
||||
|
@ -32,7 +35,7 @@ public class BlockQuoteElement extends MarkupElement.BlockLevelMarkupElement {
|
|||
|
||||
@Override
|
||||
public String getElementName() {
|
||||
return ELEMENT;
|
||||
return QNAME.getLocalPart();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue