org.x4juli.formatter.pattern
Class FormattingInfo

java.lang.Object
  extended byorg.x4juli.formatter.pattern.FormattingInfo

public class FormattingInfo
extends java.lang.Object

Modifies the output of a pattern converter for a specified minimum and maximum width and alignment.

Logging API as a whole was originally done for Apache log4j. Juli is a port of main parts of that to complete the Java Logging APIs. All credits for initial idea, design, implementation, documentation belong to the log4j crew. This file was originally published by Jim Cakalic, Ceki Gülcü, Curt Arnold. Please use exclusively the appropriate mailing lists for questions, remarks and contribution.

Since:
0.5
Author:
Boris Unckel

Field Summary
private static FormattingInfo DEFAULT
          Default instance.
private  boolean leftAlign
          Alignment.
private  int maxLength
          Maximum length.
private  int minLength
          Minimum length.
private static char[] SPACES
          Array of spaces.
 
Constructor Summary
FormattingInfo(boolean leftAlign, int minLength, int maxLength)
          Creates new instance.
 
Method Summary
 void format(int fieldStart, java.lang.StringBuffer buffer)
          Adjust the content of the buffer based on the specified lengths and alignment.
static FormattingInfo getDefault()
          Gets default instance.
 int getMaxLength()
          Get maximum length.
 int getMinLength()
          Get minimum length.
 boolean isLeftAligned()
          Determine if left aligned.
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SPACES

private static final char[] SPACES
Array of spaces.


DEFAULT

private static final FormattingInfo DEFAULT
Default instance.


minLength

private final int minLength
Minimum length.


maxLength

private final int maxLength
Maximum length.


leftAlign

private final boolean leftAlign
Alignment.

Constructor Detail

FormattingInfo

public FormattingInfo(boolean leftAlign,
                      int minLength,
                      int maxLength)
Creates new instance.

Parameters:
leftAlign - left align if true.
minLength - minimum length.
maxLength - maximum length.
Since:
0.5
Method Detail

getDefault

public static FormattingInfo getDefault()
Gets default instance.

Returns:
default instance.
Since:
0.5

isLeftAligned

public boolean isLeftAligned()
Determine if left aligned.

Returns:
true if left aligned.
Since:
0.5

getMinLength

public int getMinLength()
Get minimum length.

Returns:
minimum length.
Since:
0.5

getMaxLength

public int getMaxLength()
Get maximum length.

Returns:
maximum length.
Since:
0.5

format

public final 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.
Since:
0.5

toString

public java.lang.String toString()

Since:
0.5


${license_html}