Example usage for org.jdom2 Attribute getAttributeType

List of usage examples for org.jdom2 Attribute getAttributeType

Introduction

In this page you can find the example usage for org.jdom2 Attribute getAttributeType.

Prototype

public AttributeType getAttributeType() 

Source Link

Document

This will return the declared type of this Attribute.

Usage

From source file:com.googlesource.gerrit.plugins.manifest.CustomOutputter.java

License:Apache License

@Override
protected void printAttribute(java.io.Writer out, FormatStack fstack, Attribute attribute)
        throws java.io.IOException {
    // Do not print attributes that use default values
    for (DTDAttribute dtdAttribute : dtdAttributes) {
        if (attribute.getName().equals(dtdAttribute.getAttributeName())
                && attribute.getParent().getName().equals(dtdAttribute.getElementName())
                && attribute.getAttributeType().toString().equals(dtdAttribute.getType())
                && attribute.getValue().equals(dtdAttribute.getValue())) {
            return;
        }//from  w w  w. j a  v  a2  s. c o m
    }

    out.append(fstack.getLineSeparator());
    String indent = fstack.getIndent();
    out.append(fstack.getLevelIndent());
    out.append(indent);
    // super.printAttribute() indents with an extra space, this will offset that
    out.append(indent.substring(0, indent.length() - 1));
    super.printAttribute(out, fstack, attribute);
}