public class RankProvider extends AbstractTargetValue implements ErrorDependingParameter
PropertyResources.Load, PropertyResources.URLResource| Modifier and Type | Field and Description |
|---|---|
static String |
DEFNAME
Default name of this parameter.
|
private Integer |
defrank
This is the default frame size or null if undefined.
|
private Map<Object,Map<Class<? extends ErrorEvent>,Integer>> |
errors
This lookup-table links target types to lookups of error to frames .
|
static String |
KEY_DEFAULTRANK
This is the default frame, prior to target registering.
|
static String |
KEY_LISTENFOR
We ignore all errors not in this list.
|
static String |
KEY_MESSAGETABLE
This keys links the combined target type plus error to frames .
|
static String |
KEY_TARGETTABLE
This key links target types to frame entries.
|
private Class<? extends ErrorEvent> |
lasterror
Last error event recorded after target registering.
|
private Object |
lasttype
Last target type registered.
|
private List<Class<? extends ErrorEvent>> |
listen
We only listen to these errors.
|
private Map<Object,Integer> |
targets
This lookup-table links target types to frames.
|
static char |
TYPEERRORSEPARATOR
This char separates the target type from the error class name in prop.
|
KEY_INDEXKEY_FORMAT, KEY_NAME, KEY_PRESERVE, UNKNOWNKEY_NOINITONCREATE, POSTFIX_ALPHABET, POSTFIX_BYTES, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_MODTIME, POSTFIX_URLKEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATORNAMING_EXTENSIONCONFIG, KEY_CLASSKEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME| Constructor and Description |
|---|
RankProvider(Map<String,String> prop)
We start by constructing all the lookup-tables in the init section.
|
| Modifier and Type | Method and Description |
|---|---|
Number |
getForError(ErrorEvent ee)
Returns the sub-frame of the currently registered target that would be
active on the specified error.
|
Number |
getForTarget(TargetDefinition td)
Returns the frame that would be used with the stated target, no
error class can be specified.
|
private Integer |
getRank(Object type,
Class<? extends ErrorEvent> ee)
Returns the subframe for a given target type and a specified errror.
|
Number |
getValue()
After registering of targets and possible erros, we can produce a frame.
|
void |
init()
On init, we parse the default rectangle and try to construct all the
lookup tables.
|
private Map<String,Integer> |
parseToInteger(String s)
We parse a properties mapping to a string-to-rectangle mapping.
|
void |
registerError(ErrorEvent ee)
Registers the error.
|
void |
registerTarget(TargetDefinition td)
Registers the target, clears the error received.
|
Number |
setValue(Number o)
Not allowed.
|
get, setgetAsStar, getConstant, getFormattedFor, getSetupcreateParameter, delivers, exit, getFormatted, getFormatted, getName, getPreserveFile, getString, getString, overrideDefaultName, register, rescanned, setName, toStringclone, createFrom, createFrom, createFrom, createInstance, getApplet, getAsResources, getLocate, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, hasLocalURLs, initProperties, keyCreate, keyCreate, reload, setAppletaugment, augment, augment, augment, augment, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, isNew, parseObject, parseObject, reload, removeProperty, requires, setObject, setProperties, setProperty, stringPropertiesequals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitdefaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, parseObject, removeProperty, setObject, setProperty, stringPropertiesgetFormattedForpublic static final char TYPEERRORSEPARATOR
public static final String KEY_LISTENFOR
public static final String KEY_DEFAULTRANK
public static final String KEY_TARGETTABLE
public static final String KEY_MESSAGETABLE
public static final String DEFNAME
private Integer defrank
private Map<Object,Map<Class<? extends ErrorEvent>,Integer>> errors
private Object lasttype
private Class<? extends ErrorEvent> lasterror
private List<Class<? extends ErrorEvent>> listen
public void init()
throws InitException
init in interface Initializableinit in class AbstractParameterInitExceptionpublic void registerTarget(TargetDefinition td)
registerTarget in interface TargetDependingpublic void registerError(ErrorEvent ee)
registerError in interface ErrorDependingParameterpublic Number getForTarget(TargetDefinition td)
getForTarget in interface TargetDependingParametergetForTarget in interface TargetDependingValuepublic Number getForError(ErrorEvent ee)
getForError in interface ErrorDependingParameterpublic Number getValue()
private Map<String,Integer> parseToInteger(String s)
private Integer getRank(Object type, Class<? extends ErrorEvent> ee)