ObjectConverter
public class PasswordConverter extends DefaultObjectConverter
Modifier and Type | Field | Description |
---|---|---|
static ConverterContext |
CONTEXT |
ConverterContext if the String is a file name.
|
Constructor | Description |
---|---|
PasswordConverter() |
|
PasswordConverter(char echoChar) |
Creates a PasswordConverter.
|
Modifier and Type | Method | Description |
---|---|---|
Object |
fromString(String string,
ConverterContext context) |
Converts from String to an object.
|
char |
getEchoChar() |
|
void |
setEchoChar(char echoChar) |
|
boolean |
supportFromString(String string,
ConverterContext context) |
If it supports fromString.
|
String |
toString(Object object,
ConverterContext context) |
Converts from object to String based on current locale.
|
supportToString
public static ConverterContext CONTEXT
public PasswordConverter()
public PasswordConverter(char echoChar)
echoChar
- The echo char. It is used to replace the real password so that other people can't see what user is typing.public String toString(Object object, ConverterContext context)
ObjectConverter
toString
in interface ObjectConverter
toString
in class DefaultObjectConverter
object
- object to be convertedcontext
- converter context to be usedpublic char getEchoChar()
public void setEchoChar(char echoChar)
public boolean supportFromString(String string, ConverterContext context)
ObjectConverter
supportFromString
in interface ObjectConverter
supportFromString
in class DefaultObjectConverter
string
- the stringcontext
- context to be convertedpublic Object fromString(String string, ConverterContext context)
ObjectConverter
fromString
in interface ObjectConverter
fromString
in class DefaultObjectConverter
string
- the stringcontext
- context to be converted