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 int
getNext(DocumentModel document)
protected long
getNextLong(DocumentModel document)
String
getPropertyName()
Get the property name used to set the identifier value.String[]
getPropertyNames()
Gets the property name used to set the identifier valueprotected boolean
isPropValueDefined(String propName, DocumentModel document)
Checks if the property with the given name is defined and is not null.void
setPropertyName(String propertyName)
Sets the property name used to set the identifier value.void
setPropertyNames(String[] propertyNames)
Set the properties used to set the identifier value.void
setSequencer(UIDSequencer sequencer)
The sequencer used to generate unique numbers sequencially.void
setUID(DocumentModel document)
Creates a new UID for the given doc and sets the field configured in the generator component with this value.protected String
str(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:UIDGenerator
The sequencer used to generate unique numbers sequencially.- Specified by:
setSequencer
in interfaceUIDGenerator
-
getNext
protected int getNext(DocumentModel document)
-
getNextLong
protected long getNextLong(DocumentModel document)
-
getPropertyName
public String getPropertyName()
Description copied from interface:UIDGenerator
Get the property name used to set the identifier value.- Specified by:
getPropertyName
in interfaceUIDGenerator
- See Also:
UIDGenerator.getPropertyNames()
-
setPropertyName
public void setPropertyName(String propertyName)
Description copied from interface:UIDGenerator
Sets 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:
setPropertyName
in interfaceUIDGenerator
- See Also:
UIDGenerator.setPropertyNames(String[])
-
setPropertyNames
public void setPropertyNames(String[] propertyNames)
Description copied from interface:UIDGenerator
Set the properties used to set the identifier value.- Specified by:
setPropertyNames
in interfaceUIDGenerator
-
getPropertyNames
public String[] getPropertyNames()
Description copied from interface:UIDGenerator
Gets the property name used to set the identifier value- Specified by:
getPropertyNames
in 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:UIDGenerator
Creates a new UID for the given doc and sets the field configured in the generator component with this value.- Specified by:
setUID
in interfaceUIDGenerator
- Throws:
PropertyNotFoundException
-
-