Example usage for org.jdom2 Attribute isSpecified

List of usage examples for org.jdom2 Attribute isSpecified

Introduction

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

Prototype

public boolean isSpecified() 

Source Link

Document

Get the 'specified' flag.

Usage

From source file:com.speedment.codgen.example.uml.TransformDelegator.java

License:Open Source License

default <M> void declareVisibility(M out, Element in) {
    final Attribute visible = in.getAttribute("visibility");

    if (visible != null && visible.isSpecified()) {
        ifType(visible, out, public_.class, public_::public_);
        ifType(visible, out, private_.class, private_::private_);
        ifType(visible, out, protected_.class, protected_::protected_);
    }//  w  w w. j  av  a2  s  .  c om
}

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;/*  ww w.j  a  va2  s . com*/
    }

    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, "\"");
}