com.cbse.jeasy
Class JEMessage

java.lang.Object
  extended by com.cbse.jeasy.JEObject
      extended by com.cbse.jeasy.JEMessage

public class JEMessage
extends JEObject

A message is a serialization of components in XML format. GetMessage means save the entrys of the input components to a XML string.

PutMessage will fill the input components out of the given XML string.

The components can be an JEDatafield an JEComboBox an JEComboList an JECheckBox or an JERadioButton.

When you set an element as a panel, all the above components inside the panel will be saved or filled.

Since every component has its unique id, the message uses this id as a XML element. When the JEDatafield DF_country with its label country is filled by a user with the word Germany, the message will store it as

<country>Germany</country>

When storeId is true it will be stored as

<DF_country>Germany</DF_country>

Because of the wellformed XML structure it is easy to work with. Read the JEDatafield by using the function JEUtil.getXMLElement(message,"DF_country"). This function will give you back the string Germany in the above example.

To set a checkbox to true use the XML string

<CH_MyCheckBox>true</CH_MyCheckbox>
To fill a combobox (or list) use the XML string
<CB_My_ComboBox>
<elements>one</elements>
<elements>two</elements>
</CB_My_ComboBox>

To set a selected item in a filled combobox use the XML string
<CB_My_ComboBox>one</CB_My_ComboBox>

Properties
namevaluescomment
id*Id of the object. Let it begin with MS_
separatorNEWLINE
TAB
NEWLINE+TAB
The separator is inserted after each element.
Deprecated: storeIdtrue
false
If it is set to true the name of the field will be the Id of the Object, else the name is the label of the component.
XMLTag_Id*If true the xml tag of the jeasy element is the id of this element.
XMLTag_Label*If true the xml tag of the jeasy element is the label of this element.
XMLTag_Specified*If true the xml tag of the jeasy element is the specified XMLtag of this element.
E1
.
En
 Elements to be added in the message.
* = property you have to set; bold = default value

Version:
%I%, %G%
Author:
H.Pfohl

Field Summary
static int INSIDE
          Specifies that message bracket should not be set.
static int ONLY_FILLED
          Specifies that empty elements should not be get.
 
Fields inherited from class com.cbse.jeasy.JEObject
DEVELOPPING, INPUT_ERROR_DATE, INPUT_ERROR_LENGTH, INPUT_ERROR_MANDATORY, INPUT_ERROR_PARSE, INPUT_ERROR_RANGE, INPUT_ERROR_TIME, INPUT_ERRORS, NO_INPUT_ERROR, RUNNING
 
Constructor Summary
JEMessage()
           
JEMessage(java.lang.String s)
          Reads the properties from a string.
 
Method Summary
 java.lang.String examineMessage()
           
 java.lang.String getElementAt(int n)
          Gets the component of element n
 int getElementSize()
          Gets the number of elements
 java.lang.String getMessage()
           
 java.lang.String getMessage(int config)
          It saves the entrys of the input components to an XML string.
 java.lang.String getMessageString()
           
 java.lang.String getSeparator()
           
 void putMessage(java.lang.String message)
          It will fill the JEasy components out of an XML message.
 void putMessageElement(java.util.Hashtable oht, JEObject jo, java.lang.String message)
           
 void setSeparator(java.lang.String separator)
           
 
Methods inherited from class com.cbse.jeasy.JEObject
backupEntry, clear, deserializeValue, getApplet, getApplLocale, getCenter, getComponent, getEast, getId, getJCallBack, getJClass, getLabel, getMode, getName, getNorth, getObjLocale, getParentId, getPreview, getProjectDirectory, getProperty, getRegisterText, getSouth, getStarted, getTitle, getType, getWest, getXMLtag, isEditable, isEnabled, isEnterprise, isProfessional, isStandard, isVisible, JEadd, JEadd, JEadd, JEadd, JEadd, JEadd, JEadd, JEadd, JEadd, JEadd, JEadd, JEaddTab, removeProperties, removeProperty, restoreEntry, serializeValue, setApplet, setApplLocale, setEditable, setEditable, setEnabled, setEnabled, setFocus, setJCallBack, setMarkable, setMarkable, setMode, setObjLocale, setParentId, setPreview, setProjectDirectory, setProperty, setStarted, setVisible, setVisible, start, wasEntryChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSIDE

public static final int INSIDE
Specifies that message bracket should not be set.

See Also:
Constant Field Values

ONLY_FILLED

public static final int ONLY_FILLED
Specifies that empty elements should not be get.

See Also:
Constant Field Values
Constructor Detail

JEMessage

public JEMessage(java.lang.String s)
Reads the properties from a string.

Parameters:
s - contains properties and values
See Also:
JE#PropertyString

JEMessage

public JEMessage()
Method Detail

getSeparator

public java.lang.String getSeparator()
Returns:
Returns the separator.

setSeparator

public void setSeparator(java.lang.String separator)
Parameters:
separator - The separator to set.

getElementSize

public int getElementSize()
Description copied from class: JEObject
Gets the number of elements

Overrides:
getElementSize in class JEObject
Returns:
id of the JEObject or null

getElementAt

public java.lang.String getElementAt(int n)
Description copied from class: JEObject
Gets the component of element n

Overrides:
getElementAt in class JEObject
Returns:
id of the JEObject or null

getMessage

public java.lang.String getMessage()

getMessageString

public java.lang.String getMessageString()

examineMessage

public java.lang.String examineMessage()

getMessage

public java.lang.String getMessage(int config)
It saves the entrys of the input components to an XML string.

The message begins with <messageid>separator and ends with </messageid>. You can prevent this by setting config with JEMessage.INSIDE.

Setting config with JEMessage.ONLY_FILLED will saves only those components with entrys not null.

Parameters:
config - the Properties key.
Returns:
the message string or null if it did not have one.

putMessage

public void putMessage(java.lang.String message)
It will fill the JEasy components out of an XML message.

Parameters:
message - the message in attribute grammar

putMessageElement

public void putMessageElement(java.util.Hashtable oht,
                              JEObject jo,
                              java.lang.String message)
                       throws java.lang.NullPointerException
Throws:
java.lang.NullPointerException