ca.infoway.messagebuilder.marshalling.hl7.formatter
Class AbstractNullFlavorPropertyFormatter<V>

Package class diagram package AbstractNullFlavorPropertyFormatter
java.lang.Object
  extended by ca.infoway.messagebuilder.marshalling.hl7.formatter.AbstractPropertyFormatter
      extended by ca.infoway.messagebuilder.marshalling.hl7.formatter.AbstractNullFlavorPropertyFormatter<V>
All Implemented Interfaces:
PropertyFormatter
Direct Known Subclasses:
AbstractAdPropertyFormatter, AbstractAttributePropertyFormatter, AbstractEntityNamePropertyFormatter, AbstractRtoPropertyFormatter, BaseCollectionPropertyFormatter, EdPropertyFormatter

public abstract class AbstractNullFlavorPropertyFormatter<V>
extends AbstractPropertyFormatter

If an object is null, value is replaced by a nullFlavor. So the element would look like this: <element-name nullFlavor="something" /> Otherwise this class hands the formatting off to the formatNonNull method.


Constructor Summary
protected AbstractNullFlavorPropertyFormatter()
           
 
Method Summary
protected  void createMissingMandatoryWarning(FormatContext context)
           
protected  Map<String,String> createNullFlavorAttributes(NullFlavor nullFlavor)
           
protected  V extractBareValue(BareANY hl7Value)
           
 String format(FormatContext context, BareANY hl7Value, int indentLevel)
           
protected  boolean isEmptyCollection(V value)
           
protected  boolean isMandatoryOrPopulated(FormatContext context)
           
protected  Map<String,String> toStringMap(String... string)
           
 
Methods inherited from class ca.infoway.messagebuilder.marshalling.hl7.formatter.AbstractPropertyFormatter
addSpecializationType, createElement, createElement, createElementClosure, createSpecializationTypeAttibutesIfNecessary, createWarning, format, isNullFlavor, xmlify
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractNullFlavorPropertyFormatter

protected AbstractNullFlavorPropertyFormatter()
Method Detail

format

public String format(FormatContext context,
                     BareANY hl7Value,
                     int indentLevel)
Specified by:
format in interface PropertyFormatter
Specified by:
format in class AbstractPropertyFormatter

extractBareValue

protected V extractBareValue(BareANY hl7Value)

isEmptyCollection

protected boolean isEmptyCollection(V value)

createNullFlavorAttributes

protected Map<String,String> createNullFlavorAttributes(NullFlavor nullFlavor)

createMissingMandatoryWarning

protected void createMissingMandatoryWarning(FormatContext context)

isMandatoryOrPopulated

protected boolean isMandatoryOrPopulated(FormatContext context)

toStringMap

protected Map<String,String> toStringMap(String... string)


Copyright © 2013. All Rights Reserved.