本文整理了Java中org.bedework.util.xml.XmlEmit.startEmit()
方法的一些代码示例,展示了XmlEmit.startEmit()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XmlEmit.startEmit()
方法的具体详情如下:
包路径:org.bedework.util.xml.XmlEmit
类名称:XmlEmit
方法名:startEmit
[英]Emit any headers and namespace declarations
[中]发出任何头和名称空间声明
代码示例来源:origin: org.bedework/bw-caldav-util
/**
* @return XML version of notification
* @throws Throwable
*/
public String toXml() throws Throwable {
StringWriter str = new StringWriter();
XmlEmit xml = new XmlEmit();
xml.startEmit(str);
toXml(xml);
return str.toString();
}
代码示例来源:origin: org.bedework/bw-access
/** Represent the acl as an xml string
*
* @param acl the ACL object
* @param forWebDAV - true if we should split deny from grant.
* @param privTags the tags
* @param cb callback
* @return String xml representation
* @throws AccessException on error
*/
public static String getXmlAclString(final Acl acl, final boolean forWebDAV,
final QName[] privTags,
final AccessXmlCb cb) throws AccessException {
try {
XmlEmit xml = new XmlEmit(true); // no headers
StringWriter su = new StringWriter();
xml.startEmit(su);
AccessXmlUtil au = new AccessXmlUtil(privTags, xml, cb);
au.emitAcl(acl, forWebDAV);
su.close();
return su.toString();
} catch (AccessException ae) {
throw ae;
} catch (Throwable t) {
throw new AccessException(t);
}
}
代码示例来源:origin: org.bedework/bw-access
/** Produce an xml representation of current user privileges from an array
* of allowed/disallowed/unspecified flags indexed by a privilege index,
* returning the representation a a String
*
* @param privTags the tags
* @param ps PrivilegeSet allowed/disallowed
* @return String xml
* @throws AccessException on error
*/
public static String getCurrentPrivSetString(final QName[] privTags,
final PrivilegeSet ps)
throws AccessException {
try {
char[] privileges = ps.getPrivileges();
XmlEmit xml = new XmlEmit(true); // no headers
StringWriter su = new StringWriter();
xml.startEmit(su);
AccessXmlUtil.emitCurrentPrivSet(xml, privTags, privileges);
su.close();
return su.toString();
} catch (AccessException ae) {
throw ae;
} catch (Throwable t) {
throw new AccessException(t);
}
}
代码示例来源:origin: org.bedework/bw-util-servlet
private boolean emitError(final QName errorTag,
final String extra,
final Writer wtr) {
try {
XmlEmit xml = new XmlEmit();
// syncher.addNamespace(xml);
xml.startEmit(wtr);
xml.openTag(WebdavTags.error);
// syncher.emitError(errorTag, extra, xml);
xml.closeTag(WebdavTags.error);
xml.flush();
return true;
} catch (Throwable t1) {
// Pretty much screwed if we get here
return false;
}
}
代码示例来源:origin: org.bedework/bw-util-config
/** Output to a writer
*
* @param wtr
* @throws ConfigException
*/
public void toXml(final Writer wtr) throws ConfigException {
try {
XmlEmit xml = new XmlEmit();
xml.addNs(new NameSpace(ns, "BW"), true);
xml.startEmit(wtr);
dump(xml, false);
xml.flush();
} catch (ConfigException cfe) {
throw cfe;
} catch (Throwable t) {
throw new ConfigException(t);
}
}
代码示例来源:origin: org.bedework/bw-caldav-util
/**
* @return XML version of notification
* @throws Throwable on error
*/
public String toXml() throws Throwable {
final StringWriter str = new StringWriter();
final XmlEmit xml = new XmlEmit();
xml.addNs(new NameSpace(WebdavTags.namespace, "DAV"), false);
xml.addNs(new NameSpace(CaldavDefs.caldavNamespace, "C"), false);
xml.addNs(new NameSpace(AppleServerTags.appleCaldavNamespace, "CSS"), false);
xml.addNs(new NameSpace(BedeworkServerTags.bedeworkCaldavNamespace, "BSS"), false);
xml.addNs(new NameSpace(BedeworkServerTags.bedeworkSystemNamespace, "BSYS"), false);
xml.startEmit(str);
toXml(xml);
return str.toString();
}
代码示例来源:origin: org.bedework/bw-caldav-util
/**
* @return XML version of notification
* @throws Throwable on error
*/
public String toXml() throws Throwable {
final StringWriter str = new StringWriter();
final XmlEmit xml = new XmlEmit();
xml.addNs(new NameSpace(WebdavTags.namespace, "DAV"), false);
xml.addNs(new NameSpace(CaldavDefs.caldavNamespace, "C"), false);
xml.addNs(new NameSpace(AppleServerTags.appleCaldavNamespace, "CSS"), false);
xml.addNs(new NameSpace(BedeworkServerTags.bedeworkCaldavNamespace, "BSS"), false);
xml.addNs(new NameSpace(BedeworkServerTags.bedeworkSystemNamespace, "BSYS"), false);
xml.startEmit(str);
toXml(xml);
return str.toString();
}
代码示例来源:origin: org.bedework.caleng/bw-calendar-engine-facade
XmlEmit xml = new XmlEmit();
wtr = new FileWriter(f);
xml.startEmit(wtr);
代码示例来源:origin: org.bedework/bw-util-dav
xml.startEmit(sw);
代码示例来源:origin: org.bedework/bw-caldav-util
/**
* @param withBedeworkElements true if we should emit any extra elements.
* @return XML version of notification
* @throws Throwable
*/
public String toXml(final boolean withBedeworkElements) throws Throwable {
final StringWriter str = new StringWriter();
final XmlEmit xml = new XmlEmit();
if (withBedeworkElements) {
xml.setProperty("withBedeworkElements", "true");
}
xml.addNs(new NameSpace(WebdavTags.namespace, "DAV"), false);
xml.addNs(new NameSpace(CaldavDefs.caldavNamespace, "C"), false);
xml.addNs(new NameSpace(AppleServerTags.appleCaldavNamespace, "CSS"), false);
xml.addNs(new NameSpace(BedeworkServerTags.bedeworkCaldavNamespace, "BW"), false);
xml.addNs(new NameSpace(BedeworkServerTags.bedeworkSystemNamespace, "BSS"), false);
xml.startEmit(str);
toXml(xml);
return str.toString();
}
代码示例来源:origin: org.bedework/bw-util-dav
xml.startEmit(sw);
内容来源于网络,如有侵权,请联系作者删除!