|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object fr.umlv.tatoo.cc.common.log.Info
public final class Info
Info is an inmutable/mutable class that gathers different informations
in order to report them using a Reporter
.
Objects of this class are by default mutable but they can be sealed using seal()
in order to make it not mutable.
If an objet is sealed all mutable method will clone()
the object
before change it.
This class act as a builder so method can be chained.
Constructor Summary | |
---|---|
Info()
|
Method Summary | |
---|---|
Throwable |
cause()
Returns the cause of the current info. |
Info |
cause(Throwable cause)
Changes the cause of the current info. |
Info |
clone()
|
int |
column()
Returns the column number of the file associated
with the current info. |
Info |
column(int column)
Sets the column number of the file associated
with the current info. |
Object[] |
data()
Returns an array of datas used to format the message() of the current info. |
Info |
data(Object... data)
Replaces or set the datas used to format the message() . |
static Info |
derive(Level level,
Object... data)
Creates a new info derived from the default info of the thread local reporter. |
static Info |
derive(Level level,
String message,
Object... data)
Creates a new info derived from the default info of the thread local reporter. |
static Info |
error(String message,
Object... data)
Creates a new info derived from the default info of the thread local reporter with the level() Level.ERROR . |
static Info |
fatalError(String message,
Object... data)
Creates a new info derived from the default info of the thread local reporter with the level() Level.FATAL_ERROR . |
Object |
file()
Returns the file associated with the current info. |
Info |
file(Object file)
Changes the file associated with the current info. |
static Info |
fine(String message,
Object... data)
Creates a new info derived from the default info of the thread local reporter with the level() Level.INFO . |
static Info |
info(String message,
Object... data)
Creates a new info derived from the default info of the thread local reporter with the level() Level.FINE . |
boolean |
isSealed()
Returns if the current object is sealed or not. |
Level |
level()
Returns the level of the current info. |
Info |
level(Level level)
Changes the level of the info. |
int |
line()
Returns the line number of the file associated
with the current info. |
Info |
line(int line)
Sets the line number of the file associated
with the current info. |
String |
message()
Returns the message or the message of the cause of the current info. |
Info |
message(String message)
Changes the message of the current info, this message can contains '%' that are resolved using String.format(String, Object[]) . |
void |
report()
Reports the current info using the thread local reporter. |
void |
seal()
Seals the current Info. |
String |
toString()
|
static Info |
warning(String message,
Object... data)
Creates a new info derived from the default info of the thread local reporter with the level() Level.WARNING . |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Info()
Method Detail |
---|
public Info clone()
clone
in class Object
public Level level()
public Info level(Level level)
sealed
, a clone of the current object
is returned.
level
- the new level.
public Object[] data()
message()
of the current info.
public Info data(Object... data)
message()
.
If the current info is sealed
, a clone of the current object
is returned.
data
- the new data
public String message()
public Info message(String message)
String.format(String, Object[])
.
If the current info is sealed
, a clone of the current object
is returned.
message
- the new message
public Throwable cause()
public Info cause(Throwable cause)
sealed
, a clone of the current object
is returned.
cause
- the cause of the info.
public Object file()
public Info file(Object file)
sealed
, a clone of the current object
is returned.
file
- the file.
line()
,
column()
public int line()
file
associated
with the current info.
file()
public Info line(int line)
file
associated
with the current info.
If the current info is sealed
, a clone of the current object
will be returned.
line
- the line number or -1.
public int column()
file
associated
with the current info.
public Info column(int column)
file
associated
with the current info.
If the current info is sealed
, a clone of the current object
will be returned.
column
- the column number or -1.
public void report()
ReporterFactory
public void seal()
public boolean isSealed()
seal()
public String toString()
toString
in class Object
public static Info derive(Level level, Object... data)
level
- set the level of the information.data
- the data associated with the info.
derive(Level, String, Object[])
,
ReporterFactory.getDefaultInfo()
public static Info derive(Level level, String message, Object... data)
level
- set the level of the information.data
- the data associated with the info.message
- the message of the info. It can contains '%' that are
interpreted using String.format(String, Object[])
.
fine(String, Object[])
,
info(String, Object[])
,
warning(String, Object[])
,
error(String, Object[])
,
fatalError(String, Object[])
public static Info fine(String message, Object... data)
level()
Level.INFO
.
data
- the data associated with the info.message
- the message of the info. It can contains '%' that are
interpreted using String.format(String, Object[])
.
derive(Level, String, Object[])
public static Info info(String message, Object... data)
level()
Level.FINE
.
data
- the data associated with the info.message
- the message of the info. It can contains '%' that are
interpreted using String.format(String, Object[])
.
derive(Level, String, Object[])
public static Info warning(String message, Object... data)
level()
Level.WARNING
.
data
- the data associated with the info.message
- the message of the info. It can contains '%' that are
interpreted using String.format(String, Object[])
.
derive(Level, String, Object[])
public static Info error(String message, Object... data)
level()
Level.ERROR
.
data
- the data associated with the info.message
- the message of the info. It can contains '%' that are
interpreted using String.format(String, Object[])
.
derive(Level, String, Object[])
public static Info fatalError(String message, Object... data)
level()
Level.FATAL_ERROR
.
data
- the data associated with the info.message
- the message of the info. It can contains '%' that are
interpreted using String.format(String, Object[])
.
derive(Level, String, Object[])
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |