Example usage for org.jdom2.output.support FormatStack isSpecifiedAttributesOnly

List of usage examples for org.jdom2.output.support FormatStack isSpecifiedAttributesOnly

Introduction

In this page you can find the example usage for org.jdom2.output.support FormatStack isSpecifiedAttributesOnly.

Prototype

public boolean isSpecifiedAttributesOnly() 

Source Link

Document

Indicate whether only those Attributes specified in the XML should be output.

Usage

From source file:io.wcm.maven.plugins.contentpackage.unpacker.OneAttributePerLineXmlProcessor.java

License:Apache License

@Override
protected void printAttribute(Writer out, FormatStack fstack, Attribute attribute) throws IOException {
    if (!attribute.isSpecified() && fstack.isSpecifiedAttributesOnly()) {
        return;//from  w  ww  .jav  a 2  s .  c  o  m
    }

    write(out, StringUtils.defaultString(fstack.getLineSeparator()));
    write(out, StringUtils.defaultString(fstack.getLevelIndent()));
    write(out, StringUtils.defaultString(fstack.getIndent()));
    write(out, StringUtils.defaultString(fstack.getIndent()));

    write(out, attribute.getQualifiedName());
    write(out, "=");

    write(out, "\"");
    attributeEscapedEntitiesFilter(out, fstack, attribute.getValue());
    write(out, "\"");
}