Package org.hibernate.validator.internal.engine.messageinterpolation

Examples of org.hibernate.validator.internal.engine.messageinterpolation.FormatterWrapper


    if ( !( params[0] instanceof String ) ) {
      throw new ELException( "The first argument to Formatter#format must be String" );
    }

    FormatterWrapper formatterWrapper = (FormatterWrapper) context.getVariableMapper()
        .resolveVariable( FORMATTER )
        .getValue( context );
    Object[] formattingParameters = new Object[params.length - 1];
    System.arraycopy( params, 1, formattingParameters, 0, params.length - 1 );

    Object returnValue;
    try {
      returnValue = formatterWrapper.format( (String) params[0], formattingParameters );
      context.setPropertyResolved( true );
    }
    catch ( IllegalFormatException e ) {
      throw new ELException( "Error in Formatter#format call", e );
    }
View Full Code Here


    if ( !( params[0] instanceof String ) ) {
      throw new ELException( "The first argument to Formatter#format must be String" );
    }

    FormatterWrapper formatterWrapper = (FormatterWrapper) context.getVariableMapper()
        .resolveVariable( FORMATTER )
        .getValue( context );
    Object[] formattingParameters = new Object[params.length - 1];
    System.arraycopy( params, 1, formattingParameters, 0, params.length - 1 );

    Object returnValue;
    try {
      returnValue = formatterWrapper.format( (String) params[0], formattingParameters );
      context.setPropertyResolved( true );
    }
    catch ( IllegalFormatException e ) {
      throw new ELException( "Error in Formatter#format call", e );
    }
View Full Code Here

TOP

Related Classes of org.hibernate.validator.internal.engine.messageinterpolation.FormatterWrapper

Copyright © 2018 www.massapicom. 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.