public abstract class TextContext extends FormatContext
A context for plain text parsing/formatting. This context provides
the TextFormat
to parse/format objects
of any class. If not superseded, the text format for a class is specified
by the DefaultTextFormat
annotation.
A text context always returns the most specialized format. If the class
has no default format annotation (inherited or not), then the default
Object
format (which calls Object.toString()
)
is returned. A predefined format exists for the following standard types:
0x112233
)
Modifier | Constructor and Description |
---|---|
protected |
TextContext()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
static TextContext |
enter()
Enters and returns a new text context instance.
|
static <T> TextFormat<T> |
getFormat(Class<? extends T> type)
Returns the text format for the specified type.
|
protected abstract <T> TextFormat<T> |
searchFormat(Class<? extends T> type)
Searches the most specialized format for the specified type.
|
abstract <T> void |
setFormat(Class<? extends T> type,
TextFormat<T> newFormat)
Sets the text format for the specified type (and its sub-types).
|
current, current, enter, enterInner, exit, getOuter, inherit, inner
public static TextContext enter()
public static <T> TextFormat<T> getFormat(Class<? extends T> type)
public abstract <T> void setFormat(Class<? extends T> type, TextFormat<T> newFormat)
protected abstract <T> TextFormat<T> searchFormat(Class<? extends T> type)
Copyright © 2005-2013 Javolution. All Rights Reserved.