// Path: SDI-core/src/main/java/ch/sdi/core/exc/SdiException.java
// public class SdiException extends Exception
// {
//     private static final long serialVersionUID = 1L;
// 
//     public static final int EXIT_CODE_NO_ERROR = 0;
//     public static final int EXIT_CODE_UNKNOWN_ERROR = 1;
//     public static final int EXIT_CODE_PARSE_ERROR = 2;
//     public static final int EXIT_CODE_CONFIG_ERROR = 3;
//     public static final int EXIT_CODE_MAIL_ERROR = 4;
//     public static final int EXIT_CODE_IMPORT_ERROR = 5;
//     public static final int EXIT_CODE_FTP_ERROR = 6;
//     public static final int EXIT_CODE_SSH_ERROR = 7;
// 
//     private int myExitCode;
// 
//     /**
//      * Constructor
//      *
//      */
//     public SdiException( int aExitCode )
//     {
//         super();
//     }
// 
//     /**
//      * Constructor
//      *
//      * @param aMessage
//      */
//     public SdiException( String aMessage, int aExitCode )
//     {
//         super( aMessage );
//         myExitCode = aExitCode;
//     }
// 
//     /**
//      * Constructor
//      *
//      * @param aCause
//      */
//     public SdiException( Throwable aCause, int aExitCode )
//     {
//         super( aCause );
//         myExitCode = aExitCode;
//     }
// 
//     /**
//      * Constructor
//      *
//      * @param aMessage
//      * @param aCause
//      */
//     public SdiException( String aMessage, Throwable aCause, int aExitCode )
//     {
//         super( aMessage, aCause );
//         myExitCode = aExitCode;
//     }
// 
// 
//     /**
//      * @return exitCode
//      */
//     public int getExitCode()
//     {
//         return myExitCode;
//     }
// 
//     /**
//      * @param aThrowable
//      * @return
//      */
//     public static SdiException toSdiException( Throwable aThrowable )
//     {
//         return toSdiException( aThrowable, SdiException.EXIT_CODE_UNKNOWN_ERROR );
//     }
// 
//     /**
//      * @param aThrowable
//      * @return
//      */
//     public static SdiException toSdiException( Throwable aThrowable, int aErrorCode )
//     {
//         SdiException newEx;
//         if ( aThrowable instanceof SdiException )
//         {
//             newEx = (SdiException) aThrowable;
//         }
//         else
//         {
//             newEx = new SdiException( "Throwable caught ", aThrowable, aErrorCode );
//         } // if..else t instanceof SdiException
// 
//         return newEx;
//     }
// 
//     @Override
//     public String toString()
//     {
//         String result = super.toString();
// 
//         result += "; ExitCode: " + myExitCode;
// 
//         return result;
//     }
// 
// 
// }
// 
// Path: SDI-core/src/main/java/ch/sdi/core/intf/FieldConverter.java
// public interface FieldConverter<T>
// {
//     /**
//      * Each concrete converter is responsible for initializing itself
//      * <p>
//      *
//      * @param aEnv
//      * @param aFieldname the field for which the converter is responsible
//      * @return the initialized converter (fluent API)
//      * @throws SdiException if the initialization fails
//      */
//     public FieldConverter<T> init( Environment aEnv, String aFieldname ) throws SdiException;
// 
//     /**
//      * Converts the given value to the desired target type.
//      * <p>
//      * @param aValue the value to be converted
//      * @return the converted value (or <code>null</code> if input is <code>null</code>)
//      * @throws SdiException if the conversion fails.
//      */
//     public T convert( String aValue ) throws SdiException;
// 
// }


import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
import ch.sdi.core.annotations.SdiConverter;
import ch.sdi.core.exc.SdiException;
import ch.sdi.core.intf.FieldConverter;
/**
 * Copyright (c) 2014 by the original author or authors.
 *
 * This code is free software; you can redistribute it and/or modify it under the terms of the
 * GNU Lesser General Public License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * The above copyright notice and this permission notice shall be included in all copies or
 * substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
 * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */


package ch.sdi.core.impl.data.converter;




/**
 * Default converter for all collected values which do not have a special converter configured. It just
 * returns the given value.
 * <p>
 * It is provided for convenience (in order not to have null checks in iterations over the collected
 * fields)
 * <p>
 *
 * @version 1.0 (09.11.2014)
 * @author  Heri
 */
@SdiConverter( "default" )
@Component
public class ConverterString implements FieldConverter<String>
{
    /**
     * @see ch.sdi.core.intf.FieldConverter#convert(java.lang.String)
     */
    @Override
    public String convert( String aValue ) throws SdiException
    {
        return aValue;
    }

