net.sf.oval.localization.context
Class ResourceBundleValidationContextRenderer

java.lang.Object
  extended by net.sf.oval.localization.context.ResourceBundleValidationContextRenderer
All Implemented Interfaces:
OValContextRenderer

public class ResourceBundleValidationContextRenderer
extends Object
implements OValContextRenderer

This renderer searches for a resource file that is in the same package and has the same name as the validated class. It then tries to lookup a localized version of the validation context, e.g.
com.acme.model.Person.java
com.acme.model.Person.properties
com.acme.model.Person_de.properties
com.acme.model.Person_fr.properties

The properties file is expected to have values following this scheme

 label.class=My translated name of the class name
 label.field.firstname=My translated name of the field "firstname"
 label.field.lastname=My translated name of the field "lastname"
 label.parameter.amount=My translated name of a constructor/method parameter "amount"
 label.method.increase=My translated name of the method "increase"
 

Author:
Sebastian Thomschke

Field Summary
static ResourceBundleValidationContextRenderer INSTANCE
           
 
Constructor Summary
ResourceBundleValidationContextRenderer()
           
 
Method Summary
 String render(OValContext ovalContext)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final ResourceBundleValidationContextRenderer INSTANCE
Constructor Detail

ResourceBundleValidationContextRenderer

public ResourceBundleValidationContextRenderer()
Method Detail

render

public String render(OValContext ovalContext)

Specified by:
render in interface OValContextRenderer


Copyright © 2005-2013 The OVal Development Team. All Rights Reserved.