Nuxeo Enterprise Platform 5.1

org.nuxeo.ecm.platform.uidgen
Class AbstractUIDGenerator

java.lang.Object
  extended by org.nuxeo.ecm.platform.uidgen.AbstractUIDGenerator
All Implemented Interfaces:
UIDGenerator
Direct Known Subclasses:
UIDGCoreDocument

public abstract class AbstractUIDGenerator
extends Object
implements UIDGenerator

The abstract class adds some useful methods.

Author:
Constructor Summary
AbstractUIDGenerator()
           
 
Method Summary
protected  int getNext(DocumentModel document)
           
 String getPropertyName()
          Gets the property name used to set the identifier value
protected  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 setSequencer(UIDSequencer sequencer)
          The sequencer used to generate unique numbers sequencialy.
 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.platform.uidgen.UIDGenerator
createUID, getSequenceKey
 

Constructor Detail

AbstractUIDGenerator

public AbstractUIDGenerator()
Method Detail

setSequencer

public final void setSequencer(UIDSequencer sequencer)
Description copied from interface: UIDGenerator
The sequencer used to generate unique numbers sequencialy.

Specified by:
setSequencer in interface UIDGenerator

getNext

protected int getNext(DocumentModel document)
               throws DocumentException
Throws:
DocumentException

getPropertyName

public String getPropertyName()
Description copied from interface: UIDGenerator
Gets the property name used to set the identifier value

Specified by:
getPropertyName in interface UIDGenerator

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.

Specified by:
setPropertyName in interface UIDGenerator

isPropValueDefined

protected final boolean isPropValueDefined(String propName,
                                           DocumentModel document)
                                    throws DocumentException
Checks if the property with the given name is defined and is not null.

Parameters:
propName -
Returns:
Throws:
DocumentException

str

protected final String str(String propName,
                           DocumentModel document)
                    throws DocumentException
Throws:
DocumentException

setUID

public void setUID(DocumentModel document)
            throws DocumentException
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 interface UIDGenerator
Throws:
DocumentException

Nuxeo Enterprise Platform 5.1

Copyright ? 2007 Nuxeo SAS. All Rights Reserved.