Example usage for javax.lang.model.element Modifier toString

List of usage examples for javax.lang.model.element Modifier toString

Introduction

In this page you can find the example usage for javax.lang.model.element Modifier toString.

Prototype

public String toString() 

Source Link

Document

Returns this modifier's name in lowercase.

Usage

From source file:com.codiscope.analyzer.JSONSerializer.java

/**
 * Write out {@code Modifier}s as a JSON array with a given key.
 * Do nothing if the value passed in is {@code null}.
 *
 * @param name The key name.//w w w.  java 2s.  c  o  m
 * @param nodes Modifiers to write out.
 */
public void outputMods(final String name, final Iterable<? extends Modifier> mods) {
    try {
        if (mods != null) {
            writer.key(name);
            writer.array();
            for (final Modifier mod : mods) {
                writer.value(mod.toString());
            }
            writer.endArray();
        }
    } catch (final JSONException e) {
        throw new RuntimeException(e);
    }
}