public abstract class AbstractIDGenerator extends AbstractSdxObject implements IDGenerator
IDGenerator.ConfigurationNodeSdxObject.ConfigurationNode| Modifier and Type | Field and Description |
|---|---|
protected Database |
_database |
protected java.lang.String |
ATTRIBUTE_ID_PREFIX
The attribute used to generate a prefix for an id generator.
|
protected java.lang.String |
ATTRIBUTE_ID_SUFFIX
The attribute used to generate a suffix for an id generator.
|
protected java.lang.String |
idPrefix
Prefix for generated ids.
|
protected java.lang.String |
idSuffix
Suffix for generated ids.
|
_configuration, _context, _description, _encoding, _id, _locale, _logger, _manager, _xmlizable_objects, _xmlLang, isToSaxInitializedCLASS_NAME_SUFFIX, PACKAGE_QUALNAMEDEFAULT_ENCODING| Constructor and Description |
|---|
AbstractIDGenerator() |
| Modifier and Type | Method and Description |
|---|---|
void |
configure(org.apache.avalon.framework.configuration.Configuration configuration) |
java.lang.String |
generate()
Generates an id using configured prefix and suffix
|
protected java.lang.String |
getClassNameSuffix()
Sub classes should element this method to return their class name suffix for SAX output
|
java.lang.String |
getPrefix() |
java.lang.String |
getSuffix() |
protected boolean |
initToSax()
Init the LinkedHashMap _xmlizable_objects with the objects in order to describ them in XML
|
protected void |
initVolatileObjectsToSax()
Init the LinkedHashMap _xmlizable_volatile_objects with the objects in order to describ them in XML
Some objects need to be refresh each time a toSAX is called
|
boolean |
isIdUnique(java.lang.String id)
If no lucene index has been provided
(i.e. it is
null) this method
will return true as it has no concrete context
by which it can determine uniqueness |
void |
setDatabase(Database database)
Sets the database for verification of a generated id's uniqueness
|
void |
setIdFieldName(java.lang.String fieldName)
Set's the field name for the id field in the index for id verification needs
|
void |
setIndex(Index docBaseIndex)
Deprecated.
No longer useful
|
void |
setPrefix(java.lang.String idPrefix) |
void |
setSuffix(java.lang.String idSuffix) |
configureDescription, contextualize, enableLogging, getBaseAttributes, getConfiguration, getContext, getDescription, getEncoding, getId, getLocale, getLog, getServiceManager, getXmlLang, service, setDescription, setEncoding, setId, setLocale, setUpSdxObject, setUpSdxObject, setXmlLang, toSAX, verifyConfigurationResourcesclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgenerateprotected final java.lang.String ATTRIBUTE_ID_PREFIX
protected final java.lang.String ATTRIBUTE_ID_SUFFIX
protected Database _database
protected java.lang.String idPrefix
protected java.lang.String idSuffix
public void configure(org.apache.avalon.framework.configuration.Configuration configuration)
throws org.apache.avalon.framework.configuration.ConfigurationException
configure in interface org.apache.avalon.framework.configuration.Configurableconfigure in class AbstractSdxObjectorg.apache.avalon.framework.configuration.ConfigurationExceptionpublic java.lang.String getSuffix()
getSuffix in interface IDGeneratorpublic void setSuffix(java.lang.String idSuffix)
setSuffix in interface IDGeneratorpublic java.lang.String getPrefix()
getPrefix in interface IDGeneratorpublic void setPrefix(java.lang.String idPrefix)
setPrefix in interface IDGeneratorpublic void setIndex(Index docBaseIndex)
setIndex in interface IDGeneratorpublic void setDatabase(Database database)
IDGeneratorsetDatabase in interface IDGeneratorpublic boolean isIdUnique(java.lang.String id)
null) this method
will return true as it has no concrete context
by which it can determine uniquenessisIdUnique in interface IDGeneratorid - The id to verifypublic void setIdFieldName(java.lang.String fieldName)
IDGeneratorsetIdFieldName in interface IDGeneratorpublic java.lang.String generate()
IDGeneratorgenerate in interface IDGeneratorprotected java.lang.String getClassNameSuffix()
AbstractSdxObjectgetClassNameSuffix in class AbstractSdxObjectprotected boolean initToSax()
AbstractSdxObjectinitToSax in class AbstractSdxObjectprotected void initVolatileObjectsToSax()
initVolatileObjectsToSax in class AbstractSdxObjectCopyright © 2000-2010 Ministere de la culture et de la communication / AJLSM. All Rights Reserved.