Examples of FieldHandler


Examples of org.exolab.castor.mapping.FieldHandler

        if ((id == null) || (value == null)) return;

        ReferenceInfo refInfo = (ReferenceInfo)_resolveTable.remove(id);
        while (refInfo != null) {
            try {
                FieldHandler handler = refInfo.descriptor.getHandler();
                if (handler != null)
                    handler.setValue(refInfo.target, value);
            }
            catch(java.lang.IllegalStateException ise) {

                String err = "Attempting to resolve an IDREF: " +
                        id + "resulted in the following error: " +
View Full Code Here

Examples of uk.nhs.interoperability.payloads.util.fieldtypehandlers.FieldHandler

    for (String fieldName : fieldDefinitions.keySet()) {
      Field field = fieldDefinitions.get(fieldName);
      FieldType fieldType = field.getTypeEnum();
      Logger.trace("===== Processing field: " + field.getName() + " - type specified as: " + fieldType.name() + " multiplicity = " + field.getMaxOccurs());

      FieldHandler handler = fieldType.getHandler();
     
      String xpath = field.getXpath();
      String strValue = null;
      Object fieldValue = p.getValue(field.getName());
     
      // First, see if the field should be included in the output
      boolean outputField = handler.outputField(field, p);
     
      if (outputField) {
        if (field.getMaxOccurs() > 1) {
          // We are expecting an ArrayList with one or more items
          ArrayList list = (ArrayList)fieldValue;
          if (list != null) {
            for (Object fieldListItem : list) {
             
              // Do some pre-processing on the field if required
              boolean continueProcessing =
                  handler.preProcessSerialise(namespaces, fieldListItem, xpath, parent, xmldoc, field, p);

              // Sometimes the pre-processing may handle the node creation itself (e.g. for coded items),
              // in which case we don't need to continue here
              if (continueProcessing) {
                // If the field is not blank, create a new node or nodes for it to go into
                if (!handler.isItemBlank(field, fieldListItem, true)) {
                  createNode(namespaces, xpath, parent, xmldoc, fieldListItem, handler, field, p);
                }
              }
            }
          }
        } else {
          // Do some pre-processing on the field if required
          boolean continueProcessing =
              handler.preProcessSerialise(namespaces, fieldValue, xpath, parent, xmldoc, field, p);
         
          // Sometimes the pre-processing may handle the node creation itself (e.g. for coded items),
          // in which case we don't need to continue here
          if (continueProcessing) {
            // If the field is not blank, create a new node or nodes for it to go into
            if (!handler.isItemBlank(field, fieldValue, false)) {
              createNode(namespaces, xpath, parent, xmldoc, fieldValue, handler, field, p);
            }
          }
        }
      }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.