本文整理了Java中org.jivesoftware.smack.packet.Message.getMessageSubject()
方法的一些代码示例,展示了Message.getMessageSubject()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Message.getMessageSubject()
方法的具体详情如下:
包路径:org.jivesoftware.smack.packet.Message
类名称:Message
方法名:getMessageSubject
暂无
代码示例来源:origin: igniterealtime/Smack
/**
* Returns the subject corresponding to the language. If the language is null, the method result
* will be the same as {@link #getSubject()}. Null will be returned if the language does not have
* a corresponding subject.
*
* @param language the language of the subject to return.
* @return the subject related to the passed in language.
*/
public String getSubject(String language) {
Subject subject = getMessageSubject(language);
return subject == null ? null : subject.subject;
}
代码示例来源:origin: igniterealtime/Smack
/**
* Returns all the languages being used for the subjects, not including the default subject.
*
* @return the languages being used for the subjects.
*/
public List<String> getSubjectLanguages() {
Subject defaultSubject = getMessageSubject(null);
List<String> languages = new ArrayList<String>();
for (Subject subject : subjects) {
if (!subject.equals(defaultSubject)) {
languages.add(subject.language);
}
}
return Collections.unmodifiableList(languages);
}
代码示例来源:origin: igniterealtime/Smack
@Override
public XmlStringBuilder toXML(String enclosingNamespace) {
XmlStringBuilder buf = new XmlStringBuilder(enclosingNamespace);
buf.halfOpenElement(ELEMENT);
enclosingNamespace = addCommonAttributes(buf, enclosingNamespace);
buf.optAttribute("type", type);
buf.rightAngleBracket();
// Add the subject in the default language
Subject defaultSubject = getMessageSubject(null);
if (defaultSubject != null) {
buf.element("subject", defaultSubject.subject);
}
// Add the subject in other languages
for (Subject subject : getSubjects()) {
// Skip the default language
if (subject.equals(defaultSubject))
continue;
buf.append(subject.toXML(null));
}
buf.optElement("thread", thread);
// Append the error subpacket if the message type is an error.
if (type == Type.error) {
appendErrorIfExists(buf, enclosingNamespace);
}
// Add extension elements, if any are defined.
buf.append(getExtensions(), enclosingNamespace);
buf.closeElement(ELEMENT);
return buf;
}
代码示例来源:origin: org.igniterealtime.smack/smack
/**
* Returns the subject corresponding to the language. If the language is null, the method result
* will be the same as {@link #getSubject()}. Null will be returned if the language does not have
* a corresponding subject.
*
* @param language the language of the subject to return.
* @return the subject related to the passed in language.
*/
public String getSubject(String language) {
Subject subject = getMessageSubject(language);
return subject == null ? null : subject.subject;
}
代码示例来源:origin: org.igniterealtime.smack/smack-core
/**
* Returns the subject corresponding to the language. If the language is null, the method result
* will be the same as {@link #getSubject()}. Null will be returned if the language does not have
* a corresponding subject.
*
* @param language the language of the subject to return.
* @return the subject related to the passed in language.
*/
public String getSubject(String language) {
Subject subject = getMessageSubject(language);
return subject == null ? null : subject.subject;
}
代码示例来源:origin: org.littleshoot/smack-xmpp-3-2-2
/**
* Returns the subject corresponding to the language. If the language is null, the method result
* will be the same as {@link #getSubject()}. Null will be returned if the language does not have
* a corresponding subject.
*
* @param language the language of the subject to return.
* @return the subject related to the passed in language.
*/
public String getSubject(String language) {
Subject subject = getMessageSubject(language);
return subject == null ? null : subject.subject;
}
代码示例来源:origin: tiandawu/IotXmpp
/**
* Returns the subject corresponding to the language. If the language is null, the method result
* will be the same as {@link #getSubject()}. Null will be returned if the language does not have
* a corresponding subject.
*
* @param language the language of the subject to return.
* @return the subject related to the passed in language.
*/
public String getSubject(String language) {
Subject subject = getMessageSubject(language);
return subject == null ? null : subject.subject;
}
代码示例来源:origin: org.littleshoot/smack-xmpp-3-2-2
/**
* Returns all the languages being used for the subjects, not including the default subject.
*
* @return the languages being used for the subjects.
*/
public Collection<String> getSubjectLanguages() {
Subject defaultSubject = getMessageSubject(null);
List<String> languages = new ArrayList<String>();
for (Subject subject : subjects) {
if (!subject.equals(defaultSubject)) {
languages.add(subject.language);
}
}
return Collections.unmodifiableCollection(languages);
}
代码示例来源:origin: org.igniterealtime.smack/smack-core
/**
* Returns all the languages being used for the subjects, not including the default subject.
*
* @return the languages being used for the subjects.
*/
public List<String> getSubjectLanguages() {
Subject defaultSubject = getMessageSubject(null);
List<String> languages = new ArrayList<String>();
for (Subject subject : subjects) {
if (!subject.equals(defaultSubject)) {
languages.add(subject.language);
}
}
return Collections.unmodifiableList(languages);
}
代码示例来源:origin: org.igniterealtime.smack/smack
/**
* Returns all the languages being used for the subjects, not including the default subject.
*
* @return the languages being used for the subjects.
*/
public Collection<String> getSubjectLanguages() {
Subject defaultSubject = getMessageSubject(null);
List<String> languages = new ArrayList<String>();
for (Subject subject : subjects) {
if (!subject.equals(defaultSubject)) {
languages.add(subject.language);
}
}
return Collections.unmodifiableCollection(languages);
}
代码示例来源:origin: tiandawu/IotXmpp
/**
* Returns all the languages being used for the subjects, not including the default subject.
*
* @return the languages being used for the subjects.
*/
public Collection<String> getSubjectLanguages() {
Subject defaultSubject = getMessageSubject(null);
List<String> languages = new ArrayList<String>();
for (Subject subject : subjects) {
if (!subject.equals(defaultSubject)) {
languages.add(subject.language);
}
}
return Collections.unmodifiableCollection(languages);
}
代码示例来源:origin: org.igniterealtime.smack/smack
Subject defaultSubject = getMessageSubject(null);
if (defaultSubject != null) {
buf.append("<subject>").append(StringUtils.escapeForXML(defaultSubject.subject)).append("</subject>");
代码示例来源:origin: org.littleshoot/smack-xmpp-3-2-2
Subject defaultSubject = getMessageSubject(null);
if (defaultSubject != null) {
buf.append("<subject>").append(StringUtils.escapeForXML(defaultSubject.subject)).append("</subject>");
代码示例来源:origin: tiandawu/IotXmpp
Subject defaultSubject = getMessageSubject(null);
if (defaultSubject != null) {
buf.append("<subject>").append(StringUtils.escapeForXML(defaultSubject.subject)).append("</subject>");
代码示例来源:origin: org.igniterealtime.smack/smack-core
@Override
public XmlStringBuilder toXML(String enclosingNamespace) {
XmlStringBuilder buf = new XmlStringBuilder(enclosingNamespace);
buf.halfOpenElement(ELEMENT);
enclosingNamespace = addCommonAttributes(buf, enclosingNamespace);
buf.optAttribute("type", type);
buf.rightAngleBracket();
// Add the subject in the default language
Subject defaultSubject = getMessageSubject(null);
if (defaultSubject != null) {
buf.element("subject", defaultSubject.subject);
}
// Add the subject in other languages
for (Subject subject : getSubjects()) {
// Skip the default language
if (subject.equals(defaultSubject))
continue;
buf.append(subject.toXML(null));
}
buf.optElement("thread", thread);
// Append the error subpacket if the message type is an error.
if (type == Type.error) {
appendErrorIfExists(buf, enclosingNamespace);
}
// Add extension elements, if any are defined.
buf.append(getExtensions(), enclosingNamespace);
buf.closeElement(ELEMENT);
return buf;
}
内容来源于网络,如有侵权,请联系作者删除!