|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.Writer
net.sf.mmm.util.io.base.AppendableWriter
net.sf.mmm.util.nls.base.NlsWriter
public class NlsWriter
An NlsWriter is a Writer, that writes the localized message
of the given text. In other words everything that is written here (except via
printRaw(CharSequence) and printlnRaw(CharSequence)) gets
translated via NlsMessage.
| Field Summary | |
|---|---|
private Map<String,Object> |
arguments
|
private Locale |
locale
The Locale to translate to. |
private NlsMessageFactory |
messageFactory
The NlsMessageFactory. |
private String |
newline
The string used to terminate a line. |
private NlsTemplateResolver |
resolver
The NlsTemplateResolver. |
| Fields inherited from class java.io.Writer |
|---|
lock |
| Constructor Summary | |
|---|---|
NlsWriter(Appendable appendable)
The constructor. |
|
NlsWriter(Appendable appendable,
Map<String,Object> arguments)
The constructor. |
|
NlsWriter(Appendable appendable,
Map<String,Object> arguments,
Locale locale)
The constructor. |
|
NlsWriter(Appendable appendable,
Map<String,Object> arguments,
Locale locale,
String newline)
The constructor. |
|
NlsWriter(Appendable appendable,
Map<String,Object> arguments,
Locale locale,
String newline,
NlsMessageFactory messageFactory)
The constructor. |
|
NlsWriter(Appendable appendable,
Map<String,Object> arguments,
Locale locale,
String newline,
NlsMessageFactory messageFactory,
NlsTemplateResolver resolver)
The constructor. |
|
| Method Summary | |
|---|---|
NlsWriter |
append(CharSequence csq)
|
NlsWriter |
append(CharSequence csq,
int start,
int end)
|
Map<String,Object> |
getArguments()
This method gets the arguments for
the created NlsMessages. |
void |
print(CharSequence csq)
This method is the same as append(CharSequence) or
AppendableWriter.write(String). |
void |
print(NlsMessage message)
This method writes an NlsMessage. |
void |
println()
This method writes a newline (line-separator). |
void |
println(CharSequence csq)
This method is like append(CharSequence) or AppendableWriter.write(String)
but additionally adds a newline (line-separator) after the message. |
void |
printlnRaw(CharSequence text)
This method writes the raw text without
internationalization. |
void |
printRaw(CharSequence text)
This method writes the raw text without
internationalization. |
void |
setArguments(Map<String,Object> arguments)
This method sets the arguments. |
| Methods inherited from class net.sf.mmm.util.io.base.AppendableWriter |
|---|
append, close, flush, getAppendable, write, write, write, write |
| Methods inherited from class java.io.Writer |
|---|
write |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
private final NlsMessageFactory messageFactory
NlsMessageFactory.
private final Locale locale
Locale to translate to.
private final String newline
private final NlsTemplateResolver resolver
NlsTemplateResolver.
private Map<String,Object> arguments
getArguments()| Constructor Detail |
|---|
public NlsWriter(Appendable appendable)
appendable - is the Appendable to delegate to.
public NlsWriter(Appendable appendable,
Map<String,Object> arguments)
appendable - is the Appendable to delegate to.arguments - are the arguments.
public NlsWriter(Appendable appendable,
Map<String,Object> arguments,
Locale locale)
appendable - is the Appendable to delegate to.arguments - are the arguments.locale - is the Locale.
public NlsWriter(Appendable appendable,
Map<String,Object> arguments,
Locale locale,
String newline)
appendable - is the Appendable to delegate to.arguments - are the arguments.locale - is the Locale.newline - is the line-separator.
public NlsWriter(Appendable appendable,
Map<String,Object> arguments,
Locale locale,
String newline,
NlsMessageFactory messageFactory)
appendable - is the Appendable to delegate to.arguments - are the arguments.locale - is the Locale.newline - is the line-separator.messageFactory - is the NlsMessageFactory.
public NlsWriter(Appendable appendable,
Map<String,Object> arguments,
Locale locale,
String newline,
NlsMessageFactory messageFactory,
NlsTemplateResolver resolver)
appendable - is the Appendable to delegate to.arguments - are the arguments.locale - is the Locale.newline - is the line-separator.messageFactory - is the NlsMessageFactory.resolver - is the NlsTemplateResolver to use.| Method Detail |
|---|
public NlsWriter append(CharSequence csq,
int start,
int end)
throws RuntimeIoException
append in interface Appendableappend in class AppendableWriterRuntimeIoException
public NlsWriter append(CharSequence csq)
throws RuntimeIoException
append in interface Appendableappend in class AppendableWriterRuntimeIoException
public void print(CharSequence csq)
throws RuntimeIoException
append(CharSequence) or
AppendableWriter.write(String).
csq - is the internationalized message to write.
RuntimeIoException - if an error occurred while
writing.
public void print(NlsMessage message)
throws RuntimeIoException
NlsMessage.
message - is the NlsMessage to write.
RuntimeIoException - if an error occurred while
writing.
public void println()
throws RuntimeIoException
RuntimeIoException - if an error occurred while
writing.
public void println(CharSequence csq)
throws RuntimeIoException
append(CharSequence) or AppendableWriter.write(String)
but additionally adds a newline (line-separator) after the message.
csq - is the internationalized message to write.
RuntimeIoException - if an error occurred while
writing.
public void printRaw(CharSequence text)
throws RuntimeIoException
writes the raw text without
internationalization. It may be used for text that is language independent
or already internationalized.
text - is the raw text to write.
RuntimeIoException - if an IOException occurred while
writing to the underlying
Appendable.
public void printlnRaw(CharSequence text)
throws RuntimeIoException
writes the raw text without
internationalization. It may be used for text that is language independent
or already internationalized.
text - is the raw text to write.
RuntimeIoException - if an IOException occurred while
writing to the underlying
Appendable.public Map<String,Object> getArguments()
arguments for
the created NlsMessages. The arguments may be modified or
replaced before the next message is
written.
public void setArguments(Map<String,Object> arguments)
arguments. This allows to
replace them before writing another message.
arguments - is the arguments to set
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||