Package org.apache.log4j.pattern
Class FormattingInfo
java.lang.Object
org.apache.log4j.pattern.FormattingInfo
Modifies the output of a pattern converter for a specified minimum and maximum width and alignment.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionFormattingInfo
(boolean leftAlign, int minLength, int maxLength) Creates new instance. -
Method Summary
Modifier and TypeMethodDescriptionvoid
format
(int fieldStart, StringBuffer buffer) Adjust the content of the buffer based on the specified lengths and alignment.static FormattingInfo
Gets default instance.int
Get maximum length.int
Get minimum length.boolean
Determine if left aligned.
-
Field Details
-
SPACES
private static final char[] SPACESArray of spaces. -
DEFAULT
Default instance. -
minLength
private final int minLengthMinimum length. -
maxLength
private final int maxLengthMaximum length. -
leftAlign
private final boolean leftAlignAlignment.
-
-
Constructor Details
-
FormattingInfo
public FormattingInfo(boolean leftAlign, int minLength, int maxLength) Creates new instance.- Parameters:
leftAlign
- left align if true.minLength
- minimum length.maxLength
- maximum length.
-
-
Method Details
-
getDefault
Gets default instance.- Returns:
- default instance.
-
format
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.
-
getMaxLength
public int getMaxLength()Get maximum length.- Returns:
- maximum length.
-
getMinLength
public int getMinLength()Get minimum length.- Returns:
- minimum length.
-
isLeftAligned
public boolean isLeftAligned()Determine if left aligned.- Returns:
- true if left aligned.
-