Enum StringFormatPart.Flag
- java.lang.Object
-
- java.lang.Enum<StringFormatPart.Flag>
-
- org.jboss.logging.processor.validation.StringFormatPart.Flag
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<StringFormatPart.Flag>
- Enclosing class:
- StringFormatPart
public static enum StringFormatPart.Flag extends java.lang.Enum<StringFormatPart.Flag>
The flags for the string message format.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description CONVERSION_DEPENDENT_ALTERNATE
The result should use a conversion-dependent alternate form.INCLUDE_SIGN
The result will always include a sign.LEFT_JUSTIFY
The result will be left-justified.LOCALE_GROUPING_SEPARATOR
The result will include locale-specific grouping separators.PARENTHESES_FOR_NEGATIVES
The result will enclose negative numbers in parentheses.PREVIOUS
The previous position.SPACE_FOR_POSITIVE_VALUES
The result will include a leading space for positive values.ZERO_PADDED
The result will be zero-padded.
-
Field Summary
Fields Modifier and Type Field Description (package private) char
flag
The character flag.
-
Constructor Summary
Constructors Modifier Constructor Description private
Flag(char flag)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static StringFormatPart.Flag
parse(char c)
Checks to see if the character is a valid flag.java.lang.String
toString()
static StringFormatPart.Flag
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static StringFormatPart.Flag[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
LEFT_JUSTIFY
public static final StringFormatPart.Flag LEFT_JUSTIFY
The result will be left-justified. Works on all conversions.
-
CONVERSION_DEPENDENT_ALTERNATE
public static final StringFormatPart.Flag CONVERSION_DEPENDENT_ALTERNATE
The result should use a conversion-dependent alternate form. Works on conversionsStringFormatPart.Conversion.OCTAL_INTEGER
,StringFormatPart.Conversion.HEX_INTEGER
, all floating points and most general conversions depending on the definition ofFormattable
.
-
INCLUDE_SIGN
public static final StringFormatPart.Flag INCLUDE_SIGN
The result will always include a sign. Works on all floating points,StringFormatPart.Conversion.DECIMAL_INTEGER
,StringFormatPart.Conversion.OCTAL_INTEGER
,StringFormatPart.Conversion.HEX_INTEGER
when applied toBigInteger
orStringFormatPart.Conversion.DECIMAL_INTEGER
when applied tobyte
,Byte
,short
,Short
,int
,Integer
,long
andLong
.
-
SPACE_FOR_POSITIVE_VALUES
public static final StringFormatPart.Flag SPACE_FOR_POSITIVE_VALUES
The result will include a leading space for positive values. Works on all floating points,StringFormatPart.Conversion.DECIMAL_INTEGER
,StringFormatPart.Conversion.OCTAL_INTEGER
,StringFormatPart.Conversion.HEX_INTEGER
when applied toBigInteger
orStringFormatPart.Conversion.DECIMAL_INTEGER
when applied tobyte
,Byte
,short
,Short
,int
,Integer
,long
andLong
.
-
ZERO_PADDED
public static final StringFormatPart.Flag ZERO_PADDED
The result will be zero-padded. Works on all integrals and floating points.
-
LOCALE_GROUPING_SEPARATOR
public static final StringFormatPart.Flag LOCALE_GROUPING_SEPARATOR
The result will include locale-specific grouping separators. Works only onStringFormatPart.Conversion.DECIMAL_INTEGER
integrals andStringFormatPart.Conversion.SCIENTIFIC_NOTATION
,StringFormatPart.Conversion.DECIMAL
andStringFormatPart.Conversion.SCIENTIFIC_NOTATION_OR_DECIMAL
floating points.
-
PARENTHESES_FOR_NEGATIVES
public static final StringFormatPart.Flag PARENTHESES_FOR_NEGATIVES
The result will enclose negative numbers in parentheses. Works only onStringFormatPart.Conversion.DECIMAL_INTEGER
,StringFormatPart.Conversion.OCTAL_INTEGER
,StringFormatPart.Conversion.HEX_INTEGER
when applied toBigInteger
orStringFormatPart.Conversion.DECIMAL_INTEGER
when applied tobyte
,Byte
,short
,Short
,int
,Integer
,long
andLong
integrals andStringFormatPart.Conversion.SCIENTIFIC_NOTATION
,StringFormatPart.Conversion.DECIMAL
andStringFormatPart.Conversion.SCIENTIFIC_NOTATION_OR_DECIMAL
floating points.
-
PREVIOUS
public static final StringFormatPart.Flag PREVIOUS
The previous position.
-
-
Method Detail
-
values
public static StringFormatPart.Flag[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (StringFormatPart.Flag c : StringFormatPart.Flag.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static StringFormatPart.Flag valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Enum<StringFormatPart.Flag>
-
parse
public static StringFormatPart.Flag parse(char c) throws java.util.UnknownFormatFlagsException
Checks to see if the character is a valid flag.- Parameters:
c
- the character to check.- Returns:
- the corresponding flag for the character.
- Throws:
java.util.UnknownFormatFlagsException
- if the flag is invalid.
-
-