public class ColorMapLoader
extends java.lang.Object
The class is responsible for loading the color-map configuration. The color-map configuration provides the source of data for the Progress COLOR protermcap-attribute.
The configuration is stored in the color-map.xml classpath resource stored at the root of the namespace.
Modifier and Type | Field and Description |
---|---|
private static java.lang.String |
COLOR_MAP_DTD_ID
the DTD id reference used in the color map XML
|
private static java.lang.String |
COLOR_MAP_DTD_RESOURCE
the resource path to he color map DTD
|
private static java.lang.String |
COLOR_MAP_XML_RESOURCE
the resource path to he color map XML
|
private static java.lang.String |
E_NAME_ATTRIBUTES
'attributes' color-map XML attribute name
|
private static java.lang.String |
E_NAME_BACKGROUND
'background' color-map XML attribute name
|
private static java.lang.String |
E_NAME_FOREGROUND
'foreground' color-map XML attribute name
|
private static java.lang.String |
E_NAME_INDEX
'index' color-map XML attribute name
|
private static java.lang.String |
E_NAME_NAME
'name' color-map XML attribute name
|
private static java.lang.String |
E_NAME_TYPES
'types' color-map XML element name
|
private static org.apache.commons.logging.Log |
LOG |
Constructor and Description |
---|
ColorMapLoader() |
Modifier and Type | Method and Description |
---|---|
java.util.Map<java.lang.String,java.util.Map<java.lang.Object,Color>> |
loadAllMappings()
Loads the color map configuration data into the map of terminal names
to map of color name to color values.
|
private int |
parseAttributes(java.lang.String[] attributes)
Converts the array of named color attributes into
a bitset compatible with
ColorAttribute . |
private Color |
parseColor(org.dom4j.tree.DefaultElement colorElement)
Converts the DOM instance of the 'color' xml element into
the instance of type
Color . |
private org.dom4j.Document |
parseDocument()
Loads the color-map xml as classpath resource and using
dom4j sax parser builds its DOM representation.
|
private static final org.apache.commons.logging.Log LOG
private static final java.lang.String COLOR_MAP_XML_RESOURCE
private static final java.lang.String COLOR_MAP_DTD_RESOURCE
private static final java.lang.String COLOR_MAP_DTD_ID
private static final java.lang.String E_NAME_TYPES
private static final java.lang.String E_NAME_INDEX
private static final java.lang.String E_NAME_NAME
private static final java.lang.String E_NAME_FOREGROUND
private static final java.lang.String E_NAME_BACKGROUND
private static final java.lang.String E_NAME_ATTRIBUTES
public java.util.Map<java.lang.String,java.util.Map<java.lang.Object,Color>> loadAllMappings()
private Color parseColor(org.dom4j.tree.DefaultElement colorElement)
Color
.colorElement
- DOM instance representing the 'color' element.Color
private int parseAttributes(java.lang.String[] attributes)
ColorAttribute
.
the instance of type Color
.attributes
- Array of named color attributes.ColorAttribute
.private org.dom4j.Document parseDocument()