mirror of
https://github.com/vanitasvitae/Smack.git
synced 2024-11-22 12:02:05 +01:00
Improve PubSubNamespace
This commit is contained in:
parent
fce0aeadef
commit
4d7279d036
1 changed files with 9 additions and 7 deletions
|
@ -31,21 +31,23 @@ public enum PubSubNamespace
|
||||||
EVENT("event"),
|
EVENT("event"),
|
||||||
OWNER("owner");
|
OWNER("owner");
|
||||||
|
|
||||||
private String fragment;
|
private final String fragment;
|
||||||
|
private final String fullNamespace;
|
||||||
|
|
||||||
private PubSubNamespace(String fragment)
|
private PubSubNamespace(String fragment)
|
||||||
{
|
{
|
||||||
this.fragment = fragment;
|
this.fragment = fragment;
|
||||||
|
if (fragment != null) {
|
||||||
|
fullNamespace = PubSub.NAMESPACE + '#' + fragment;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
fullNamespace = PubSub.NAMESPACE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getXmlns()
|
public String getXmlns()
|
||||||
{
|
{
|
||||||
String ns = PubSub.NAMESPACE;
|
return fullNamespace;
|
||||||
|
|
||||||
if (fragment != null)
|
|
||||||
ns += '#' + fragment;
|
|
||||||
|
|
||||||
return ns;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getFragment()
|
public String getFragment()
|
||||||
|
|
Loading…
Reference in a new issue