本文整理汇总了Java中org.jdom2.output.support.FormatStack类的典型用法代码示例。如果您正苦于以下问题:Java FormatStack类的具体用法?Java FormatStack怎么用?Java FormatStack使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FormatStack类属于org.jdom2.output.support包,在下文中一共展示了FormatStack类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: printElement
import org.jdom2.output.support.FormatStack; //导入依赖的package包/类
@Override
protected org.w3c.dom.Element printElement(FormatStack fstack, NamespaceStack nstack,
org.w3c.dom.Document basedoc, Element element) {
Attribute href = element.getAttribute("href");
return (href == null || itemAccess(PERMISSION_READ, element, true)) ? super.printElement(fstack, nstack,
basedoc, element) : null;
}
示例2: printDeclaration
import org.jdom2.output.support.FormatStack; //导入依赖的package包/类
@Override
protected void printDeclaration(final Writer out, final FormatStack fstack) throws IOException {
if (fstack.isOmitDeclaration()) {
return;
}
if (fstack.isOmitEncoding()) {
write(out, "<?xml version=\"1.0");
} else {
write(out, "<?xml version=\"1.0\"");
write(out, " encoding=\"");
write(out, fstack.getEncoding());
}
write(out, "\" standalone=\"yes\"?>");
write(out, "\n");
}
示例3: printTextRemoveBreaks
import org.jdom2.output.support.FormatStack; //导入依赖的package包/类
protected void printTextRemoveBreaks(final Writer out, final FormatStack fstack,
final String text) throws IOException
{
if (fstack.getEscapeOutput())
{
textRawRemoveBreaks(out, Format.escapeText(fstack.getEscapeStrategy(),
fstack.getLineSeparator(), text));
return;
}
textRawRemoveBreaks(out, text);
}
示例4: printNamespace
import org.jdom2.output.support.FormatStack; //导入依赖的package包/类
@Override
protected void printNamespace(final XMLStreamWriter out, final FormatStack fstack, final Namespace ns)
throws XMLStreamException {
final String prefix = ns.getPrefix();
final String uri = ns.getURI();
// TODO handle namespace
if (!ns.equals(namespace)) {
out.writeNamespace(prefix, uri);
}
}