Spring Framework DefaultMessageSourceResolvable - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework DefaultMessageSourceResolvable class.

This code example shows how to use the following methods:getField, getRejectedValue, isBindingFailure, getObjectName, getArguments
This code example shows how to use the following methods:
	 * @param codes the codes to be used to resolve this message 
	 * @param arguments	the array of arguments to be used to resolve this message 
	 * @param defaultMessage the default message to be used to resolve this message 
	 */ 
	public ObjectError(String objectName, String[] codes, Object[] arguments, String defaultMessage) {
		super(codes, arguments, defaultMessage);
		Assert.notNull(objectName, "Object name must not be null");
		this.objectName = objectName;
	} 
 
 
	/** 
	 * Return the name of the affected object. 
	 */ 
	public String getObjectName() {
		return this.objectName;
	} 
 
 
	@Override 
6
CodeRank
This code example shows how to use the following methods:
	 */ 
	@Test 
	@Verifies(value = "evaluate specified message resolvable", method = "doEndTag()") 
	public void doEndTag_shouldEvaluateSpecifiedMessageResolvable() throws Exception { 
		String expectedOutput = "this is a test"; 
		DefaultMessageSourceResolvable message = new DefaultMessageSourceResolvable(new String[] { "test" }, expectedOutput); 
		openmrsMessageTag.setMessage(message); 
		 
		checkDoEndTagEvaluation(expectedOutput); 
	} 
	 
	/** 
	 * @see {@link OpenmrsMessageTag#doEndTag()} 
	 */ 
	@Test 
	@Verifies(value = "resolve message by code", method = "doEndTag()") 
	public void doEndTag_shouldResolveMessageByCode() throws Exception { 
		String expectedOutput = "this is a test"; 
		openmrsMessageTag.setCode("test.code"); 
		 
5
CodeRank
This code example shows how to use the following methods:
     * @return MessageSourceResolvable for the given Object. 
     */ 
    public static MessageSourceResolvable createMessage(Object obj) {
        String[] codes = new String[]{String.valueOf(obj)};
        String defaultMsg = codes[0];
        return new DefaultMessageSourceResolvable(codes, null, defaultMsg);
    } 
 
    /** 
     * Get a message for the given validator action and field from the specified 
     * message source. 
     * <p/> 
     * <p/> 
     * Note: this implementation uses the key of the Fields message for the 
     * given ValidatorAction as the default message. 
     * </p> 
     * 
     * @param messages MessageSource from which to get the message. 
     * @param locale Locale for for this message. 
     * @param va ValidatorAction for this message. 
4
CodeRank
This code example shows how to use the following methods:
this.headerKeys = new String[2];
                this.headerKeys[0] = getPropertyName() + ".header";
                this.headerKeys[1] = getPropertyName();
            } 
            this.header = ValkyrieRepository.getInstance().getApplicationConfig().messageResolver().getMessage(new DefaultMessageSourceResolvable(this.headerKeys, null,
                    this.headerKeys[this.headerKeys.length - 1]));
        } 
        // JTableHeader has a reusable defaultHeaderRenderer on which the default height must be correct. 
        // when painting, the columns headers are processed in order and height is being calculated,  
        // if label is null or empty string header height is 4 and thus leaves us with a very small 
        // table-header, fix this by returning a space (-> font-size is incorporated) 
        return "".equals(this.header) ? " " : this.header;
    } 
 
    /** 
     * Returns the header keys that are used to fetch the column title if the header property is not set. 
     */ 
    public String[] getHeaderKeys()
    { 
4
CodeRank
This code example shows how to use the following methods:
			this.codes = code;
			this.message = message;
		} 
 
		public MessageSourceResolvable getMessage() {
			return new DefaultMessageSourceResolvable(codes, message);
		} 
 
	} 
 
	private final StepExecution stepExecution;
 
	private final StepExecutionHistory stepExecutionHistory;
 
	private double duration = 0;
 
	private double percentageComplete = 0.5;
 
	private boolean isFinished = false;
 
3
CodeRank
This code example shows how to use the following methods:
			this.codes = code;
			this.message = message;
		} 
 
		public MessageSourceResolvable getMessage() {
			return new DefaultMessageSourceResolvable(codes, message);
		} 
 
	} 
 
	private final StepExecution stepExecution;
	private final StepExecutionHistory stepExecutionHistory;
	private double duration = 0;
	private double percentageComplete = 0.5;
	private boolean isFinished = false;
	private PercentCompleteBasis percentCompleteBasis = PercentCompleteBasis.UNKNOWN;
 
	public StepExecutionProgress(StepExecution stepExecution,
			StepExecutionHistory stepExecutionHistory) {
		this.stepExecution = stepExecution;
3
CodeRank