Class ExtrasFormattingInfo
java.lang.Object
org.apache.log4j.pattern.ExtrasFormattingInfo
Modifies the output of a pattern converter for a specified minimum
and maximum width and alignment.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final ExtrasFormattingInfoDefault instance.private final booleanAlignment.private final intMaximum length.private final intMinimum length.private final booleanRight truncation.private static final char[]Array of spaces. -
Constructor Summary
ConstructorsConstructorDescriptionExtrasFormattingInfo(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
Modifier and TypeMethodDescriptionvoidformat(int fieldStart, StringBuffer buffer) Adjust the content of the buffer based on the specified lengths and alignment.static ExtrasFormattingInfoGets default instance.intGet maximum length.intGet minimum length.booleanDetermine if left aligned.booleanDetermine if right truncated.
-
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. -
rightTruncate
private final boolean rightTruncateRight truncation.- Since:
- 1.2.17
-
-
Constructor Details
-
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 Details
-
getDefault
-
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
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.
-