| java.text.MessageFormat org.mmbase.storage.util.Scheme
Scheme | final public class Scheme extends MessageFormat (Code) | | This is a specialised version of the MessageFormat class, with some awareness of
MMBase objects. You can pass MMBase objects to Scheme when formatting a pattern.
The Scheme automatically resolves the object to a value it can use in the pattern.
Schemes are used by the storage to create configurable storage instructions (specifically database SQL code).
author: Pierre van Rooden version: $Id: Scheme.java,v 1.6 2006/09/25 12:07:17 michiel Exp $ since: MMBase-1.7 |
Scheme | public Scheme(StorageManagerFactory factory, String pattern)(Code) | | Instantiate the Scheme
Parameters: factory - The factory this scheme belongs to. Parameters: pattern - The pattern to use for the scheme |
format | public String format(Object... params) throws StorageException(Code) | | Applies the parameters to the scheme's pattern.
Parameters: params - an array of parameters to apply to the pattern the result scheme as a String throws: StorageException - if one of the passed parameters cannot be resolved |
resolveParameter | protected Object resolveParameter(Object param) throws StorageException(Code) | | Resolves an object (passed as a parameter) to a value that can be applied in a pattern.
It returns:
- For MMBase: the object storage element identifier as a String (fully expanded table name)
- For MMObjectBuilder: the builder storage element identifier as a String (fully expanded table name)
- For MMObjectNode: the object number as an Integer
- For CoreField: a storage-compatible field name as a String (if no such name exists a StorageException is thrown)
Other object types are returned as is, leaving them to be handled by MessageFormat's formatting code.
Parameters: param - the object to resolve the resolved value throws: StorageException - if the object cannot be resolved |
|
|