    /**
     * @see ch.sdi.core.intf.FieldConverter#init(org.springframework.core.env.Environment, java.lang.String)
     */
    @Override
// Path: SDI-core/src/main/java/ch/sdi/core/exc/SdiException.java
// public class SdiException extends Exception
// {
//     private static final long serialVersionUID = 1L;
// 
//     public static final int EXIT_CODE_NO_ERROR = 0;
//     public static final int EXIT_CODE_UNKNOWN_ERROR = 1;
//     public static final int EXIT_CODE_PARSE_ERROR = 2;
//     public static final int EXIT_CODE_CONFIG_ERROR = 3;
//     public static final int EXIT_CODE_MAIL_ERROR = 4;
//     public static final int EXIT_CODE_IMPORT_ERROR = 5;
//     public static final int EXIT_CODE_FTP_ERROR = 6;
//     public static final int EXIT_CODE_SSH_ERROR = 7;
// 
//     private int myExitCode;
// 
//     /**
//      * Constructor
//      *
//      */
//     public SdiException( int aExitCode )
//     {
//         super();
//     }
// 
//     /**
//      * Constructor
//      *
//      * @param aMessage
//      */
//     public SdiException( String aMessage, int aExitCode )
//     {
//         super( aMessage );
//         myExitCode = aExitCode;
//     }
// 
//     /**
//      * Constructor
//      *
//      * @param aCause
//      */
//     public SdiException( Throwable aCause, int aExitCode )
//     {
//         super( aCause );
//         myExitCode = aExitCode;
//     }
// 
//     /**
//      * Constructor
//      *
//      * @param aMessage
//      * @param aCause
//      */
//     public SdiException( String aMessage, Throwable aCause, int aExitCode )
//     {
//         super( aMessage, aCause );
//         myExitCode = aExitCode;
//     }
// 
// 
//     /**
//      * @return exitCode
//      */
//     public int getExitCode()
//     {
//         return myExitCode;
//     }
// 
//     /**
//      * @param aThrowable
//      * @return
//      */
//     public static SdiException toSdiException( Throwable aThrowable )
//     {
//         return toSdiException( aThrowable, SdiException.EXIT_CODE_UNKNOWN_ERROR );
//     }
// 
//     /**
//      * @param aThrowable
//      * @return
//      */
//     public static SdiException toSdiException( Throwable aThrowable, int aErrorCode )
//     {
//         SdiException newEx;
//         if ( aThrowable instanceof SdiException )
//         {
//             newEx = (SdiException) aThrowable;
//         }
//         else
//         {
//             newEx = new SdiException( "Throwable caught ", aThrowable, aErrorCode );
//         } // if..else t instanceof SdiException
// 
//         return newEx;
//     }
// 
//     @Override
//     public String toString()
//     {
//         String result = super.toString();
// 
//         result += "; ExitCode: " + myExitCode;
// 
//         return result;
//     }
// 
// 
// }
// 
// Path: SDI-core/src/main/java/ch/sdi/core/intf/FieldConverter.java
// public interface FieldConverter<T>
// {
//     /**
//      * Each concrete converter is responsible for initializing itself
//      * <p>
//      *
//      * @param aEnv
//      * @param aFieldname the field for which the converter is responsible
//      * @return the initialized converter (fluent API)
//      * @throws SdiException if the initialization fails
//      */
//     public FieldConverter<T> init( Environment aEnv, String aFieldname ) throws SdiException;
// 
//     /**
//      * Converts the given value to the desired target type.
//      * <p>
//      * @param aValue the value to be converted
//      * @return the converted value (or <code>null</code> if input is <code>null</code>)
//      * @throws SdiException if the conversion fails.
//      */
//     public T convert( String aValue ) throws SdiException;
// 
// }


// Path: SDI-core/src/main/java/ch/sdi/core/impl/data/converter/ConverterString.java
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
import ch.sdi.core.annotations.SdiConverter;
import ch.sdi.core.exc.SdiException;
import ch.sdi.core.intf.FieldConverter;

/**
 * Copyright (c) 2014 by the original author or authors.
 *
 * This code is free software; you can redistribute it and/or modify it under the terms of the
 * GNU Lesser General Public License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * The above copyright notice and this permission notice shall be included in all copies or
 * substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
 * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */


package ch.sdi.core.impl.data.converter;




/**
 * Default converter for all collected values which do not have a special converter configured. It just
 * returns the given value.
 * <p>
 * It is provided for convenience (in order not to have null checks in iterations over the collected
 * fields)
 * <p>
 *
 * @version 1.0 (09.11.2014)
 * @author  Heri
 */
@SdiConverter( "default" )
@Component
public class ConverterString implements FieldConverter<String>
{
    /**
     * @see ch.sdi.core.intf.FieldConverter#convert(java.lang.String)
     */
    @Override
    public String convert( String aValue ) throws SdiException
    {
        return aValue;
    }

    /**
     * @see ch.sdi.core.intf.FieldConverter#init(org.springframework.core.env.Environment, java.lang.String)
     */
    @Override
    public FieldConverter<String> init( Environment aEnv, String aFieldname ) throws SdiException