All Implemented Interfaces:
IElementRenderer, IXmlElementRenderer

public class XmlField extends XmlDocumentRendererBase

This class converts an IField implementation to an XML node for document xml generation.

For example rendering a field with a value, question text and explain text will result in:

 <FIELD name="Person.Name">
   <QUESTION>The name of the person</QUESTION>
   <EXPLAIN>This is some explanation for this field</EXPLAIN>
   <VALUES>
     <VALUE>Jon</VALUE>
   </VALUES>
 </FIELD>
 

For example rendering a multivalued field with values will result in:

 <FIELD name="Person.Names">
   <VALUES>
     <VALUE first="true">Klaas</VALUE>
     <VALUE last="true">Jan</VALUE>
   </VALUES>
 </FIELD>
 

For example rendering a field with domain values will result in (note that only domain display values are used, no short values):

 <FIELD name="Person.Name">
   <VALUES>
     <VALUE>Jon van Leuven</VALUE>
   </VALUES>
   <DOMAIN>
     <VALUE selected="true">Jon van Leuven</VALUE>
     <VALUE>Ocker Kerpershoek</VALUE>
   </DOMAIN>
 </FIELD>
 
Since:
7.0
Author:
Jon van Leuven
  • Constructor Details

    • XmlField

      protected XmlField(boolean tagsToUpperCase, boolean sortDomainValues)
  • Method Details

    • toXml

      public IXmlElement toXml(IXmlRendererContext ctx, IElement element)
      Description copied from interface: IXmlElementRenderer
      This function allows one to convert an IElement instance to an XML element. The implementor of this function should only convert the element itself and not it's children as the caller will process these. (Unless ctx.setContinueChildProcessing( false ) has been called)
      Parameters:
      ctx - The context which contains some information and control options.
      element - The element which should be converted.
      Returns:
      an XMLElement class or null indicating this element should not be included in the resulting xml.