Package org.apache.log4j.pattern
Class ExtrasFormattingInfo
- java.lang.Object
-
- org.apache.log4j.pattern.ExtrasFormattingInfo
-
public final class ExtrasFormattingInfo extends java.lang.ObjectModifies the output of a pattern converter for a specified minimum and maximum width and alignment.
-
-
Field Summary
Fields Modifier and Type Field Description private static ExtrasFormattingInfoDEFAULTDefault instance.private booleanleftAlignAlignment.private intmaxLengthMaximum length.private intminLengthMinimum length.private booleanrightTruncateRight truncation.private static char[]SPACESArray of spaces.
-
Constructor Summary
Constructors Constructor Description ExtrasFormattingInfo(boolean leftAlign, boolean rightTruncate, int minLength, int maxLength)Creates new instance.ExtrasFormattingInfo(boolean leftAlign, int minLength, int maxLength)Deprecated.since 1.2.17
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidformat(int fieldStart, java.lang.StringBuffer buffer)Adjust the content of the buffer based on the specified lengths and alignment.static ExtrasFormattingInfogetDefault()Gets default instance.intgetMaxLength()Get maximum length.intgetMinLength()Get minimum length.booleanisLeftAligned()Determine if left aligned.booleanisRightTruncated()Determine if right truncated.
-
-
-
Field Detail
-
SPACES
private static final char[] SPACES
Array of spaces.
-
DEFAULT
private static final ExtrasFormattingInfo DEFAULT
Default instance.
-
minLength
private final int minLength
Minimum length.
-
maxLength
private final int maxLength
Maximum length.
-
leftAlign
private final boolean leftAlign
Alignment.
-
rightTruncate
private final boolean rightTruncate
Right truncation.- Since:
- 1.2.17
-
-
Constructor Detail
-
ExtrasFormattingInfo
public ExtrasFormattingInfo(boolean leftAlign, int minLength, int maxLength)Deprecated.since 1.2.17Creates new instance.- Parameters:
leftAlign- left align if true.minLength- minimum length.maxLength- maximum length.
-
ExtrasFormattingInfo
public ExtrasFormattingInfo(boolean leftAlign, boolean rightTruncate, int minLength, int maxLength)Creates new instance.- Parameters:
leftAlign- left align if true.rightTruncate- right truncate if true.minLength- minimum length.maxLength- maximum length.- Since:
- 1.2.17
-
-
Method Detail
-
getDefault
public static ExtrasFormattingInfo getDefault()
Gets default instance.- Returns:
- default instance.
-
isLeftAligned
public boolean isLeftAligned()
Determine if left aligned.- Returns:
- true if left aligned.
-
isRightTruncated
public boolean isRightTruncated()
Determine if right truncated.- Returns:
- true if right truncated.
- Since:
- 1.2.17
-
getMinLength
public int getMinLength()
Get minimum length.- Returns:
- minimum length.
-
getMaxLength
public int getMaxLength()
Get maximum length.- Returns:
- maximum length.
-
format
public void format(int fieldStart, java.lang.StringBuffer buffer)Adjust the content of the buffer based on the specified lengths and alignment.- Parameters:
fieldStart- start of field in buffer.buffer- buffer to be modified.
-
-