Package org.nuxeo.ecm.core.uidgen
Class AbstractUIDGenerator
- java.lang.Object
-
- org.nuxeo.ecm.core.uidgen.AbstractUIDGenerator
-
- All Implemented Interfaces:
UIDGenerator
public abstract class AbstractUIDGenerator extends Object implements UIDGenerator
The abstract class adds some useful methods.
-
-
Constructor Summary
Constructors Constructor Description AbstractUIDGenerator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected intgetNext(DocumentModel document)protected longgetNextLong(DocumentModel document)StringgetPropertyName()Get the property name used to set the identifier value.String[]getPropertyNames()Gets the property name used to set the identifier valueprotected booleanisPropValueDefined(String propName, DocumentModel document)Checks if the property with the given name is defined and is not null.voidsetPropertyName(String propertyName)Sets the property name used to set the identifier value.voidsetPropertyNames(String[] propertyNames)Set the properties used to set the identifier value.voidsetSequencer(UIDSequencer sequencer)The sequencer used to generate unique numbers sequencially.voidsetUID(DocumentModel document)Creates a new UID for the given doc and sets the field configured in the generator component with this value.protected Stringstr(String propName, DocumentModel document)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.nuxeo.ecm.core.uidgen.UIDGenerator
createUID, getSequenceKey
-
-
-
-
Method Detail
-
setSequencer
public final void setSequencer(UIDSequencer sequencer)
Description copied from interface:UIDGeneratorThe sequencer used to generate unique numbers sequencially.- Specified by:
setSequencerin interfaceUIDGenerator
-
getNext
protected int getNext(DocumentModel document)
-
getNextLong
protected long getNextLong(DocumentModel document)
-
getPropertyName
public String getPropertyName()
Description copied from interface:UIDGeneratorGet the property name used to set the identifier value.- Specified by:
getPropertyNamein interfaceUIDGenerator- See Also:
UIDGenerator.getPropertyNames()
-
setPropertyName
public void setPropertyName(String propertyName)
Description copied from interface:UIDGeneratorSets the property name used to set the identifier value.The property must be a string like 'schemaPrefix:fieldName' ; the syntax 'schemaName:fieldName' is also accepted. Could be used as a convenient method when there is only one property to set.
- Specified by:
setPropertyNamein interfaceUIDGenerator- See Also:
UIDGenerator.setPropertyNames(String[])
-
setPropertyNames
public void setPropertyNames(String[] propertyNames)
Description copied from interface:UIDGeneratorSet the properties used to set the identifier value.- Specified by:
setPropertyNamesin interfaceUIDGenerator
-
getPropertyNames
public String[] getPropertyNames()
Description copied from interface:UIDGeneratorGets the property name used to set the identifier value- Specified by:
getPropertyNamesin interfaceUIDGenerator
-
isPropValueDefined
protected final boolean isPropValueDefined(String propName, DocumentModel document)
Checks if the property with the given name is defined and is not null.
-
str
protected final String str(String propName, DocumentModel document)
-
setUID
public void setUID(DocumentModel document) throws PropertyNotFoundException
Description copied from interface:UIDGeneratorCreates a new UID for the given doc and sets the field configured in the generator component with this value.- Specified by:
setUIDin interfaceUIDGenerator- Throws:
PropertyNotFoundException
-
-