public interface FileNameTranslator
extends java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static int |
TYPE_DESCR
The type code for a product description translation.
|
static int |
TYPE_IMAGE
The type code for a product image translation.
|
Modifier and Type | Method and Description |
---|---|
boolean |
setArgs(java.lang.String args)
Sets arguments used by the configured translator.
|
java.lang.String |
translate(java.lang.String value,
int type,
int size)
Performs translation for the given value (which would typically be a
product code), file type (TYPE_IMAGE, TYPE_DESCR) and file size
(Product.SIZE_SMALL, Product.SIZE_LARGE) and returns the translated
result.
|
static final int TYPE_IMAGE
static final int TYPE_DESCR
boolean setArgs(java.lang.String args)
DBUFactory.getTranslator
method to obtain an instance of the translator,
the arguments are automatically set using the "dbutl.FileNameTranslator.args"
property value.args
- (String) The translator's arguments.true
if arguments were succesfully set,
otherwise false
.java.lang.String translate(java.lang.String value, int type, int size)
value
- (String) The value to be translated.type
- (int) The type of file to be translated. Must be one
of the types defined by this class (TYPE_IMAGE
or
TYPE_DESCR
).size
- (int) The size of file to be translated. Must be one
of the sizes defined by the Product
class (SIZE_SMALL
or SIZE_LARGE
).