src/main/java/org/beigesoft/replicator/service/SrvFieldWriterXmlStd.java
@Override
  public final void write(final Map<String, Object> pAddParam,
    final Object pField, final String pFieldName,
      final Writer pWriter) throws Exception {
    String fieldValue;
    if (pField == null) {
      fieldValue = "NULL";
    } else if (Enum.class.isAssignableFrom(pField.getClass())) {
      fieldValue = String.valueOf(((Enum) pField).ordinal());
    } else if (pField.getClass() == Date.class) {
      fieldValue = String.valueOf(((Date) pField).getTime());
    } else {
      fieldValue = pField.toString();
      if (pField instanceof String) {
        fieldValue = getUtilXml().escapeXml(fieldValue);
      }
    }
    pWriter.write(" " + pFieldName + "=\"" + fieldValue
      + "\"\n");
  }
@Override
  public final void write(final Map<String, Object> pAddParam,
    final Object pField, final String pFieldName,
      final Writer pWriter) throws Exception {
    String fieldValue;
    if (pField == null) {
      fieldValue = "NULL";
    } else if (Enum.class.isAssignableFrom(pField.getClass())) {
      fieldValue = String.valueOf(((Enum) pField).ordinal());
    } else if (pField.getClass() == Date.class) {
      fieldValue = String.valueOf(((Date) pField).getTime());
    } else {
      fieldValue = pField.toString();
      if (pField instanceof String) {
        fieldValue = getUtilXml().escapeXml(fieldValue);
      }
    }
    pWriter.write(" " + pFieldName + "=\"" + fieldValue
      + "\"\n");
  }
@ Override public final void write ( final Map < String , Object > pAddParam , final Object pField , final String pFieldName , final Writer pWriter ) throws Exception { String fieldValue ; if ( pField == null ) { fieldValue = "NULL" ; } else if ( Enum . class . isAssignableFrom ( pField . getClass ( ) ) ) { fieldValue = String . valueOf ( ( ( Enum ) pField ) . ordinal ( ) ) ; } else if ( pField . getClass ( ) == Date . class ) { fieldValue = String . valueOf ( ( ( Date ) pField ) . getTime ( ) ) ; } else { fieldValue = pField . toString ( ) ; if ( pField instanceof String ) { fieldValue = getUtilXml ( ) . escapeXml ( fieldValue ) ; } } pWriter . write ( " " + pFieldName + "=\"" + fieldValue + "\"\n" ) ; }
<p>
Write standard field of entity into a stream
(writer - file or pass it through network).
</p>
@param pAddParam additional params (e.g. exclude fields set)
@param pField value
@param pFieldName Field Name
@param pWriter writer
@throws Exception - an exception
<p > Write standard field of entity into a stream ( writer - file or pass it through network ) . < / p >