com.sun.tools.apt.mirror.declaration
Class Constants

java.lang.Object
  extended by com.sun.tools.apt.mirror.declaration.Constants

 class Constants
extends java.lang.Object

Utility class for operating on constant expressions.


Nested Class Summary
(package private) static class Constants.Formatter
          Utility class used to generate the text of constant expressions.
 
Constructor Summary
Constants()
           
 
Method Summary
(package private) static java.lang.Object decodeConstant(java.lang.Object value, Type type)
          Converts a constant in javac's internal representation (in which boolean, char, byte, short, and int are each represented by an Integer) into standard representation.
(package private) static Constants.Formatter getFormatter()
          Returns a formatter for generating the text of constant expressions.
(package private) static Constants.Formatter getFormatter(java.lang.StringBuilder buf)
          Returns a formatter for generating the text of constant expressions.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Constants

Constants()
Method Detail

decodeConstant

static java.lang.Object decodeConstant(java.lang.Object value,
                                       Type type)
Converts a constant in javac's internal representation (in which boolean, char, byte, short, and int are each represented by an Integer) into standard representation. Other values (including null) are returned unchanged.


getFormatter

static Constants.Formatter getFormatter()
Returns a formatter for generating the text of constant expressions. Equivalent to getFormatter(new StringBuilder()).


getFormatter

static Constants.Formatter getFormatter(java.lang.StringBuilder buf)
Returns a formatter for generating the text of constant expressions. Also generates the text of constant "pseudo-expressions" for annotations and array-valued annotation elements.

Parameters:
buf - where the expression is written