Package loggerForms.controlDescriptions
Class ControlDescription
java.lang.Object
loggerForms.ItemDescription
loggerForms.controlDescriptions.ControlDescription
- Direct Known Subclasses:
CdNMEAInt
,CdSubForm
,CdxHSpace
,CdxNewline
,CdxStatic
,CdxVSpace
,InputControlDescription
- Author:
- GrahamWeatherup
-
Method Summary
Modifier and TypeMethodDescriptionfinal Element
createXMLDataElement
(Document doc, FormsDataUnit formsDataUnit, Object data) Create an XML element containging the control information and data for network communication.final Element
createXMLDataItem
(Document doc, String name, Object value) Create an xml element with a single data value.extractXMLElementData
(Element el, String value) Extract data values from an XML Element.void
fillXMLDataElement
(Document doc, Element el, Object data) Write an xml element with an actual data value.formatDataItem
(Object data) format the data item, primarily used for the table of data.getEType()
needs overridden for 1-many/many-many/many-a relationshipgetHint()
To be used by control Description for to check necessary fields existstatic ControlDescription
makeCd
(FormDescription formDescription, ItemInformation itemInformation) makeComponent
(LoggerForm loggerForm) can now be incorporated in make control if control descriptions hold Class/data arrays of 0 sizeabstract LoggerControl
makeControl
(LoggerForm loggerForm) Get data from a database table item.void
moveDataToTableItems
(Object data) Move data into the database table itemsMethods inherited from class loggerForms.ItemDescription
addItemError, getAdcChannel, getAdcGain, getAnalogueAdd, getAnalogueMultiply, getAutoclear, getAutoUpdate, getColour, getControlOnSubform, getDbTitle, getDefaultValue, getForceGps, getFormDescription, getGetControlData, getHeight, getId, getItemErrors, getItemInformation, getLength, getMaxValue, getMinValue, getNmeaModule, getNmeaPosition, getNmeaString, getNumDBColumns, getOrder, getPlot, getPostTitle, getReadOnly, getRequired, getSendControlName, getTitle, getTopic, getType, setAutoUpdate, setItemErrors, setLength
-
Method Details
-
getFormsTableItems
needs overridden for 1-many/many-many/many-a relationship- Returns:
-
getEType
- Returns:
- the eType
-
makeCd
public static ControlDescription makeCd(FormDescription formDescription, ItemInformation itemInformation) - Returns:
- FormsTableItems related to this controlDescription
-
makeControl
-
makeComponent
can now be incorporated in make control if control descriptions hold Class/data arrays of 0 size- Parameters:
loggerForm
-- Returns:
-
getHint
- Overrides:
getHint
in classItemDescription
- Returns:
- the hint
-
moveDataToTableItems
Move data into the database table items- Parameters:
data
- object of data - must be of a suitable type for this control
-
moveDataFromTableItems
Get data from a database table item.- Returns:
- data object - will be in a type suitable for that control.
-
createXMLDataElement
Create an XML element containging the control information and data for network communication.
These need a fixed format so this is final, however, you can override fillXMLDataElement for controls which have > 1 data value (e.g. a LatLong)- Parameters:
doc
- Parent XML document- Returns:
- XML element
-
fillXMLDataElement
Write an xml element with an actual data value.- Parameters:
doc
-el
-data
-
-
createXMLDataItem
Create an xml element with a single data value.- Parameters:
doc
-name
-value
-- Returns:
-
extractXMLElementData
Extract data values from an XML Element. Unlike the function that writes the elements using toString() this will have to be more complicated to create the correct type of data.
Controls with non standard data types will have to override this.- Parameters:
el
- XML Elementvalue
- Value - quicker and easier for basic controls. Others may have to do a more complex extraction from the Element.- Returns:
- Extracted object or null if data were null of there was a mismatch.
-
formatDataItem
format the data item, primarily used for the table of data.- Parameters:
data
-- Returns:
-
getItemWarning
Description copied from class:ItemDescription
To be used by control Description for to check necessary fields exist- Overrides:
getItemWarning
in classItemDescription
- Returns:
- null if ok otherwise warning string
-