Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

EDT:XMLConversionJavaGenerationAndRuntime

JAXB is used for XML conversion. JAXB controls XML conversion using Java annotations on the fields.


Java Plugins

org.eclipse.edt.gen.java.templates.jee

The Handler and Record preGenAnnotations scans fields. The EGL Java type for Date, Time, and Timestamp is a Calendar. The runtime conversion can't determine the difference between the 3 types, so an XMLSchemaType is added by generation to indicate which type to serialize. The EGL field name is used as the element or attribute name. If the generated field name is not the same as the EGL name the generator will add an XMLElement or set the XMLElement or XMLAttribute name. This ensures the the XML will use the name specified in the XML annotation name or the name of the EGL field.

Annotation generation has a template for each annotation type. When the annotation is encountered by the generator the specified template is located and used to generate the Java annotation. If the field has a getter method the annotation is generated on the getter, if no getter is present the annotation is generated on the field.

org.eclipse.edt.runtime.java.jee

eglx.xml.XMLLib

   convertToXML: Uses JAXB to convert the passed in record or handler to XML. The JAXB context is the record or handler passed in to the method.
   convertFromXML: Uses JAXB to convert the passed in xml string, record or handler from XML. The JAB context is the record or handler passed in to the method.

Dictionaries have no generated annotations values are converted based on the XML type not the EGL type.

Back to the top